We're really happy to announce that the tabletop editor has been merged.
We've been working on it on and off since early last year, and although there's still a lot to do, we think it makes Folk feel like an entirely different kind of system now that it's in place. Folk is now a 'real' computer, in the sense that it can be programmed in itself, without depending on a laptop (and it brings all the usual advantages of Folk to the activity of programming Folk – you can show people what you're doing, they have an ambient sense of when other people in the room are programming, we can extend the editor easily, and so on).
Omar has been hacking on a parallel evaluator.
General approach is to do naive pure-C, copy-into-shared-string, one-big-lock version of everything first, which I'm hoping will already be much faster and much more parallel than the current evaluator (which uses Tcl heap objects, isn't parallel at all, and still copies a lot, I think)
There'll be NUM_CPUS-ish worker threads; each holds a lock while it's touching the database or priority queue; they're constantly pulling off next work item (Assert/Retract/Say/Unmatch) from the shared priority queue. (This is how the mainline evaluator works, except it's just one loop pulling off the priority queue.)
(Doing this all in a parallel way kind of requires the entire database, including statements and terms of statements, to be pure C data, since Tcl heap objects can't be shared across threads or processes)
(It'll be fun to get to the point of thinking about scheduling policy – detecting When blocks that are taking a really long time, maybe setting up additional worker threads as some get blocked, and so on. We don't have any way to entertain concepts like that in mainline Folk right now. It'll also be fun to really push the purity of Folk code, where global state will all literally have to run through statements.)
To give motivation for all this, I'll quote myself from the November 2023 newsletter:
The main motivation is actually sort of a user interface motivation: I want people to feel comfortable writing programs that hang or segfault, and I want people to feel comfortable putting 30 different programs on the table, without being scared that they'll crash the whole Folk system or break their (in-system) editor. That requires Unix process isolation, I think, and it requires preemptive multitasking.
I was showing people Metrics at the open house recently – I would flip stuff over and show how much performance improved the more stuff I flipped over, until there was like 1 program out and it would fly (100fps+), and the smoothness was noticeable and impressive. And it made the system much more fun to play with. I want the system to feel like that all the time!
(in other words, why should adding a new program slow down all your other programs? it doesn't on a normal OS, up to the actual limit of your hardware)