Home » Ruby (page 3)

Ruby

Rust for Java Devs – Compiling code and using Cargo

After my last post seemed to be well received I am back with another Rust for Java Devs post. Today we will look at a compiling Rust code and have a brief look at using the basics of Cargo. For a developer there isn’t much difference between how to compile Rust code compared to Java, but where they vary are ...

Read More »

Rust Design Considerations with Borrowing

Rust has a fairly unique way of handling memory-freeing by implementing an ownership system. Each code item you create in Rust is assigned ownership/lifetime at the time of its creation. From that point on, you may choose to let the item be borrowed by things further on within the same scope or allow the ownership to be consumed (taken over) ...

Read More »

Rust for Java Devs – Creating Variables

I’m going to do something different today and write about Rust instead of Java. This is something that I want to give a try and if it all goes well I will continue writing some posts about Rust in the future. I will be writing about learning Rust from the perspective of a Java developer by making comparisons where appropriate ...

Read More »

Tracking Object Allocation in Ruby

Whenever you do something like MyClass.new, Ruby creates a new object, which uses a little bit of memory. But that’s not the only way you are creating objects. Many actions will create objects, including strings and arrays. Even if you don’t say String.new or Array.new, it’s still a new object that is being created for you. Because memory is not ...

Read More »

Mixing Ruby and Rust on Heroku

Ruby has been around for a good many years now and has become a quite well-seasoned language. There are many profitable tools, projects, and sites with code written in Ruby, which is a nice thing that we can utilize even in Rust. In this post, I’ll be covering running Ruby code from Rust, touch on Rust from Ruby, and deploying ...

Read More »

Improving Ruby Performance with Rust

A couple of years ago, I found a few methods in my Rails application that were called several thousand times and accounted for more than 30 percent of my website’s page load time. Each of these methods were strictly focused on file pathnames. Along with that, I came across a blog post that said “Rust to the Rescue of Ruby,” ...

Read More »

Integrating React in a 6+ Year Old Rails App

When it comes to modern JavaScript frameworks, it’s tempting to think of them as belonging to the bleeding edge as far as web technologies. But it can be a momentous task to install a modern framework into an older application — that can actually be the downfall of using these frameworks. Last year, we were approached by one of our ...

Read More »

Creating Configuration Objects in Ruby

There are many kinds of applications and many ways to manage how they behave or perform via configurations. Software is designed with default behavior built in, so some specific configuration is usually required before the software works (like a path to reach a dependency), or a default and possibly rudimentary implementation may run without it. From system tools that can ...

Read More »

Understanding Lifetimes in Rust

With the convenience of higher level languages that handle the scope of how long each object in our code base exists, many of us have not needed to learn nor understand lifetimes of objects beyond understanding scopes themselves. Rust likewise manages lifetimes for us, where we have more control of simple situations via ownership and borrowing. In more complex situations, ...

Read More »