Hacker News new | past | comments | ask | show | jobs | submit login

> Lol I am 100% sure that the majority of lisps cannot be aot compiled.

    CL-USER> (defun foobar (x) (1+ x))
    FOOBAR
    CL-USER> (disassemble #'foobar)
    ; disassembly for FOOBAR
    ; Size: 35 bytes. Origin: #x5365BF44                          ; FOOBAR
    ; 44:       498B4510         MOV RAX, [R13+16]                ; thread.binding-stack-pointer
    ; 48:       488945F8         MOV [RBP-8], RAX
    ; 4C:       BF02000000       MOV EDI, 2
    ; 51:       488BD3           MOV RDX, RBX
    ; 54:       FF14251001A052   CALL QWORD PTR [#x52A00110]      ; SB-VM::GENERIC-+
    ; 5B:       488B5DF0         MOV RBX, [RBP-16]
    ; 5F:       488BE5           MOV RSP, RBP
    ; 62:       F8               CLC
    ; 63:       5D               POP RBP
    ; 64:       C3               RET
    ; 65:       CC10             INT3 16                          ; Invalid argument count trap
    NIL
    CL-USER> 
There you go: #'FOOBAR is AOT-compiled down to four MOVs, a CALL, two MOVs, a CLC, a POP and a RET.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: