Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can’t. I think it would have been nice if the article defined the terminology it used to describe its toy languages.

But it really seemed like it was describing a language like C++ or Rust where a “computation” is a value that happens to be a callable function (std::function<int ()> or Fn() -> int, for example). A thunk is a value of callable (computable? is this really different?) type, and Return is the magic operation that wraps a value into a trivial closure, like:

    [val]() { return val; }
in C++.

Maybe there’s more to it than that.



It feels like half the text is dealing with arity confusion that only comes up because of a particular way of implementing functions.

Because I agree, if you take a statically typed call-by-value language and "introduce little spurts of lazy evaluation" then don't you get the same flexibility? And you'll also know the arity at all times.

There's something in the syntax I don't understand in the middle about unifying things, but then it later says you have to explicitly use "Return" on thunks in records to evaluate them, which sounds like the same thing a CBV language does.

Are there other benefits I'm not understanding?

Does the unification apply only to function parameters?


I found it almost impossible to understand. The syntax used for their examples was lisp-like, and the function arity seems unambiguous. There is no implicit currying in lisp as far as I know. Extra-confusingly, the definitions at the start were in a syntax resembling Haskell, but I think it has multiple mistakes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: