Hacker News new | ask | show | jobs
by archgrove 3906 days ago
I think it's a lovely idea, with an interesting implementation.

Obligatory HN style comment: It might be wise to strengthen the description from "pure" functions to "pure and terminating". I've not had time to form an opinion on whether the restrictions are sufficient to ensure this (JavaScript's evaluation rules are...complex). However, the informal specification of this being a lambda calculus with multiple arguments isn't strong enough - that would allow non-termination on load, which is not something you really want in your data serialisation format.

1 comments

There is no protection against non-termination. For example, an user could give you this function:

    f = (function (x){ return x(x); })
Now, if you call `f(function(f){return function(x){ return f(f(x)) }})`, it'll not halt. But there are good principled ways to work around that, such as adding a type system like System F. That would discard 100% of the programs that halt, at the cost of also losing some programs that do halt.