logoalt Hacker News

dejected_frog • today at 9:14 AM • 2 replies • view on HN

If you see the whimsical in a PR changing some column name in a table in a billing system, or you feel the magic and fantasy of a REST API, or yet, God forbid, the emotional undertones of fixing a NPE because the previous change did not consider that a field was optional, then you may have trouble to perceive the difference.

I, at least, never wrote a stock management system to explore the depth of human emotions.


Replies

winwang • today at 9:36 AM

Hmm. I had an issue once with numpy shape mismatch errors appearing after 18+ hours of computation. Frustrating, because it could be caught at compile time.

Later, I learned some typelevel programming (in Scala), and by encoding a digital (binary) adder and multiplier at the type level, I showed -- at least to myself -- it was possible to compute and check linear algebra shapes at compile time (without a compiler plugin). It was rather magical and funny to think that I just embedded basic digital logic in such a higher-abstraction world.

It was slow for the inputs I cared about, so I added some optimizations, like an if-statement at the type level, for example, so that it bit-shift for multiplying powers of 2 (multiplication for tensor products). The compile time difference being palpable was a testament to how "some 'ideas' are surprisingly close to others" (err, 'ideas' ~ 'numbers' in this case). There is a connection to the p-adic numbers here, courtesy of dyadics, and some connection to the more-natural "last-mile" problem.

It's not REST, maybe. But I felt it was magical.

➕ show 1 reply
dofm • today at 4:47 PM

You have missed out on _why, perhaps? I am old enough to remember him, and Camping, and the chaotic, brilliant nature of his work.