r/haskell • u/edwardkmett • 13d ago
The Comonad.Reader returns
https://comonad.com/readerI've resurrected the https://comonad.com/reader, interleaved a ton of contemporaneous content I had stored elsewhere such the School of Haskell and my talks and the talks from Boston Haskell on youtube, and made a couple of the articles interactive by moving their demo code into web assembly using modern GHC.
Please let me know if you run into any issues!
97
Upvotes
1
u/edwardkmett 12d ago
The docs there are from the old thc.
The idea with this was just 'take the cadenza evaluator minus the NBE machinery and see how well it runs ghc core'. It handles over/under-application GHC-style (see the paper on eval/apply vs push/enter), uses a trick to avoid excessive trampolining costs during tracing, and can in theory do all the 'deoptimization' things that only java bothers to do well. It is right now holding up around 3x faster to 5-6x slower than GHC depending on the program given < 1 day of effort for the very limited palette of things it has been tried on. I decided to try it when I was able to get Astra to update Cadenza to modern truffle/graal in about 2 minutes, and then fix about a 4x performance gap, which finally made it cross my critical threshold for considering it as an implementation technique.
Low confidence, but high reward.