7 ms·
I think I’d like to try this year’s in a language I haven’t touched before. What languages should I consider if I want something paradigmatically different from
by bryancoxwell 3y ago
I think I’d like to try this year’s in a language I haven’t touched before. What languages should I consider if I want something paradigmatically different from Go, Python, etc?
- NateEag 3y agoScheme and Haskell could both be interesting.
- criddell 3y agoProlog or Forth or one of the ML's (SML, OCaml, etc...) come to mind.
- mongol 3y agoI would go for something functional. Haskell? Or possibly Scala
- bnpxft 3y agoScheme https://spritely.institute/static/papers/scheme-primer.html https://spritely.institute/static/papers/scheme-primer.html
- sixstring982 3y agoI built an OCaml starter project for Advent of Code that I've been using. Take a look if you'd like to give OCaml a spin! https://github.com/Sixstring982/tanenbaum https://github.com/Sixstring982/tanenbaum
- icen 3y agoAPL!
- sokoloff 3y agoI used it last year to exercise my utterly novice clojure skills and found that very enjoyable and educational.
- wry_discontent 3y agoI especially enjoy using Clojure for these puzzles since the REPL makes interactively checking your ideas fast.
- epiccoleman 3y agoAbsolutely - this is one of the things I like so much about doing them with Elixir. Between the built in testing framework and the REPL it's so easy to work through the problems iteratively. I wish Elixir's REPL / editor integration was half as awesome as SLIME / Emacs, but it's still leaps and bounds beyond what you get in most non-functional langs.
- williamcotton 3y agoF#'s REPL is pretty great as well for these kinds of puzzles. Send Selection lets you highlight up to a certain part midway through a pipeline. This makes debugging without breakpoints very easy, on top of everything else offered by an interactive REPL session!
- FreeFull 3y agoIf you want a challenge, learn Prolog using https://www.metalevel.at/prolog https://www.metalevel.at/prolog , with https://github.com/mthom/scryer-prolog https://github.com/mthom/scryer-prolog as the Prolog implementation.
- JaumeGreen 3y agoLast year I did my run in J (Jsoftware.com) and it was very interesting. This year my initial desire is to do it in raku, which seems suited to the first task at least (although I haven't managed to get to it). I did another year in common lisp. All in all I really can recommend doing them in non-typical languages, it expands your mind.
- donaldihunter 3y agoI can recommend raku. Always fun.
- JaumeGreen 3y agoThe only problem with these kinds of languages is finding the place where the experts publish their solutions, if they do. I'd love to see what an expert can do and what I can learn from them.
- masklinn 3y ago/r/adventofcode has an impressive collection of weirdoes solving in all sorts of random nonsense every year.
- gfldex 3y agoScroll down in the weekly until you hit the Mastatdon links at: https://rakudoweekly.blog/2023/12/04/2023-49-venting-this-ad/ https://rakudoweekly.blog/2023/12/04/2023-49-venting-this-ad...
- bcrosby95 3y agoYou could do it in elixir using livebook.
- epiccoleman 3y agoI do them in Elixir and I find it to be a great language for this kind of thing. I'm not a very sophisticated Elixir programmer, but I think my solutions are decent enough (and readable, for the most part!). I have a repo which has solutions for quite a few of the puzzles, along with some nifty little mix tasks to help set up a skeleton for each day's puzzle and automatically fetch the input file. If you're interested: https://github.com/epiccoleman/advent_of_code_ex https://github.com/epiccoleman/advent_of_code_ex
- bo0tzz 3y agoElixir is great for this, especially with Livebook (https://livebook.dev/ https://livebook.dev/) and kino_aoc (https://github.com/ljgago/kino_aoc https://github.com/ljgago/kino_aoc).
- epiccoleman 3y agoAh, Kino looks awesome, that's exactly the kind of automation I set up in my own repo. I slightly prefer my own way because it lets me do the dev locally, but that is still a totally sweet setup!
- bramerto 3y agoTrying Elm this year
- hugginn 3y agoAPL, BQN, and Uiua all make me feel dumb, until you get something working. Suddenly I expect to find my phd in the mail. Prolog is pretty different from the mainstream. I would also like to try to be way too fancy about parsing aoc data at some point. That example of a CSV parser in four lines blows my mind. Not really because of the number of lines, but just the whole type system. I'm doing it in uiua, and I don't expect to last long to be honest.
- youerbt 3y agoWhile not many didn't touch it, many for sure didn't consider it for AoC: SQL. You can go for one query solution or use views/tables for multiple steps. It's an acquired taste for sure, but I kinda like it!
- RodgerTheGreat 3y agoYou could try Lil: https://beyondloom.com/tools/trylil.html https://beyondloom.com/tools/trylil.html Lil is a synthesis between ideas from functional languages, array-oriented languages like APL, and relational languages like SQL. For example, it has a first-class database-style "table" type, a query syntax that generalizes across lists, dictionaries, and tables, and arithmetic operators automatically "spread" between scalar and listy values. Lil is available as a standalone CLI or browser-based interpreter, but it is also distributed as part of Decker, a graphical rapid prototyping environment: https://beyondloom.com/decker/index.html https://beyondloom.com/decker/index.html
- mlsu 3y agoIf you haven't tried Rust: Someone put together a very nice template in Rust that automatically downloads tests, solutions, creates a scaffold for the binaries, etc and submits solutions through CLI. I used this template last year to learn Rust and it got me "up and running" quickly and easily. https://github.com/fspoettel/advent-of-code-rust https://github.com/fspoettel/advent-of-code-rust
- masklinn 3y agoCreating your own can be fun tho. My version uses a procedural macro (was a good excuse to finally implement one) to automatically fetch the data set and cache it, and provide a few common helpers.
- codr7 3y agoCommon Lisp, it's definitely my favorite language for this kind of exploratory problem solving.
- matsemann 3y agoPeople have mentioned different languages, but I'd say I'd rather try to solve them in a different paradigm. So choose a language that works well for that. For me, it's functional coding. I find it fun to write as much as possible as filter/map/reduce operations with no mutations. I end up solving problems in a different way than I would in a non-functional language, which I think is good learning. For me the language of choice is Kotlin, which strictly isn't functional. But it has a good stdlib and syntax for functional coding, so I just restrain myself and use escape hatches when needed. But any functional language would be nice, like Haskell or Clojure etc.