Live data from Hacker News

Advent of Code 2024

adventofcode.com

501–510 of 580 posts

Re: Advent of Code 2024

#501
post #327

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 can really enjoy the winter break from work What line of work are you in that you can take a winter break, and furthermore, that you can actually not work during that break? I'm envious... I've always wanted to do AoC but on top of work it is too much.

Developer here. I'm off from 13 Dec to 6 Jan this year.

PRevious years I've managed basically the entire month of December.

I always have holiday days left over at the end of the year to take.

Re: Advent of Code 2024

#502

This is my fourth year. I'm using Go while being surprised how inadequate it is for this kind of problem. Standard libraries lack basic data structures and often Go is too slow for a compiled language!

What does "Go is too slow" mean in this context? Were you expecting similar performance to Rust or C++?

Re: Advent of Code 2024

#503

Earlier quoted context omitted.

I don't see much to disgree with in what you're saying. Were clearly talking about different things. What happens when you dig in and exhaust all your best efforts and still don't find a solution? Are you a lost cause because you couldn't figure it out for yourself? Or are you allowed to be shown the way it's done so you can learn from that? Many times in my life have I not been able to figure something out for mysel…

Honestly use the gym analogy again: You've spent the last hour trying to curl the 50kg dumbbell and you just can't do it. You walk up to the yolked out guy and ask him to show you how it's done, he picks up the weight and curls it with ease. At this point its not really fair to say you curled those 50kgs, and you didn't get much out of the experience. Maybe you noticed something about his technique that helped, or he…

I think this is where your analogy falls apart.

Sometimes being shown the answer to a problem is just what you need to move forward, especially if you are inexperienced. Shown the answer with an explanation as to how you get to it is better.

Re: Advent of Code 2024

#504

Earlier quoted context omitted.

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…

I do AoC first time and use it to try a functional LISP like language (Clojure).

Though it is just a beginning and maybe it is a matter of habit,but I should say, that reading LISP family language is so difficult for my brain.

Re: Advent of Code 2024

#505

Earlier quoted context omitted.

Agree to disagree. Don't see any difference with finding the answers on SO, or in textbooks, and having an AI provide the same. And at the start, novice body builders will of course watch other body builders to learn how it's done. Unless you're exceptional you're not teaching yourself anything unless it's by learning from others. Few are the pioneers in any field.

I think the difference between the textbooks and AI is that the AI can answer exactly your question without providing the necessary context/reasoning behind how it arrived there. When you are drawing connections between SO posts, textbooks, whatever you do a fair amount of reasoning yourself. Now that I think about it it isn't AI specific (more knowledge specific) - I'd say the same if you wait a few hours and then l…

Say I have no idea how to complete day 12 of AoC. Racked my brains, done some searching, researched as best I can, can't find anything that makes sense. I'm stuck.

By your logic I would gain absolutely nothing, learn nothing, but either looking up the answer or getting AI to give me the answer. I don't accept that.

Reason being? I've been in the exact same situation. Guess what, I learned different approaches to the problem I could not solve. I improved and can now solve similar problems as a result. Is it cheating? Maybe. Do I care? No. Why? Because I'm not doing AoC for the struggle, I'm doing it for fun, and I know my limits too.

Re: Advent of Code 2024

#506

Earlier quoted context omitted.

There's a Rust solution posted in the Reddit Day 1 answers mega thread which claims 22 microseconds part 1 and 10 microseconds part 2. (I haven't tried to verify): https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...

Can't edit my comment, here's another claiming 12.7 μs and 7 μs: https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_... Another claiming 30μs and 32μs: https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...

For an interesting comparison, here's BQN, an array language, at 25.5μs (on an i3-4160) for both parts, including input parsing:

https://github.com/dzaima/aoc/blob/master/2024/BQN/1_fast.bq...

Re: Advent of Code 2024

#507
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.

Consider looking at the solutions threads on Reddit instead - that way, the code you're looking at isn't broken in ways you don't know enough to spot.

Re: Advent of Code 2024

#508

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.

Maybe this will help you ;) https://news.ycombinator.com/item?id=42243500

Re: Advent of Code 2024

#509

Ah here it is again, 25 days of writing increasingly complex input parsers.

the input parsers don't get increasingly complex over the days. The problems themselves do. Even on the most difficult days around 22 or 23, the inputs are all just lines of space separate ints or some grid of points or something, just like the trivial problems on days 1-3

From last year: hot springs, the pipes problem, gears, pulses, range math.. half the problem is turning the text input into the correct data structures to solve it.

Re: Advent of Code 2024

#510

Earlier quoted context omitted.

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…

I do AoC first time and use it to try a functional LISP like language (Clojure). Though it is just a beginning and maybe it is a matter of habit,but I should say, that reading LISP family language is so difficult for my brain.

It takes a while. But if you continue to practice, it will eventually click.
Post reply on HN