I didn't realize who this was by the title, but this is betaveros, the guy who won 1st place in Advent of Code every single year since 2019:
<a href="https://clist.by/account/32289/resource/adventofcode.com/" rel="nofollow noreferrer">https://clist.by/account/32289/resource/adventofcode.com/</a>
I think it’s interesting how similar a lot of this stuff is to what I do, except I’m not very good at Advent of Code and also I decided to hack Python to do this instead of writing my own language. For example:<p>* I couldn’t really make operators first class functions, but I just autoimported operator which has this but in words<p>* I wanted partial application and hated lambda syntax, so I hacked it together with some magic. “_0 + 1” is basically equivalent to lambda x: x + 1<p>* Python really likes to make everything a free function, which messes with the whole left-to-right thing. So I monkey-patched functional methods onto all the collections<p>Together this means that if I have like a comma separated list of numbers in str and I want to, idk, count how many are above five I’d do something like<p><pre><code> str.split(",").map(int).filter(_0 > 5).len
</code></pre>
which matches how my brain things about it far better than how Python would like me to write it. It uses some tricks but it’s not actually that bad of a hack IMO: <a href="https://github.com/saagarjha/advent-of-code/blob/main/aoc.py">https://github.com/saagarjha/advent-of-code/blob/main/aoc.py</a>
> The title is clickbait. I did not design and implement a programming language for the sole or even primary purpose of leaderboarding on Advent of Code.<p>I did: <a href="https://github.com/lukechampine/slouch">https://github.com/lukechampine/slouch</a><p>"Find all ten-letter words that contain each of the letters A, B, and C exactly once and that have the ninth letter K"<p><pre><code> :load wordlist wordlist.txt
words wordlist | filter -:(len == 10 and .8 == "k")
</code></pre>
A more interesting example: <a href="https://www.youtube.com/watch?v=i_zDbInYOpQ">https://www.youtube.com/watch?v=i_zDbInYOpQ</a><p>AoC solutions here: <a href="https://github.com/lukechampine/advent/tree/master/2022">https://github.com/lukechampine/advent/tree/master/2022</a><p>(The language has builtin commands for fetching inputs and submitting solutions)
> Before we move on, I want to point out that “being able to write code from left to right without backtracking” is a completely bonkers thing to optimize a programming language for. This should not be anywhere in the top hundred priorities for any “serious programming language”!<p>There are plenty of serious languages that are written this way. Most noticeably are shell scripting languages but I’ve seen stack based and functional languages that are written like this too.
One key point I overlooked on first reading:<p>> <i>[--] I wanted access to Haskell’s list monad in a sloppier language.</i><p>> <i>I like static types, but only if they’re sufficiently expressive and supported by good inference, and I like not having to implement any of that stuff even more, so I settled for dynamic typing.</i><p>Then it's some of the power of Haskell without any of the safeguards. Plus being able to write "x f y" to mean a function call to f with arguments x and y (whereas in Haskell you'd write "x `f` y").
> I solve and write a lot of puzzlehunts, and I wanted a better programming language to use to search word lists for words satisfying unusual constraints, such as, “Find all ten-letter words that contain each of the letters A, B, and C exactly once and that have the ninth letter K.”<p>So... Perl?
I'm not a competitive Advent of Coder, but as a corporate trainer, I appreciate it for giving me insights into my coding style. Hopefully, I can use those insights for my students.<p>The last time I did AOC, I tracked every error I made to reflect on my mistakes when coding.<p>I think this year I will do "Advent of AI" and see how far AI tooling can get me.
Why are people so insistent on having unary minus? In my experience, "0-whatever" is just as good as "-whatever" <i>except</i> in a single case where you're trying to write an INT_MIN but then again, unary minus doesn't help you in this case either — unless you, as e.g. SML does, make the unary minus the <i>lexical</i> part of the number itself. However, SML has to actually use the tilde "~" instead of the minus for the negation because otherwise "1 -2" would be ambiguous.<p>IIRC Elm didn't have unary minus for quite some time just fine unless its author decided he <i>really</i> would like to have specifically unary minues but, weirdly, not any other unary operator. So, what's the deal with unary minus, why do people want it so much?
In terms of speedrunning, couple of friends and I are trying to speedrun AoC using LLMs (sacrilegious i know).<p>It’s been growing a bit; if interested, feel free to shoot me an email to joshcho@stanford.edu<p>Or @eating_entropy on X