Lucas Vieira

Learning Rust With Advent of Code

Last year, I fell in love with Go. Before that, Python had always been my go-to language – Easy to use and the one all my engineer friends knew how to code in. However, I was aching to dive deeper into computer science, and I wanted to do so by learning a new language.

Perhaps I loved Go because it is a “boring” language1. It lacks exciting features. But because it is simple, you can focus on writing good code. Go forced me to be intentional and handle my errors. This paid off by allowing me to find problems earlier rather than lots of debugging later.

While I was learning, I read “Learning Go”2 and built two CLIs: one for reading HackerNews’ front page and another for templating git commit messages. Creating CLIs is one of my favourite projects. A CLI is a canvas for learning new concepts and a way to build a product that I will actually use. For example, I now use the commit template CLI in all my git repositories.

When December arrived, I was excited about the best yearly event in the programming community: Advent of Code (AOC). One challenge for each of the first 25 days of December. For 2023, I decided to solve it with Go. An excellent opportunity to learn more about the language, build data structures from scratch and implement different algorithms.

This year, I want to learn Rust, which feels like a natural step after Go. Because Rust is lower-level, I’ll get to learn about memory management, safety, and performance in practice.

As a tradition for learning a new language, I’ll solve AOC, but this time in Rust. It’s still January and I can’t wait until December, so I’ll solve 2022’s AOC instead. I’ve already solved the first six exercises in Go, which means I can compare my solutions across the two languages.

My objective is not to solve all the 25 challenges. The final exercises are very demanding, and I prefer to spend this time building something. After solving the first days, I will probably create a CLI in Rust. I will share my Rust solutions here and am excited to see them compared to Go.


  1. “Go is Boring…And That’s Fantastic!” by Jon Bodner↩︎

  2. Bodner, J. (2021). Learning Go: An idiomatic approach to real-world Go programming (First edition). O’Reily. ↩︎

#rust