News for hackers. Stuff that matters.
Re:An ARM Assembler Written in Lisp by nathell on Saturday July 08, 2023 @01:40PM (#36646708)
I once wrote a rudimentary x86 assembler in about 250 lines of Clojure:

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.

Re:An ARM Assembler Written in Lisp by agumonkey on Saturday July 08, 2023 @02:39PM (#36647400)
doesn't clang use a sexp like notation for some IR ?
Re:An ARM Assembler Written in Lisp by mejutoco on Saturday July 08, 2023 @03:28PM (#36647869)
and webassembly.
Re:An ARM Assembler Written in Lisp by agumonkey on Saturday July 08, 2023 @06:34PM (#36649450)
Oh that's it, I was reading some wasm articles last month.
Re:An ARM Assembler Written in Lisp by excircul on Saturday July 08, 2023 @06:07PM (#36649265)
Re:An ARM Assembler Written in Lisp by muricula on Saturday July 08, 2023 @11:07PM (#36651109)
Clang'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.
Re:An ARM Assembler Written in Lisp by kazinator on Sunday July 09, 2023 @01:29AM (#36651821)
To rub salt in Stallman's wounds.