News for hackers. Stuff that matters.
Re:GIL Become Optional in Python 3.13 by pjmlp on Monday August 12, 2024 @03:23AM (#41221961)
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.

Re:GIL Become Optional in Python 3.13 by amszmidt on Monday August 12, 2024 @03:57AM (#41222158)
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).

Re:GIL Become Optional in Python 3.13 by pjmlp on Monday August 12, 2024 @04:17AM (#41222283)
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.

Re:GIL Become Optional in Python 3.13 by amszmidt on Monday August 12, 2024 @04:38AM (#41222400)
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...

Re:GIL Become Optional in Python 3.13 by pjmlp on Monday August 12, 2024 @04:47AM (#41222447)
Re:GIL Become Optional in Python 3.13 by amszmidt on Monday August 12, 2024 @05:14AM (#41222593)
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
Re:GIL Become Optional in Python 3.13 by pjmlp on Tuesday August 13, 2024 @03:40AM (#41233210)
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.

Re:GIL Become Optional in Python 3.13 by lispm on Tuesday August 13, 2024 @03:45AM (#41233241)
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

"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.

Re:GIL Become Optional in Python 3.13 by lispm on Monday August 12, 2024 @11:29AM (#41225564)
COMPILE is AOT, not JIT. Typical Lisp compilers will not dynamically optimize code based on runtime performance metering.
Re:GIL Become Optional in Python 3.13 by pjmlp on Tuesday August 13, 2024 @03:39AM (#41233198)
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.