So I’ve been programming for a while, I started with Basic, then C/C++ on to Java/Groovy, ABAP, Python then now JavaScript. I learned something new with each new language and I wanted to keep that going.
Recently I gave a talk about JavaScript build tools and talked about why some of those are switching over to rust. When I gave that talk I knew absolutely nothing about the Rust programming language, but during research, I really got interested in Rust and decided to learn it.
So to keep myself accountable and as a form of note-taking, I’ll blog about what I learn here.
Now I’d love to say this will be daily but let’s be honest, I have a day job, a 5-year-old, and a life so more likely it will be weekly.
Let’s dive in.
Installation was painless, but I’m on Linux, so nothing weird there. I just ran
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Code language: JavaScript (javascript)
And that was it.
fn main() {
println!("Hello, world!");
}
Code language: Rust (rust)
So I’m guessing the fn is the rust equivalent of js’s function
. The println
is nostalgic from my c/c++ days but what’s up with that that exclamation mark(!)
Programs start from main, c++ again, and are compiled. It’s going to be weird since for the last few years I haven’t been compiling programs.
But whatever, moving on…
It also turns out we have a code formatter, rustfmt
. This is awesome because ESLint and StandardJs left their mark on me.
I usually don’t use semi-colons in JavaScript, thanks StandardJs, but they are required now. Apparently, they can be omitted in some instances but we’ll get to that another time I hope. I also found out the meaning of the !
at the end of the function, another thing that may need its own article.
Finally today I learned the word Rustacean. Apparently, it’s a person who uses, contributes to, or is interested in the development of Rust. So since I wrote “hello world” apparently I’m now a Rustacean, lol.
That was day one, nothing happened. Are you a Rustacean? Say hi on Twitter @phoexer, and happy coding.
Today I am working on a summation problem made to look like building a tower out of cubic bricks. It’s fun to brute force sometimes.
Coming back to Rust code after a bit of a hiatus with a simple problem… The Two-sum problem. Finding numbers in an array. Yay, fun.
King Pinn: I Salute You. I’m driving halfway across the country and this song is on repeat. Rest in Peace Tonderai Makoni. You were awesome.
After a few weeks off I’m back to business. This is just an update post detailing plans for the rest of the year.
At last we finally have the great reveal, our mystery project was implementing RSA encryption in rust.