Hacker News new | ask | show | jobs
Lessons Learnt from Solving AoC in One Second (blog.sulami.xyz)
17 points by sulami 1271 days ago
2 comments

Sorry - if this is your website, could you please not hide the scrollbar?

The CSS file has a comment This below keeps the regular scrollbar for scrolling the page, if present, because that one makes sense to be there. but it doesn't seem to be taking effect for me.

Regarding the AoC i'm very impressed with adding the extra time constraint on yourself.

Sure thing, I'll have a look at it tomorrow. Would you be so kind and share your browser/OS so I can try to reproduce?
Thank you and sorry for detracting from the point of your very interesting article. I'm using Chromium 108 on Debian - i can see the scrollbar appear fine in Firefox 102.
`nom` is incredible. I used to iterate input by line, make up regex with capture groups, and do something ad hoc if the input isn't line by line. It gets quite ugly, if the input has multiple parts, or multiple lines as one part.

Now I just take the whole stdin and pass it into a parser written in `nom`. If it's line-by-line, it's a trivial: `separated_list1(tag("\n"), parse_line)`, not more difficult than iterating through lines, parsing each, and combining them. If the input isn't line-by-line, a proper parser is way more cleaner than anything I've done before.

And there has never been a performance problem for me. (To be fair, AOC doesn't have truly giant input size)