I always say my ideal language is #Haskell with strict, but one nice thing about laziness is that you can use thunk vectors to get constant time memoization without using IO/ST
Republished from: https://twitter.com/hourlyFox/status/1128816092149899264
I was actually able to use this trick to impress one of my favorite professors, an analytic number theorist who usually could care less about PL. I used AD to write numerical solvers for some simple problems in variational mechanics, and showed how the ST trick statically prevented confused differentials.
It's actually insane how cool the ST trick is (forall s. ST s a preventing state threads from escaping.) It's also used in AD to prevent differentials of different variables from interacting. In general, it seems like you can use it any time you want items generated from two different "origins" to not interact and prevent it at *compile time*!