4 ms·
I once wrote a rudimentary x86 assembler in about 250 lines of Clojure: https://github.com/nathell/lithium/blob/master/src/lithium/assembler.clj https://github
by nathell 3y ago
I once wrote a rudimentary x86 assembler in about 250 lines of Clojure:
https://github.com/nathell/lithium/blob/master/src/lithium/assembler.clj https://github.com/nathell/lithium/blob/master/src/lithium/a...
In general, I find that s-expressions are actually a nice syntax for assembly languages. For x86, they kind of sidestep the AT&T vs. Intel conundrum, and you get to write macro-like functions in the host Lisp that compile down to s-expressions.
- agumonkey 3y agodoesn't clang use a sexp like notation for some IR ?
- mejutoco 3y agoand webassembly.
- agumonkey 3y agoOh that's it, I was reading some wasm articles last month.
- excircul 3y agoGCC’s RTL does https://gcc.gnu.org/onlinedocs/gccint/RTL.html https://gcc.gnu.org/onlinedocs/gccint/RTL.html
- muricula 3y agoClang's ir is more c like. I can't find a link to a good example offhand, but if you pass the right combinations of flags to clang you can dump it.
- kazinator 3y agoTo rub salt in Stallman's wounds.