|
|
|
|
|
by matheusmoreira
77 days ago
|
|
The idea is to create a language good enough to build a Lisp user space for Linux. I didn't dare to call it a lisp machine at first but other users suggested that when it was first submitted here on HN. Here's the discussion: 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.