News for hackers. Stuff that matters.
Re:Advent of Code 2021 by heelix on Saturday November 20, 2021 @09:02PM (#29293531)
Yup. Very much a chance to learn a new (for me) language. Looking to do Golang this year - brushing up on the basics of the language as we roll into a long turkey weekend.
Re:Advent of Code 2021 by BeFlatXIII on Saturday November 20, 2021 @09:04PM (#29293544)
I'm torn between Clojure (totally n00b) or Elixir (mostly to force myself to use it rather than defaulting to Python)
Re:Advent of Code 2021 by ravi-delia on Saturday November 20, 2021 @09:33PM (#29293679)
I'm something of an elixir zealot, but I have to say that Clojure has the most pleasurable syntax for this kind of thing out of any programming language.
Re:Advent of Code 2021 by b5n on Saturday November 20, 2021 @11:36PM (#29294210)
Being an elixir zealot have you ever considered lisp flavored erlang? If so, what are your thoughts in comparing it to clojure?

https://lfe.io/

Re:Advent of Code 2021 by ravi-delia on Sunday November 21, 2021 @11:08PM (#29302602)
I actually have played around with it! I think Clojure feels a lot more polished, but it's also a lot more rigid, which I could definitely see someone disliking. LFE almost feels a little more like Common Lisp, although that's more to do with Erlang and the BEAM than any specific syntax choice. Plus, of course, you get to work with all that OTP goodness. If had to choose between LFE and Clojure as the only language I ever programmed in again, it would be a really hard tossup. Clojure might have a relatively larger community, but I don't want to give up the BEAM!

The reason LFE didn't do it for me was that Elixir is relatively painless syntax-wise, and has really nice high-level libraries like Phoenix and Ecto that simplify a lot of work. If I don't need the BEAM, than I'd rather have a more strictly functional language like Clojure, or something more low-level like Common Lisp. LFE doesn't occupy a niche in my personal ecosystem. That being said, I'd definitely give it another try sometime, and I'd recommend it to anyone else who wants to feel the power of the BEAM.

Re:Advent of Code 2021 by BeFlatXIII on Sunday November 21, 2021 @05:36PM (#29300469)
That's good to know. What is it about the AoC that makes it play into Clojure syntax so well?
Re:Advent of Code 2021 by ravi-delia on Sunday November 21, 2021 @10:46PM (#29302498)
Clojure is the most practically expressive language I've ever had the pleasure of working with. For some reason the example that immediately comes to mind is how you can use a collection as an accesser for itself, so ({:a 2 :b 3} :a) returns 2. Just a neat bit of syntactic sugar, but now if 'blacklist' is a set, you can just do (remove blacklist guests) to remove everything in blacklist from guests. There's a hundred little things like that which combine to make it a really fun and concise language to work with.
Re:Advent of Code 2021 by nanomonkey on Saturday November 20, 2021 @10:19PM (#29293908)
This year I'm going to try it with Babashka, the native Clojure scripting runtime. See how far it can take me.
Re:Advent of Code 2021 by Borkdude on Monday November 29, 2021 @09:41AM (#29380367)
Babashka is fast-starting but slow-running (compared to JVM Clojure). AOC puzzles typically contain a lot of loops so you will likely run into the slow-running-ness. But it shouldn't be much trouble to move to Clojure when you hit this.
Re:Advent of Code 2021 by hiepph on Sunday November 21, 2021 @02:22PM (#29298911)
Clojure is fun to try out. I tried it last year and had a lot of fun combining and finding the right function from its huge expressive vocabulary. It inspires you to treat code as data.
Re:Advent of Code 2021 by BeFlatXIII on Sunday November 21, 2021 @05:40PM (#29300491)
I've had a couple of Clojure books I've meant to work through over the past year. Where I'd get stuck is in the development workflow more so than in the language features or syntax. Clojure (and lisp-like languages in general) seem like my usual edit, save, run loop isn't the most effective way (especially if it's Clojure and the JVM needs to start each time if you run cold).
Re:Advent of Code 2021 by ravi-delia on Sunday November 21, 2021 @11:47PM (#29302860)
I can't possibly sing the praises of Cider loudly enough. Emacs is a hard sell, I get that, but Cider is such a nice way of working with Clojure.
Re:Advent of Code 2021 by BeFlatXIII on Monday November 22, 2021 @12:52PM (#29309414)
I suppose Cider in Doom Emacs means I can keep using the vim keys I already know.