I think there's something to this. And while America has always had this can-do attitude (just look at the number of self help books), it does seem to be in another gear recently. I don't know what caused it, but I think there have been a number of indicators: Trump ignoring Congress and introducing wild tariffs, Musk firing half of Twitter's staff and then later repeating this with DOGE, the quick roll-out of LLMs. There seems to be this prevailing attitude of "we can just do stuff, damn the consequences".
It appears to come with a lot of corruption and anti-intellectualism. Like you say there are also benefits to this. I think the break through of mRNA vaccines was an early indicator. I just hope we can steer this attitude back to a more optimistic world-view instead of the blatant self serving one that is currently prevailing.
A friend of mine used to once a year hang all his shirts with the open end of the cloth hangers' hooks facing forward. After wearing and washing them he'd hang them back with the hanger facing the other way. After a year he'd toss out any shirts that were still facing the original way and had thus not been worn.
I’ve gotten rid of a lot of clothing in the past 18 months. I bring a very limited amount of specific clothing traveling, don’t fuss much around the house, local hikes, the theater now and then etc. I just have no use for a lot of to the office clothing I wore into the office every day.
I like the overview given in this Stackoverflow answer [1] (based on an even earlier comment) which classifies different types of continuations:
- 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.
That's a great overview. Yeah they are asymmetric, Wikipedia says symmetric and asymmetric correspond to coroutines and semicoroutines. They are also stackful and delimited. They are single shot by design, though I could easily make it possible to restart the generator from scratch if needed.
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.
Very cool stuff and great written article. Lone looks very interesting!
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.
Thank you. Proper exception/condition handling is a high priority item on my list. It's something that is long overdue... Lone currently hard exits on literally any error.
My delimited continuations article also talks about exception handling:
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.
Yes! I was racking my brain trying to remember what it was called. Back in the early 2000s I ran BeOS on my desktop and absolutely loved it. Then when they went under, I followed the effort to come up with an open source version with guest interest. There was one effort that wanted to build everything from scratch. That's what was later renamed into Haiku (I think initially openBeOS maybe?). There was also BlueEyedOS who thought you could get there faster by building on Linux and X11.
I think Haiku got more traction because at the time people felt that it should run BeOS software without recompiling. I have long wondered what would have happened if BlueEyedOS would have gotten most of the effort.
I really liked working in the NL, but their food and drink I could not get used to. I did a bit of consultancy at KLM, and what was offered for lunch in the cafeteria turned my stomach - artificial meat, artificial bread. I complained about this to one of the KLM staffers I was working with - "We know, We know, and of course the bosses never eat here"
Also, the Dutch idea of Chinese food is very strange (basically some sort of Indonesian thing - and I like Indonesian, but not that).
Anyway you in no way requested a critique of Dutch cuisine, but I'm glad I got it off my chest. So, apologies.
Clojure also has the anonymous function syntax with #(foo a b %) where you essentially get exactly this hole functionality (but with % instead of $). Additionally there’s partial that does partial application, so you could also do (partial foo a b).
Correct, and J# was a brief transition language to help migrate Visual J++ applications onto the .Net SDK. J++ -> J# -> C# was the evolution.
I say J# is a more apt comparison because like Microsoft's Java, android has a substantial set of APIs that aren't part of the JDK standard. Working on Java vs Anrdoid is practically like working with the JDK vs .Net.
I think that should work in racket-mode as well. You can easily send individual sexps to the repl and add to the live state. However, one thing that CL does that Racket doesn't do (afaik) is when you change a data type (e.g. alter a struct), it automatically ensures live code uses the new types. In Racket by contrast I have to either carefully go through all affected forms and send them to the repl, or send the whole buffer to the repl. This does make the whole experience feel more static than in CL.
It appears to come with a lot of corruption and anti-intellectualism. Like you say there are also benefits to this. I think the break through of mRNA vaccines was an early indicator. I just hope we can steer this attitude back to a more optimistic world-view instead of the blatant self serving one that is currently prevailing.
reply