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

Now it only needs a proper JIT, to catch up with Common Lisp in 1984.



Common Lisp doesn't specify anything about JIT.


So what?

Lisp compiles to native code since 1962, having a JIT is pretty much given.

I only mentioned Common Lisp, because of the wide library, having already the implementation experience of Lisp Machines from Xerox PARC, TI, Genera, and being as dynamic as Python if not more so, already to sidestep the usual dynamism excuse for lack of Python JIT's.


Lisp's dynamic nature does not come from having or not having JIT; none of the implementations you mention had JIT.

Compiling to native code isn't JIT, it was very common to run just straight interpreted code on the Lisp Machines (since compiling took a long time, and then to load the final file object on slow disks).


JIT is a synonym for dynamic compiler in CS speak.

Feel free to show us the manuals of those implementations without a chapter about (compile ....), (disassemble ....) or similar.


Your claim was that JIT was something CL had, it doesn't. But now your switching topics.

The Lisp Machine compiler is incremental, but it is not a dynamic compiler, it never changes the compiled object when it has been compiled during run-time. This is similar with all Lisp implementations, and even Python. Code is also not compiled by default on the Lisp Machine, it is interpreted.

https://docs.python.org/3/library/functions.html#compile https://docs.python.org/3/library/dis.html

Python has all the building blocks that Lisp does in this regard, and has had for many many years. But I'm not allowed to quote the Lisp Machine manual on the topic, since it has chapters on the compiler so I'll jump out of this conversation now...



That describes incremental compilation. Something Python is also capable of.

Dynamic compilation (i.e. compilation during execution and/or modifying the emitted compiled output during run-time -- depending on which school one prefers) was never a thing on the Lisp Machine, and is not even a thing in modern Lisp implementations like say SBCL which just does static compilation (compiled object is never modified when it has been compiled).

    (print-herald)
    LM-3 System, band 4 of AMS-LISPM-2. (LM-3)
    2048K physical memory, 16127K virtual memory.
     Experimental System     300.0
     Experimental Local-File  54.0
     Microcode               323
    AMS Lisp Machine Two, with associated machine FS.
    
    (defun foo () "bar")
    FOO
    (compiled-function-p #'foo)
    NIL


From https://en.wikipedia.org/wiki/Just-in-time_compilation

"The earliest published JIT compiler is generally attributed to work on LISP by John McCarthy in 1960"

As for the LM-3 example, I would rather be proven wrong by you pointing me to PyPy as counter example, but the poor fellow not even for this comes up.


Yeah, but that's wrong. It's the usual confusion about Just in Time dynamic compilation by the system and incremental compilation by the user.

LISP I had an incremental compiler. The user calls the compiler with a list of functions or function definitions to compile. It's not compiling dynamic by the system and also does not use information about the running function (call statistics, call argument statistics, ...).

There is no "Just in Time" functionality provided. The developer is responsible to decide what code to compile and when to compile the code. A function needs to be compiled by the developer before it is invoked, otherwise it won't run compiled. In a JIT compiled setting the system decides when to compile the code: either on start or during runtime triggered by the system. The code will be "Just in Time" compiled.

This Wikipedia article explains the difference:

https://en.wikipedia.org/wiki/Dynamic_compilation

"Just-in-time compilation is a form of dynamic compilation."

"Unlike dynamic compilation, as defined above, incremental compilation does not involve further optimisations after the program is first run."

Later Lisp systems may have aspects of JIT compilation. For example some CLOS implementations optimize code (-> method combinations) at runtime, possibly via compilation.


COMPILE is AOT, not JIT. Typical Lisp compilers will not dynamically optimize code based on runtime performance metering.


From https://en.wikipedia.org/wiki/Just-in-time_compilation

"The earliest published JIT compiler is generally attributed to work on LISP by John McCarthy in 1960"

I can naturally also go hunthing for those papers from my digital cellar.




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

Search: