5 ms·
> I have no clue what you're talking about That's not good. Try again. In Lisp adding two numbers looks like this is source code: (+ 1 2) CL-USER 41 > (+ 1
by lispm 3y ago
> I have no clue what you're talking about
That's not good. Try again.
In Lisp adding two numbers looks like this is source code: (+ 1 2)
CL-USER 41 > (+ 1 2)
3
If I quote the expression and evaluate it, the result is (+ 1 2)
CL-USER 42 > (quote (+ 1 2))
(+ 1 2)
Thus in Lisp the textual representation of code and code as data are the same.
Not so in "Wolfram Language": a + b has a FullForm which looks differently. The user does not write ALL of the code in FullForm notation.
Source notation
a + b
FullForm
Plus[a, b]
Lisp:
Source notation
(+ a b)
FullForm
(+ a b)
Can you see the difference?
> Lol I am 100% sure that the majority of lisps cannot be aot compiled.
I'd expect that they can. That's a feature since 1962. SBCL for example does AOT compilation by default, always.
* (disassemble (lambda (a) (+ a 42)))
; disassembly for (LAMBDA (A))
; Size: 36 bytes. Origin: #x7006DC83B4 ; (LAMBDA (A))
; B4: AA0A40F9 LDR R0, [THREAD, #16] ; binding-stack-pointer
; B8: 4A0B00F9 STR R0, [CFP, #16]
; BC: EA030CAA MOV R0, R2
; C0: 8B0A80D2 MOVZ R1, #84
; C4: 3CAA80D2 MOVZ TMP, #1361
; C8: BE6B7CF8 LDR LR, [NULL, TMP] ; SB-KERNEL:TWO-ARG-+
; CC: DE130091 ADD LR, LR, #4
; D0: C0031FD6 BR LR
; D4: E00120D4 BRK #15 ; Invalid argument count trap
NIL
Looks like native ARM64 code to me.
- mathisfun123 3y ago> FullForm Plus[a, b] How can I make this any more clear? You are able, in Mathematica, to write Plus[a, b] with your own fingers on your own keyboard and it will be interpreted as the same thing as a+b > I'd expect that they can. Clisp is not the only lisp - I can name 10 others that cannot be compiled.
- kazinator 3y agoIf we count everyone's one-weekend project that evaluates (+ 1 2) into 3, then there are probably thousands of Lisps that cannot be compiled. So what?
- lispm 3y agoThen the person should spend another weekend and implement a compiler for it.
- lispm 3y ago> You are able, in Mathematica, to write Plus[a, b] with your own fingers on your own keyboard and it will be interpreted as the same thing as a+b Sure, but it is not Mathematica's InputForm: https://reference.wolfram.com/language/ref/InputForm.html https://reference.wolfram.com/language/ref/InputForm.html The majority of code is written not in FullForm. In Lisp 100% of the code is written in s-expressions. > Clisp is not the only lisp - I can name 10 others that cannot be compiled. Typical Lisp and Lisp dialects all can be compiled: Common Lisp, Emacs Lisp, ISLisp, Scheme, Racket, ... Which Lisps can not be compiled?
- mathisfun123 3y ago>Racket Do you really know what you're talking about here? https://docs.racket-lang.org/raco/make.html https://docs.racket-lang.org/raco/make.html >The raco make command accept filenames for Racket modules to be compiled to bytecode format. That's not a compiler... I don't claim to be an expert on lisp, so further googling I find https://racket.discourse.group/t/chez-for-architectures-without-native-backends/950/2 https://racket.discourse.group/t/chez-for-architectures-with... which has some discussion about this and that native backend. Suffice it to say I am not any more confident that being compilable is somehow intrinsic to lisp.
- lispm 3y agoFrom the Racket documentation: https://docs.racket-lang.org/reference/compiler.html https://docs.racket-lang.org/reference/compiler.html "18.7.1.2 CS Compilation Modes The CS implementation of Racket supports several compilation modes: machine code, machine-independent, interpreted, and JIT. Machine code is the primary mode, and the machine-independent mode is the same as for BC." CS is the new implementation of Racket on top of the Chez Scheme runtime. Chez Scheme is known for its excellent machine code compiler. "Machine code is the primary mode" > Do you really know what you're talking about here? Read above.
- kazinator 3y agoIf you have time to research Lisp implementations until you gather ten that don't have compilers, you might want to take a few seconds to visit https://clisp.cons.org https://clisp.cons.org to find out what Clisp means.