https://www.wingolog.org/archives/2010/02/26/guile-and-delim...
I even cited it in my own delimited continuations article:
https://www.matheusmoreira.com/articles/delimited-continuati...
After publishing that I actually emailed him about it. I wanted to show him how I solved the interleaving stacks problem he outlined in that article. No idea if he ever saw the email but his about page does mention the fact email has very variable latency.
I haven't seen Lone Lisp before. Is it meant to be like a Symbolics Lisp Machine, where the entire userspace is lisp?
I really like using generators in typescript. They make a lot of problems much easier.
https://news.ycombinator.com/item?id=38126052
I'm doing some plumbing work on lone right now, then I'll start designing the iterator protocol. Gotta fix some usability details in the generators to make them more pleasant to use but I'm really proud of the fact that they even work at all. I'll read about typescript generators and try to understand what makes them great to use.
This article sums it up pretty well: https://medium.com/@bhagyarana80/why-async-generators-were-t...
In nodejs, all streams are async iterables, so you can iterate over them. Really nice for handling stuff like connections to a server, or messages on a socket.
I’ve use generators to code ui “sagas”. You await async events like clicks etc, and yield the appropriate state updates. A sub-dialog can be implemented as a separate generator, and the main dialog generator can open it by with the yield* syntax to iterate over and pass on all the events until the generator returns. The return value would be the result of the dialog.
Super nifty.
A suggestion to the website index, could you add dates to the entries? I find the numbered list confusing as its not entirely clear in what order they are listed.
- Asymmetric or symmetric
- Stackful or stackless
- Delimited or undelimited
- Multi-prompt or single prompt
- Reentrant or non-reentrant
- Clonable or not
Based on that these generators (or semi-coroutines as the article also calls them) seem to be asymmetric, stackful, delimited, single prompt(?), non-reentrant continuations.
[1] - https://stackoverflow.com/questions/62817878/what-are-the-sp...
As for single prompt vs multiprompt... I'm not too sure about this one. I have a check to prevent recursion but nesting generators shouldn't be a problem since they keep track of their own callers.
I think lone's generators have composability issues due to the stack separation. For example, calling a generator g2 inside another generator g1 doesn't transparently yield values from g2 to g1's caller. I've been wondering about how to fix this without a Python-like yield from primitive.
Are you planning to use your design to support things like exceptions as well? I think that's where that multi-prompt ability becomes important (yielding from a nested coroutine). Racket has prompts and aborts, which is essentially a 'yield to' primitive.
My delimited continuations article also talks about exception handling:
https://www.matheusmoreira.com/articles/delimited-continuati...
Throw/catch are just delimited continuations which don't actually capture the continuation. The machinery is already in place. If I copied the control/transfer primitives and removed the continuation code, I'd have a functional exceptions handling mechanism.
In suppose I can use tagged prompts to catch some exceptions and not others. Place a symbol in the stack delimiter, then the transfer primitive can look for it and skip anything that doesn't match. Untagged prompts just use nil as the tag.