Learning Rust by comparing it to Ruby

Michael Krisher
2 min readJan 16, 2024

Originally intended to be a newsletter series.

For the past few months, I have been learning Rust. While doing so, I’ve been comparing it to another language I am very fluent in–Ruby. The languages are vastly different and their ecosystems advocate for different use cases as well, but a string is a string. And a struct is a struct. Or are they?

Photo by Thomas Kinto on Unsplash

When attempting to learn languages, either because I’m curious or because a project uses them, I go through a mental checklist that starts with the fundamentals. How do I get started? How are variables declared? What objects are available? This seems to cover nearly any language. So this has been my approach to Rust.

In a series of posts, I will cover a specific fundamental and compare it to Ruby, providing as near equivalent code samples as I can. Some may illustrate a point, but those will be noted.

I’m still forming an Archipelago of Ideas (see Building a Second Brain) regarding topics, but here is a work in progress to give a sense of what future posts will cover:

Getting Started:
- Cover the installers (brew and Ruby’s/rvm and rustup)
- File extensions
- How to run your code
- Debugging:
` Pry and Debug vs dbg
` Look into rust-gdb, and rust-lldb
- Println vs puts
- Eprintln
- OO
` is Rust OO?
- Array vs Vector
- Strings
` String…

--

--