Live data from Hacker News

Advent of Code 2024

adventofcode.com

401–410 of 580 posts

Re: Advent of Code 2024

#401

I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way. This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have t…

Sounds like a very interesting Discord to check :)

Re: Advent of Code 2024

#403

I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way. This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have t…

Interested by your rust speed approaches, care to share a link ?

Same. I am doing rust + clojure this year. Very interested in performance hax, esp around SIMD. I know absolutely nothing at all about rust, this is my first time working with it.

My day 1 rust solution:

    cargo solve 1 --
    release
        Finished `release` profile [optimized] target(s) in 0.05s
        Running `target/release/01`
    Part 1: 1189304 (95.8µs)
    Part 2: 24349736 (120.4µs)
Day 1 clojure solution:

      lein run 1
      running all tasks for day 1
      reading input from resources/day01.txt
      running day 1 part 1
         part-fn: #'aoc.day-01/part-1
         took: 5.511375 ms
         result: 1189304
      reading input from resources/day01.txt
      running day 1 part 2
         part-fn: #'aoc.day-01/part-2
         took: 1.822334 ms
         result: 243497365
Code here: https://github.com/whalesalad/aoc

Re: Advent of Code 2024

#404

Last year I got stuck on Day 12 for a full week, and thinking about how to solve it consumed my every waking moment. I think this year, I'm going to be kind to myself and not participate so I can really enjoy the winter break from work.

I got stuck on the graph-cut puzzle for FOUR MONTHS. I had to write a force-directed graphing engine to find the longest three edges to cut. After I solved it I looked at other people's solutions and they used Meta's proposition solver in about 10 lines. Seemed like a massive cheat to me.

Like Minecraft, everybody should play it however they want, it's just a game.

Which one was the "graph-cut puzzle" ? I've had a few where I couldn't do them on the day, either I was busy or I found them harder than usual or sometimes both.

It looks like in 2023 I took until almost New Year's Eve to finish, but until like the 21st of December I was fine, I got thrown off by travel and other commitments in the last few days as they got more difficult.

Re: Advent of Code 2024

#405

I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way. This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have t…

Go (not "Golang") has better compilation times than Rust and does not try to combine incompatible ways of using concurrency.

I have the opposite dilemma to you, I want to learn to like Rust.

Re: Advent of Code 2024

#406

Work on a side project this December instead of doing this. Solving advent of code just keeps you in your comfort zone. Creates a false sense of accomplishment. Redirect all the positive energy to something that will make you proud when you are old or help with an earlier retirement. This won't.

> help with an earlier retirement.

Like car accident?

Re: Advent of Code 2024

#407

Earlier quoted context omitted.

> But I don't play the game correctly any way: instead of trying to solve the problems as fast as I can, ... FYI trying to solve the problems as fast as you can is not considered "the correct way". The author has emphasized multiple times that going for the leaderboard is not for everyone and requires a pretty questionable coding style. The main goal is to have fun and learn something new.

doesn't the existence of the public leaderboard beg to differ? :)

The fact that there are only 100 spots means it's not intended for everyone

Re: Advent of Code 2024

#408

Earlier quoted context omitted.

Last year I tried C on a real Amiga 1200 (using DICE, Matt Dillon’s compiler / runtime). I didn’t get very far, lack of memory protection makes things really hard. This year the Amiga has an 060 upgrade with an MMU, so perhaps I can figure out how to use that and have another go.

Forgive the dumb question... it's been ages since I've done Amiga programming in C. What behaves differently? Is the lower K of memory mapped, such that null pointer deferences cause excitement rather than simply crashing your program? Or is it something else?

I don't get it either, particularly as most advent challenges can be solved using just iso c and its standard library.

Re: Advent of Code 2024

#409

I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way. This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have t…

'd you be interested in sharing the discord? :)

I try every year to optimize for speed in zig: https://github.com/ManDeJan/advent-of-code

Re: Advent of Code 2024

#410
post #378

Earlier quoted context omitted.

What is the point in doing a programming challenge if you aren't learning anything

Depends if you're really stuck on a problem. I'd rather learn by getting a look at how it's done, even if the code is incorrect, than be completely suck with no idea why or what to do.

Being stuck with no idea why or what to do is what gets you exploring and figuring things out. That's the whole point...
Post reply on HN