Le mar. 9 juil. 2019 à 00:30, John Cowan <xxxxxx@ccil.org> a écrit :


On Mon, Jul 8, 2019 at 6:20 PM Lassi Kortela <xxxxxx@lassi.io> wrote:

Unfortunately I think the load time can be a deal breaker (for normal
web apps; for a full interpreter like on that page, it's probably fine).

Chibi's load time is long also, but of course it is fully tail recursive.

The oldest approach to tail recursion is to have a trampoline.  Each
Scheme-to-JS function returns the next function to be invoked,
and then there is a little loop that calls the start function and then calls what
it returns, then what the next one returns, and so on.  This loop is purely
iterative, and it works in any language although with some overhead.


 John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
An observable characteristic is not necessarily a functional requirement.
        --John Hudson


There is also the idea that would rely on setTimeout, IIRC it is easier to implement
but also lead to slower code.

--
Amirouche ~ amz3 ~ https://hyper.dev