[3] Why I love Rust.

[3] Why I love Rust.

·

7 min read

I can't believe I wrote a whole blog post about why I love a programming language but,

I first heard about Rust back when I'm in college. I used to(still do) watch a lot of YouTube videos when I'm chilling in my college room, and a great number of those videos are from tech/programming vlogs, tutorials, explanations, and talks channels, among others.

I was subscribed to Engineer man and he uploaded a video titled Let's Learn Rust: Installation, Cargo, Project Structure, and Primer. I watched it in my friend's bunk bed in his room and that was the first time I have ever heard about Rust. There were some questions in my mind since ideas like "Rust is a C replacement", "safety, security, performance triad" and how unique the language looks and feels, really seems to catch a diploma student in Computer Science's interest.

Now at the time, I have been very interested to know about low-level programming stuff. Things like databases, operating systems, web servers and cli programs like git, I've always wanted to know how people write those programs.

I've learned to cout and cin, print these pretty cli menus and execute sub-programs depending on user input, data structures, programming paradigms and some web stuff with LAMP in uni. If those are the fundamentals used by programmers(software and systems engineers) to build those stuff, how did they do it?


Start of rant

Yes, those are the only "practical" things they taught you in a CS diploma course in my uni. Some OS theories are touched on, but we never implemented things like synchronous programs, handling errors, or socket programming. So, most students can get away by just memorizing stuff, and that to me is just sad and a waste of everybody's time. The practical courses do not introduce you to the cli to do your work, like, ever. No vi, awk, sed. Sad.

Maybe more people can pass by memorising(and maybe that's the biggest thing they care about), but these soon-to-be software engineers of ours will be lacking a lot of fundamental knowledge that they should've got. Lacking of fundamental knowledge might realize itself in the future as negative impacts to 1) the organizations that hire these students, 2) the student's career, and 3) the research & development in tech for our country. Our academia might have more "We present technique X which is better than previous techniques" instead of "We use technique_from_other_research X for problem Y" if we have more people that truly understand the fundamental and are genuinely curious on how to invent better techniques in their domain to solve problems in the world. Producing students with a lot of knowledge debts in their domain is a big no.

Okay lmao end of rant, back to Rust.


Back then, I used to think that those types of systems are never written anymore, and I imagine people similar to Dennis Ritchie and Linus Torvalds are the ones that wrote them back in the day, like in the 1990s-2000s or something.

I've always thought that I had to be a kid with an atari or the 8-bit computers and have played Doom and wrote BASIC in my childhood to know how to program those things now. But oh well I was born riiight at the end of that era.

Then I learned Rust, and two magical things changed the way I think: 1) the onboarding experience and 2) the community. No one, I repeat, NO ONE can imagine how good a programming language's onboarding experience can be if they have never learnt Rust.

The Book, which is what everyone must read when entering the Rustland(or Rust-verse since its so good even in the blockchain industry i.e. Polkadot, Solana), introduces you not only to Rust but to things that you can do with it and shows how to do them.

This is huge for me because if I were to learn how these programs were built while learning C or C++, it would've taken me months before I knew how to build a toy grep implementation with it and learnt what moving, copying, the stack and the heap, smart pointers, threading, cli environment arguments, and graceful error handling(and more) are and how they work. In Rust, you have Steve explaining them to you in no way that you have ever experienced in being told what a programming language is before(Steve is one of the authors of the book and one of the people of Rust twitter). After the book, with university and other things to learn, I've managed to implement an HTML and PNG file format parser in a year, learning from tutorials that give you tests and function stubs for you to implement.

The fundamental knowledge can be learned and practiced at any higher level in the software stack, but actually learning it at the lower level will change how you think about the upper levels. It also opens to a lot of other topics to understand, and the concepts in those topics will be easier to reason about.

When you've learned how bytes are manipulated, executed, allocated(written), deallocated(removed) and represented, other things up the stack are just abstractions to you and you have the intuition of how they are built, how to build them, or how they work...

... and Rust was the perfect tool and environment for me to do just that.

Now, I know that I'd like to work in the "systems programming" side of things if it's not web backend, and I'd choose companies/organizations/DAOs that use Rust over any others if I had to choose.

I think systems programming needs more time to become an expert in, and contributing to open source projects while you learn or learn while you are contributing is the way to go, since we can choose for the low hanging tagged-as-easy issues and find more complex stuff as we gain more experience. And oh boy the open source community is so welcoming. At least in Rust and for the high star repositories since they most probably have organizations backing them, and so they are more professional and supportive to newcomers(everything within the rust-lang organization in GitHub is. You can feel like you're in a whole social media in there, but more productive with fewer dramas and news and shit. It's like we can see what people talk about their or someone's work and we can join in to discuss, see their work, thank them because it's the feature that we have been waiting for and stuffs. It's awesome. And that's a quality that you can find from GitHub as a whole, not just the rust portion of it).

What's also awesome for the community side is the official weekly blog about Rust and its ecosystem, adoption, community activities and all things rust named "This Week In Rust(TWIR)". You are to discover a lot of stuff if you start reading it. There's a lot of companies that use Rust that blogs too, and often tell their experience using it, how they used it and the results they got out of it. TWIR is also where I found top-tier Rust YouTubers like jonhoo, Tim McNamara and Ryan Levick. Also quality blogs like Amos's fasterthanlime. It turns out that there are active developments with lively communities in the area that I thought only bearded Linux sysadmin people can enter! People like me, in their 20s and a complete novices in the systems programming world. They are going around hacking, building and contributing to things that they love, are interested and curious about. And that's just beautiful if you ask me.

So in conclusion, Rust has a very good onboarding experience. Then once you're in, the tooling and community will make you stay, and I haven't even talked about the language features like enum(they are my favourites), iterators(this one too) and error handling. But most importantly, knowing that writing this beautiful high-level looking code actually runs like lightning feels so nice that you hope Rust can be used at all the places. Because you want to work doing X but like pleaasseee let there be a company that does X in Rust and is hiring so I can work there(surprisingly, there's like no one using Rust in my country if compared to js(node + react), java, php and go). Because you know how good of a work experience you can have if you write in Rust every day.

So yeah, that's why I love Rust.

Y'all right now ->

image.png