3 ms·
Neat. This could be embedded into a Lisp/Clojure syntax.
by asimjalis 5y ago
Neat. This could be embedded into a Lisp/Clojure syntax.
- User23 5y agoA toy project I have in mind is bootstrapping a lisp in asm and then using lisp macros as assembler macros to build up a high level language that would effectively be native code.
- Jach 5y agoSounds like it'd be cool for the sake of it, but just in case you (or other readers) aren't aware (Edit -- looks like you are very aware ;) SBCL already compiles Lisp code to native code. It's not the same as (asm) macros all the way down, but still. You can even inspect the assembly of a function with the built-in function DISASSEMBLE, and see how it changes with different optimization levels or type declarations or other things. https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-co... is worth a read too for a cool experiment in generating custom assembly for a VM idea.
- lispm 5y agoWith various implementations (Clozure Common Lisp) one can write inline assembler interactively.