by rtpg · 11y ago · 0 comments
On the opposite end, there is so much boilerplate optimisation out there to get around the strictness of other programming languages that would be solved with a non-strict mode
thunk () = long_computation
effectively. Is that syntactic noise enough to disable the advantages of laziness? Actually, maybe!And vice versa, although I think embedding strictness in laziness is probably more syntactically heavyweight.
http://h2.jaguarpaw.co.uk/posts/strictness-in-types/
> Is that syntactic noise enough to disable the advantages of laziness? Actually, maybe!
Hmm, if that's the case then it seems that
thunk = return long_computation
is enough to disable the advantages of monads! :)There's an advantage here, of course, in statically ensuring that people do something more explicitly than they would like to. Perhaps the same advantage applies to thunking.
Honestly, I'd rather not comment. I don't know that I or nearly anyone has enough information to make strong, confident opinions about the "right way" to do lazy/strict. I'm hoping that the research into total languages will provide answers!