Hmm, really nice! I might have to steal all of this for my language (<a href="https://github.com/alexisread/minim/blob/develop/minim/minim.org">https://github.com/alexisread/minim/blob/develop/minim/minim...</a> really in flux ATM)<p>Reminds me of <a href="https://pygmy.utoh.org/3ins4th.html" rel="nofollow">https://pygmy.utoh.org/3ins4th.html</a> except the third instruction is execute rather than quote.<p>In the spirit of building from scratch, I'd like to highlight sectorforth/milliforth (<a href="https://github.com/fuzzballcat/milliForth/blob/master/sector.asm">https://github.com/fuzzballcat/milliForth/blob/master/sector...</a>) - they implement as little as possible to get a working system ie. just the basic fetch/store ops, numerical and I/O.<p>The parser can probably be reduced - there's a nice paper detailing Cognition (a forth dialect, but the parsing could be broken out into a lib - <a href="https://ret2pop.nullring.xyz/blog/cognition.html" rel="nofollow">https://ret2pop.nullring.xyz/blog/cognition.html</a>) where using a couple of crank operators, you can implement custom syntax in a forth-style way (as opposed to say PEGs).<p>In terms of variables and scoping, Dreams (another forth dialect- <a href="http://elilabs.com/~rj/dreams/dreams-rep.html" rel="nofollow">http://elilabs.com/~rj/dreams/dreams-rep.html</a>) uses mianly dynamic scoping, and builds it's structs (C-style structs) using the standard forth struct words. This allows it to be hard-realtime though as you don't need to walk the lexical tree to bind variables. You can also early bind like with CBPV. I guess this is also similar to REBOL's BINDology (<a href="https://github.com/r3n/rebol-wiki/wiki/Bindology">https://github.com/r3n/rebol-wiki/wiki/Bindology</a>)<p>Lots of overlap here with these things. Just for completeness there's also dynamic variable handling (over lexically scoped structures) with wat (<a href="https://github.com/GiacomoCau/wat-js/tree/master">https://github.com/GiacomoCau/wat-js/tree/master</a>) though this is not realtime.<p>Is it possible to make the closures dynamically scoped by default here? I've not had time to think about this properly. I like the fact that eval is lazy here like in forth or REBOL, rather than eager as in lisp - the idea of passing around blocks/thunks appeals wrt realtime (well with dynamic scoping) and parallelism.<p>The env per-thread I guess could be compared to the forth dictionary? Dreams abstracts this by virtue of it's (token) threading model which appears useful for task switching, objects and the like.<p>I'd also like to highlight able forth which has:
Compiler-only design (like Freeforth)
- Word-classes (like Retro)
- A straightforward bootstrap process using a minimal set of seed words (like seedForth)
- No (ZERO) special forms, not even integers, and a consistent model for adding literals without the complexity of i.e. recognises
- A single flat word-list that can be freely manipulated and composed of other word-lists
- No separate [assembly] code words
- Explicit optimizations (ONLY) i.e. explicit tail-call elimination<p>I've only started looking into able forth so can't really comment on it much, but the no-special-forms appeals here.<p>Sorry, random thoughts here, I'd like to discuss further when I've had time to digest your language. :)