Ask HN: Which language for Advent of Code in 2024?
I’ve considered Mercury and Picat this year but I don’t want to go without regex and/or associative arrays. Also Mercury seems moreso about performance than semantics.
I think it’s Prolog for me again this year but with an effort to complete the problems in a more “Prologesque” way.
35 comments
[ 3.2 ms ] story [ 83.3 ms ] threadI like the puzzle-solving aspect of it - like doing Sudoku, or Alphaguess - but I don't particularly have the time in my life right now to use AoC to learn a new language. (The last time was approximately 6 years ago, when I was learning Elixir - which was also for work. It was also when my child was young enough that I had spare time after her bedtime, but not so young that she didn't sleep through teh night.)
gleam was a lot of fun last year, for those who are gleam curious.
For those who are doing something like protocol hackers, instead of adventure code, ocaml 5+ with effects was super fun
Hopefully that's behind me now so I will use Rust again.
I'm also considering trying to solve everything with Z3.
Designing a programming language to speedrun Advent of Code: https://hw.leftium.com/#/item/38255808
> I did not design and implement a programming language for the sole or even primary purpose of leaderboarding on Advent of Code. It just turned out that the programming language I was working on fit the task remarkably well.
-- "betaveros, the guy who won 1st place in Advent of Code every single year since 2019"
- Given hw.leftium.com URL, it simple to find original Hacker News URL.
- Given a Hacker News URL, very unlikely to discover my app.
(Maybe will cheat with making Nushell plugin in Rust).
I'll probably just use Python this year, so many things are "baked in" to the language that it's the most straightforward. Only downside really is performance, but if you need high performance compiled code for Advent of Code problems you've generally not solved the problem efficiently.
I'd suppose this is because I have a strong bias to mathsy looking aesthetics.
it’s great for building modular workflows, and its type safety might make tackling some Advent of Code problems extra satisfying.
I try to think about what the solution of the problem implies , and then test each such interpretation against a prolog program to express it.
Kotlin/Closure are more attractive because of their multi-platform support, but Ruby has RoR, but the code looks cleaner which is nice.
I've done Rust, Go, Python, and TypeScript, and I've preferred Python and TS because I can just crank out some code and get something going. Rust was actually pretty good too, but Go was a bit more verbose than I wanted for something quick and dirty.
I used C to do some of the old ones. That was painful (I was a complete C beginner).