Posts by chayleaf
something like
let x = if cond() then { x = 5; y = 6; } else { x = 10; };
let y = x.x;
could very plausibly work without boxing
most system languages are sadly still too "C-brained", but theres so much room for both automatic optimization and non-C-like manual low-level layout control
not in rust, but you could do probably do something like this with dataflow analysis and subtyping
i think "dataflow for automatic memory layout optimization" is an exciting concept in general
def f(x): s=len(str(x)) r=0 for c,q in zip(range(2,1+s),b'ddcdbdccb'): n=s//c p=10**n d=(p**c-1)//(p-1) m=1+(x-1)//d r+=(q-99)*(1-p-d*(s%c<1)*(p*p-m*m+m-p)+sum(10**i*(p**i-1)*b'\tc'[i>c]//(100*10**i-100)for i in range(2,c+2))) return r//2 t=0 for x in open('02.txt').read().strip().split(','):a,b=map(int,x.split('-'));t+=f(b+1)-f(a) print(t)
day 2 part 2 this is so stupid
funnily enough, this is almost shorter than my (ungolfed) apl solution:
+/a[;2]-(a←{n←⌊(l←1+⌊10⍟⍵)÷2◊⌊((((((m-1)×m←m+((10*n)|⍵)>m←⌊⍵÷10*n)×1+10*n)-⌊(110+10*3×n)÷111) (((¯1+10*3×n)×110÷111)-10*n))[1+2|l]+1+⌊(¯1+10*2×n)÷11)÷2}¨⊃{(0 1)+⍎¨(⍵≠"-")⊂⍵}¨((x≠",")⊂x←(x≠"\n")/x←⎕FIO[26]"02.txt"))[;1]
for aoc2025 day 2, i went with python over apl
def f(x):
s=len(str(x))
n=s//2
p=10**n
m=x//p
m+=m<x%p
if s%2:m=p
return((m-1)*m*(p+1)-(110+10**(3*n))//111+1+(10**(2*n)-1)//11)//2
print(sum(f(b+1)-f(a)for a,b in (map(int,x.split('-'))for x in open('02.txt').read().strip().split(','))))
got a highscore of a 26 move 15 puzzle solve on flipper zero which is only possible in one of 72.5k games. safe to say i'm not beating that one...
youtube video called [World Record] Super Mario Bros. Any% in 4:54.415 by averge11
not niftski???
there's a surprisingly high chance your car runs kubernetes btw. like inside the car.
cursed idea: semantic whitespace for function application
f g(h) -> apply f to g(h)
f g (h) -> apply f g to h
or even
f g h -> apply f to g h
regex polyfill
oh, that character there is genocide guy, he's kind of a fan favorite. the one next to him, though, that's the one everyone hates, she was rude once.
osu! world cup finals, poland vs usa (two top seeded teams) 6-6, leading to a tiebreaker
peeeeeak
it's okay i'm not completely gone yet only the first 28 moves are valid and then i misremember the board state, and also third move should be 6 instead of 9 in order to get an optimal solution
a screenshot of the wikipedia page on the 15 puzzle, showing a random position that i'm describing a (fairly optimal but probably not 100% perfect) solution to
i hate that i see this and immediately go “oh yeah 13, 10, 9, 5, 8, 4, 3, 14, 10, 9, 5, 9, 4, 3, 8, 5, 6, 11, 12, 1, 2, 4, 3, 15, 4, 3, 15, 8, 15, 11, 12, 7, 6, 5, 11, 12, 7, 6, 5, 9, uuh i forgot”
eva piloting for dummies
soundcloud displaying a track's "top fans", with me with 599 plays followed by people with resp. 25, 11, 7, 7 plays
minor gap
the more I learn about cryptography the more I think Alice and Bob should probably just talk in person
how did they manage to make nulls even more broken
omg i just somehow ran into a situation where NullReferenceException was being thrown even after a null check??? sure c# whatever you say i'll just use a try catch...
currying may feel like a gimmick but when the argument you're passing is non-trivial (like the result of calling a function) they can actually give you performance savings for free (can be emulated by storing that result into a captured variable but that's much more boilerplate)
This Pluribus ad on a fridge caused a schizophrenic woman named Carol to be hospitalized.
shortened to just z←0◊z+50=100|{z←z+50=100|⍵◊⍺+⍵}/⌽{(⍎1↓⍵)×1-2×⍵[1]="L"}¨(x≠"\n")⊂x←⎕FIO[26]"01.txt"
aoc day 1
a←⌽,⍉⊃{(⍎1↓⍵)×(1-2×⍵[1]="L")}¨((x≠"\n")⊂x←⎕FIO[26]"01.txt")◊z←0◊z←z+50=100|{z←z+50=100|⍵◊⍺+⍵}/a◊z
can i go home please 🥺
dsls should be graphical not just textual programmers are so boring
oh wow i got yuri'd
maybe i should do advent of code in apl... time though...
New AI slop signal: code blocks with weird indentation
https://xeiaso.net/notes/2025/slop-signal-indentation/
god only knows (a great opening from a bad anime) has a line "anyone could be a hero and heroine", it always felt very trans coded to me (probably unintentional but i couldn't care less)
youtu.be/iYP5EzO9lJE at 3:44