1. 94

The 2018 Advent of Code competition is starting soon. Advent of Code is a code advent calendar. Each day unlocks a new programming challenge. You score points by completing the challenges quickly.

I’ve created a lobsters leaderboard for this year that you can join with code 224033-122b1da6. To see it you need to create an account, login, then go to the leaderboard page and enter the code for the private leaderboard.

Advent of code is a great way to learn a new programming language. It’s also a nice way to get a daily warmup programming exercise through the month of December. If you’d like to chat about the code challenges we’ve created the #lobsters-advent IRC channel on freenode to chat about it with other lobsters users. You can also chat about it in the main #lobsters channel on freenode (see chat for more).

    1. 18

      I feel like a hipster saying it but I’m gonna do it in rust.

      1. 10

        I think the hipster choice would be rifle through your dad’s 486 and do it in Pascal.

      2. 5

        Rust was all the rage last year… and the year before that people seemed to love Elixir. To be a true hipster you need something so cool it hasn’t sold out yet.

        1. 5

          I’ll be using a new language that you probably haven’t even heard of yet.

          /s

      3. 1
      4. 1

        Hey same here! Figure it’s a good way to learn a new language

        1. 3

          I solved all of last years problems in rust and you could say it wasn’t really that fun - rust (just like c++ in previous years) was generating fast enough code so that I never really had to optimize anything ;)

    2. 16

      This year I’m going to use AoC as an excuse to start writing Common Lisp.

      1. 6

        I will use picolisp

      2. 5

        I mostly work through them in Common Lisp0. In my experience I tend to use use only two utility libraries: split-sequence and alexandria. Other than that the base language is all that one needs. Sometimes I reach for the queue in sb-concurrency to avoid loading an extra library but most of the times a cons cell is good enough for the job.

        One thing to keep an eye on is every now and then you can (ab)use a language feature to make your solution cooler. Like solving it with a reader macro or using EQL specializers and letting the the method resolution take care of walking the graph.

        I’d like to use Prolog to solve most problems but I’m not familiar enough with how to read files in Prolog Y_Y

    3. 8

      So hyped! This year I’m gonna attack each problem in three languages: Haskell (as always), Rust (new last year) and Racket (can’t go a year without Lisp!).

    4. 6

      I am so looking forward to this… in fact, I am planning to set my alarm at 06:00 on Saturday (local time when the challenge drops) to get to work ASAP.

      1. 10

        I woke up 06:00 everyday Dec1-Dec25 last year to solve the problems and stream myself doing it. Expect yourself to stumble for minutes on stuff that your fully-awake-you would do in seconds :)

        Also, if you can automate copy-pasting the input from the website, do it. Nothing worse than accidentally deleting a line-break or a character during manual copy-pasting and then spending an hour figuring out what the hell’s wrong.

        Here’s my automation with curl, sed and tmux: https://github.com/Janiczek/advent-of-code/blob/master/start.sh

        1. 3

          Thanks a lot!

          I’m purposefully not going to stress trying to get on the leaderboard this year (because it was much harder last year than 2016!), I’m just really hyped to get some brain candy!

    5. 6

      I think this is a good opportunity for me to learn Go!

      However, I don’t have any sort of formal CS-like training, and some of the problems the last couple of years have been rather hard because I’ve lacked the theoretical foundation to sort of figure out what kind of problem I’m looking at. Often it’s more math than CS, but there’s an overlap there.

      1. 2

        If you want to participate but struggle with some of the later stages, there is a fantastic community on Reddit that can help.

        https://www.reddit.com/r/adventofcode/

    6. 5

      People who’re participating, what languages are you using? I’m starting to learn Typescript, so I’m thinking of using that for practical reasons, though I’d probably rather do OCaml or something a bit more esoteric.

      1. 9

        Last year I used 6 languages, and this year my goal is to use 12! Carp, Fennel, and Reason are some new-to-me languages I hope to touch on. I will likely do most of the problems in clojure because I enjoy manipulating data-structures in it so much, but rarely feel like it’s the practical choice for my projects.

        1. 3

          So, the 12 languages of Christmas?

      2. 6

        If it is fine with you to not be able to complete a task in 24h than AoC is a great way to learn new language.

      3. 6

        I’m learning Clojure and liking it so far, so my AoC has a perfect timing this year to be full of parenthesis

        1. 3

          Let’s compare solutions!

      4. 4

        I did 2015 and 2017 in Racket, and had a pretty good time. I tried 2016 in Erlang, and really struggled.

        This year, I’m going to try it with Pony.

      5. 3

        Planning on giving ReasonML and Elm a shot.

      6. 3

        I use Perl 5. Life + day job doesn’t give much time for actual programming so I’m really happy to just try to solve problems in a language I know well.

        Plus Perl makes parsing the problem input a breeze.

      7. 2

        As much as I am tempted to try ReasonML, I wrote a modest amount of Elixir back in 1.2 (three years ago, and stable is now 1.7), and have an upcoming need for it again. Will probably do that to brush up on any changes.

        In an attempt to make it challenging is I am going to try and pick up Emacs while doing so. I have heard that the lineage inherited from Erlang provides a decent ecosystem in Emacs for other BEAM languages. Does anyone know if that perception is correct?

        1. 1

          Cannot edit my post anymore, but it looks like not only is that the case, there are multiple Elixir-specific packages as well (elixir-mode and alchemist).

      8. 2

        I’ll probably take a shot with Haskell again, or possibly F#.

      9. 2

        I think this year I’ll forego going for leaderboard, and use the opportunity to brush up on my Elixir skills. I haven’t had a good chance to touch it for quite a while, so it should be a good refresher. I really enjoy thinking in and solving problems with the toolset available in Elixir.

        1. 2

          Jose Valim is going to stream his own solutions to each challenge one day afterward (in Elixir of course):

          http://blog.plataformatec.com.br/2018/11/lets-learn-elixir-together-with-advent-of-code/

          1. 1

            Fantastic! Thanks for the heads up!

      10. 2

        Crystal. Figured I should brush up on making actual programs instead of one-off scripts and thus style and “architecture” will be my focus.

        1. 2

          Pretty ballsy that a project will try to reclaim that name from the horror that is Crystal Reports. Kudos!

      11. 1

        I’ve been looking into D a bit recently so going to give that a try.

    7. 4

      I used APL to write my solvers last year, but I didn’t complete the whole set. I’ve already gotten more than 25 coworkers to join my private leaderboard this year. We all use Clojure so that’s what I’ll be writing my solvers in this year (but I might solve them twice so I get a chance to code in APL again! 🤓)

    8. 4

      Just for folks who may not realize, the older ones are still available at their respective year:

      https://adventofcode.com/2015

      https://adventofcode.com/2016

      https://adventofcode.com/2017

    9. 4

      I have to decide between Haskell, Lisp, Fortran or Rust. That is if I even have the time for that – I haven’t done these before.

      Is there maybe a way to get updated via RSS?

    10. 3

      Ok, that’s it, I’m going to try picking up Rust for AoC2018! :D

    11. 3

      I’m super excited for AoC this year. I solved all of last year’s problems with Elixir. This year I’m thinking of attempting J.

    12. 3

      This can be interesting as I’m learning I started to use Clojure not so long ago. But the beginning of December can be hard as I’m moving from Canada to Brazil :(

      1. 9

        what’s the rush, took me 6 months to do 2017’s aoc! i really enjoyed doing it mostly in clojure

        1. 3

          Interesting, I’ll try them. But I imagine that after some time the chat around it start to cool down.

          1. 3

            Sometimes that’s better; you don’t want to be spoiled! I did it last year as a way to learn Ruby.

            1. 2

              Plus the subreddit is always there if you get stuck

      2. 7

        If you don’t get caught up in the “must be done before the next one drops”, it’s perfectly fine to do them at ones own pace!

    13. 2

      I used Clojure last year but didn’t complete. I’ll try again this year!

    14. 2

      I’ve never done AoC before but I think I’m going to give it a stab this year! Any tips for a complete noob?

      1. 3

        Know the string processing features of your language, it helps a lot. Have a Set implementation. Find a consistent way to handle input. Know how to get from strings to integers. And feel free to take thirty seconds to understand the facets of a problem before writing code

      2. [Comment removed by author]

    15. 2

      Thanks for posting. This year I’m implementing solutions in Common Lisp.

    16. 1

      Reminding people this group exists! https://github.com/a-red-christmas

    17. 1

      I’m going to do it in swift.

    18. [Comment removed by author]

    19. 1

      Is the leaderboard code not working for anyone else?

      Trying to consider what language to do it in…

      I mostly use Python at work, so it might be good to do it in that to continue to improve in it. I also really enjoy JavaScript, and I used to use Ruby a lot and kind of miss it.

      Or could use this as a way to try to learn something totally new. I’ve been hearing a lot about APL recently, and it’s pretty fascinating.

      Trying to do it in a language I already know and golfing the solutions as hard as I can would also be very fun though.

      1. 2

        The leaderboard code worked fine for me.

        I believe the number of people in a private leaderboard is capped to 100 or so… but so far only 19 are on it.

        1. 1

          Huh, that’s very strange. I keep getting the error “That join code doesn’t seem to match anyone’s private leaderboard.”

          1. 2

            Check if you’re on 2018 or 2019, there’s an issue with the link @ngoldbaum submitted. For example, you’re commenting on 2018 right now … ;)

            1. 2

              oh jeez hold on what the heck just happened

    20. [Comment removed by author]

    21. 1

      Doing it in Rust this year again: https://github.com/zayenz/advent-of-code-2018

      The project is set up so that each problem is its own small CLI program that reads input on standard in and writes the output to standard out. When I set up the repository, I made a made-up solution as an example to start from, and my choice of problem to solve happened to be the exact first problem today :-)

    22. 1

      Thanks for reminding me! I’ve joined the leaderboard & am working in Clojure

    23. 1

      Do I need to solve all previous challenges to see one that is in the middle of the month?

      1. 3

        No, just wait for it to open