Thoughts on Rust

#tech#review

I tend to write all my side projects in Deno TypeScript because of its simple syntax, my familiarity and background with JavaScript, and its ability to compile to a single binary. However, in a recent version of Deno, the compiler was split into a separate denort binary, making it extremely aggravating to create a reproducible compiled Deno binary in Nix[1][2]. I gave up trying, perpetually tying all my TS binaries to Deno 1.40.2.

Seeing this as the perfect opportunity to jump ship and try rewriting my programs in a cool new language, I decided on Rust, having never written a real program in Rust before[3]. Rust makes the following claims:

I spent the past week or two learning the basics of Rust using their official handbook, then applied my knowledge to refactor my pformat program from TypeScript to Rust. The refactor went smoothly. Here are some of my thoughts on Rust as a language:

If you have any questions or comments on my Rust code written for pformat (or you'd like to tell me how to write better Rust code in the future!), feel free to email me. I have an overall net positive outlook on Rust. As with any language, it has its own unique pitfalls, but it's unexpectedly cozy. You'll definitely see me writing more Rust code in the future.

  1. Deno downloads denort from an alternate mirror at build time. ↩︎

  2. Deno has yet to support statically-linked binaries. There's not a huge incentive to use Deno compile without this. ↩︎

  3. I've written a program in Rust long before this rewrite but it was a tiny program and I didn't know what I was doing back then. A lot has changed with Rust since 2017. ↩︎