Hacker News new | ask | show | jobs
by emoII 244 days ago
Interesting that this article makes no mention of eager vs lazy evaluation - isn’t a big reason that if, for etc has to be special forms in an eagerly evaluated language that their arguments need to be lazily evaluated, which of course, deviates from the rule? Also, lazy evaluation is achieved in an eagerly evaluated language as simply wrapping a block of code in a function, which makes lazy evaluation isomorphic with the contents of the article
1 comments

> You might wonder: “Won’t the block execute immediately when passed as an argument?” Here’s the key insight: in Rye, code blocks { ... } are values. They don’t evaluate until you explicitly tell them to.
You're correct, that is lazy evaluation. The entire article talks about lazy evaluation without mentioning it, which was my point
I've been programming in REBOL for decade(s) so this is just how it worked and made sense and we never used term "lazy evaluation", so it not part of my vocabulary when explaining this.

Blocks are not evaluated by default, but they are eagerly evaluated if the function that accepts it decides to do so (if, do, loop) ... I understand lazy evaluation more like something that is meant to be evaluated, but physically only gets evaluated when or if you do need the result, which I'm not sure is entirely the same.

Lazy evaluation typically is a language-wide calling convention choice right? With that in mind I'm guessing the first-class block aspect of Rye might make it feel too loaded of a term to use to the author, because Rye's blocks-as-values are more flexible than just that. But maybe one mention of "this is kind of like lazy evaluation" would help.