In Rust We Trust

For many years, I was primarily a C programmer. I learned C shortly after fire was invented. It was an exciting time, what with the discovery of the wheel; it was clear that the whole world was changing. I would ride my dinosaur to school, and then bang together software in C. I was using emacs, of course. As an undergrad, one of the hazing rituals was to break the pinkie fingers of a freshman, and set them at an angle so that they would be able to hold down the control key while typing any letter on the keyboard. Almost everything in this paragraph is completely untrue. Or is it?

But in all seriousness, I love C. An awesome language, and I have an infinite amount of love for Brian Kernighan (even though he was a professor at Princeton) and Dennis Ritchie.

I teach C as part of one of my undergrad courses. It's a freshman-level architecture class, where I try to get students to understand how microprocessors actually work. C is just assembly language with better syntax. Assembly language is just machine code with better syntax. Machine code is just flipping switches on transistors. I don't go any lower in the abstraction layers. Anything below the transistor level is magic.


I stole this from Reddit.
https://www.reddit.com/r/ProgrammerHumor/comments/orerw4/abstraction/?rdt=44491
It's all an abstraction

I never got on the bandwagon for C++. The << and >> for input and output really bothers me (it's bit shifting! what on earth was Bjarne thinking?!). I just didn't like the syntax, templating. It just never felt right. I met Bjarne at an ACM event; really nice guy, not at all the diabolical monster I had imagined him to be, based on his language. I never got on the Java bandwagon either. Sun Microsystems promoted Java instead of TCL, and I can't forgive them for that. TCL is so much better.

Objective C was the first "modern" language that clicked for me. I write iOS apps in my spare time, and have gotten hooked on how Apple has set things up with their UI. Really nice stuff.

But now? Rust-lang.org, my friends. If you have not checked it out, check it out. I had heard about it from some of my faculty colleagues, so it was on my to-learn radar. One of my undergrad students got pulled in to work on chip global routing contest, and they suggested doing the code in Rust -- so it seemed like the right time. I try to listen to the undergrads; they can be really smart.

What's good about Rust?

  • The Cargo build system and package management. Imagine CMake, but it's not cryptic and always breaking? With automatic downloading of whatever software package you need to build a project from GitHub. And version control. Absolutely fantastic.
  • Container classes that do what the STL does in C++, but not clunky and weird. Vectors, hash maps, heaps. All working as templates, but not crufty. And don't get me started on Boost. Yes, Boost does a lot of cool things; I still hate it.
  • The data ownership model... Initially confusing for someone coming from C, who was very comfortable with pointers, but wow, is this done the right way in Rust. Very very cool.
  • The whole language encourages modularity, encapsulation, reusability. It's all clean and comprehensible.

So, after decades of working almost exclusively in C, I'm now working almost exclusively in Rust. Highly recommended. In Rust I Trust.

https://youtu.be/6iiGQmWCCyI?si=OzmN5BESCp-JKbmC


Heck yeah!! I've been on the Rust train since I was your student (pre-1.0), welcome aboard Prof!

I've been doing some MCTS experiments in it. It's been a struggle to learn it, but I am finding it shape my thinking in a new way. I think I'm going to keep going at it. (Also... I know Python, even with C libraries - numpy and numba - isn't a great example for speed, but my Rust version is ploughing through iterations at about 20x the speed)

Like
Reply

true that - "break the pinkie fingers"

Like
Reply

I absolutely loved your opening paragraph ! 😂😂😂

Like
Reply

To view or add a comment, sign in

More articles by Patrick Madden

  • Benchmarks and Research in an AI World

    [Related ISPD 2026 paper] Over the past few years, there's been rapid growth in the use of AI in almost any area you…

    2 Comments
  • One more GPU bro! One more GPU will fix it!

    I was at a faculty gathering the other day, and wound up talking to one of my colleagues from economics. As you might…

    1 Comment
  • The Bug

    One of my former students asked about the trickiest bug anyone had run into -- and that got me reminiscing about The…

    6 Comments
  • Bad Vibe Coding

    AI-powered programming has been getting a lot of attention, with the promise that it will revolutionize programming…

    5 Comments
  • This Chip is Bananas (B A N A N A S)

    For reasons, I've been thinking about circuit topologies quite a bit lately. It's stuff that probably wouldn't make it…

    12 Comments
  • Big-O, Amdahl, Finals

    End of the semester, so I'm busy with finals. This time around, I'm teaching core computer science algorithms, with…

    4 Comments
  • Benchmarking mixed-size placement

    A few weeks ago, I was quoted in a CACM news update related to Google's RL based macro placement work. https://cacm.

    5 Comments

Others also viewed

Explore content categories