Rust #

Rust is a programming language, specifically designed for speed and safety. It’s become very popular in the last few years. I’ve written a little bit of it for some toy projects and am keen to learn more.

Nice things about Rust #

As someone who has written primarily Python for a very long time (over 20 years at this point), Rust has a lot of things that feel very fresh and “long-overdue”.

  • You are forced by the compiler to handle all possible errors your code might throw.
  • You can’t make stupid type mistakes.

Things I learnt doing Advent of Code 2024 in Rust #

Advent of Code is a great programming puzzle competition that’s been running for about ten years now. It’s a very useful way to learn a new programming language. It’s very hard at the start because things are so unfamiliar: the simple problems have you wishing you could just reach for a familiar language to solve them in a couple of minutes, but it really is great practise. If you’re doing it not in real time (in 2024 I am trying to solve the problems one a day), you can always use Reddit as a resource for other peoples’ solutions in all sorts of crazy languages.

  • Scan. Scan is “an iterator to maintain state while iterating another iterator”. It’s something you don’t know to reach for when you’re first learning Rust, but it’s extremely useful in solving all sorts of problems where you need to remember some state while iterating over something else.
  • A very quick (half-hour) introduction to Rust.
  • A really nice tutorial on writing a bare-bones operating system in Rust.
  • A fantastic guide on writing a roguelike in Rust using rltk.
  • A nice post on setting up emacs for Rust development.
  • 100 exercises to help to learn Rust.