Lisp compilers that compile directly to assembly 0 ▲ Chris Done's Blog 20 hours ago · Tech · hide · 0 comments Lisp compilers that compile directly to assembly Note: An LLM was not used in writing this article. I’d like to point out one cool thing that some Lisp compilers, like SBCL, do. SBCL compiles functions and expressions directly to assembly. There aren’t other AST interpreter or byte-code interpreter modes, as seen in many other languages. Let’s turn on debugging up to the fullest: (declaim (optimize (debug 3) (safety 3) (speed 0) (compilation-speed 3))) Declare a simple function: * (defun testfunc (a b) (+ a b)) We can immediately ask for the assembly in the REPL: * (disassemble 'testfunc) ; disassembly for TESTFUNC ; Size: 60 bytes. Origin: #x10020101B0 ; TESTFUNC ; B0: AA0A40F9 LDR R0, [THREAD, #16] ; binding-stack-pointer ; B4: 4A0B00F9 STR R0, [CFP, #16] ; B8: 7A0300F9 STR CFP, [CSP] ; BC: EA030EAA MOV R0, R4 ; C0: EB030DAA MOV R1, R3 ; C4: FA031BAA MOV CFP, CSP ; C8: 3C9C80D2 MOVZ TMP, #1249 ; CC: BE6B7CF8 LDR LR, [NULL, TMP] ; SB-KERNEL:TWO-ARG-+ ; D0: C0033FD6 BLR LR ; D4:… No comments yet. Log in to reply on the Fediverse. Comments will appear here.