4 ms·
> I have a pet theory that lisp macros over an assembler is the right high level language for systems programming but that hasn't made it off the whiteboard yet
by zero_shift 3y ago
> I have a pet theory that lisp macros over an assembler is the right high level language for systems programming but that hasn't made it off the whiteboard yet.
I'm having a little trouble visualising this. Don't many assemblers provide macro-instructions already?
- JonChesterfield 3y agoAssemblers come with text substitution macros. Lisp comes with program rewriting macros. Same basic idea that it's all expanded away by runtime, but using something like scheme as the compile time metaprogram that emits the machine specific assembly. There are a few s-expression based assemblers out there so probably nothing novel.
- alexisread 3y agoWell Forth is possibly the most minimal VM over a platform, as evidenced by openfirmware. It does have problems scaling though, in that if you've seen one Forth, you've seen one Forth ie. The variations required to fit a platform make them semi-incompatible. Also, only global scope, no types and no built-in threadsafe constructs are limiting. That's not to say that a more lispy Forth wouldn't be useful though, in that a concatenative syntax allows us to pass custom datastructures around like APL, and CPS (delimited continuations with lexically scoped dynamic binding would come from the lisp side (see https://github.com/manuel/wat-js https://github.com/manuel/wat-js). Memory management in Forth can handle multiple memory types eg. https://flashforth.com/ https://flashforth.com/ so adding something like ref counting (https://github.com/zigalenarcic/minilisp/blob/main/main.c https://github.com/zigalenarcic/minilisp/blob/main/main.c) to handle the dynamic list side of things might mesh well. In any case, if you're looking for a self hosting lisp that runs on bare metal, https://github.com/attila-lendvai/maru https://github.com/attila-lendvai/maru has been out for a few years.