4 ms·
Calling this a lisp is a bit of a stretch. S-expressions aren't lisp if they don't have lisp semantics.
by aap_ 8y ago
Calling this a lisp is a bit of a stretch. S-expressions aren't lisp if they don't have lisp semantics.
- fao_ 8y agoWhat part of the code that will compile under this simple compiler (i.e. `(+ 2 (+ 3 4))`) _doesn't_ have lisp semantics?
- samsaga2 8y agoLisp uses S-expressions but not all the S-expressions are lisp. If you cannot define functions with free variables then is not lisp.
- junke 8y agoInteger overflow.
- kazinator 8y agoNot all historic dialects of Lisp have bignum integers. I don't know what the current situation is in Emacs Lisp, but it had only fixnums at one point.
- imglorp 8y agoEval... as in REPL, is tough without an interpreter in process.
- kazinator 8y agoI would say this: - tokens are just collections of non-space characters, passed raw through to an assembler, where it is assumed that they denote machine words. Whatever happens, happens. The "symbol" eax will refer to a register, for instance. (If this project had stuck with AT&T assembly syntax, at least that would have been qualified as %eax%). - functions aren't registered under Lisp symbols but are just global references to assembly-language labels. It seems we can just do (1234 4) and it will just call address 1234. - no LIS)t P)rocessing to be seen here. That said, there is no language that is just "Lisp", and so there is no prescribed set of semantics. We can make a prefix expression preprocessor for x86 assembly language and call it "Phil Lisp" (or whatever qualifier).
- Bjartr 8y agoFor those who don't know. What exactly are the semantics of lisp?
- Jtsummers 8y agoThis is really a minimal translator from s-exprs to assembly. Which is still an interesting project. To be a lisp, you need to be able to declare and call functions, and construct and manipulate lists. Once you have that, you can then manipulate the code itself since s-exprs are just lists of a certain construction.