logoalt Hacker News

kazinator10/12/20241 replyview on HN

Things like atom and symbols are functions in the runtime. A Lisp compiler only has to handle special forms, and function calls. If we see the compiler source code using a special operator that it doesn't handle, either directly using it or via macro expansion, then we know it's not yet self-hosting.


Replies

kragen10/12/2024

Normally I would assume you were right, but the list of things supported in the compiler includes these items:

List functions: car, cdr

Arithmetic functions: +, -, *, /, mod, 1+, 1-

Arithmetic comparisons: =, <, <=, >, >=, /=

So I think the compiler may not be able to compile calls to arbitrary functions? Maybe I should read the code.

show 2 replies