3 ms·
> Most of the elisp code you run is largely static. It does change And JavaScript programs almost never change after a website is loaded. That has nothing to d
by sedachv 6y ago
> Most of the elisp code you run is largely static. It does change
And JavaScript programs almost never change after a website is loaded. That has nothing to do with whether the programs are compiled.
> you only have to recompile a few files. The elisp isn't being JITed, it's being compiled into shared objects which are cached aggressively
You do not need any files to compile Elisp code, and you do not have to save the bytecode anywhere.
> Completely different kettle of fish.
What exactly is your definition of JIT? I think you might be confusing "JIT" with dynamic recompilation.
> ECL compiles to c.
Ok, and what do you think happens to C?
- moonchild 6y ago>> Most of the elisp code you run is largely static. It does change > And JavaScript programs almost never change after a website is loaded No, but new javascript programs are frequently loaded. > You do not need any files to compile Elisp code, and you do not have to save the bytecode anywhere. You do not need to do any of this by hand, but it still happens; emacs does it automatically. > What exactly is your definition of JIT? I think you might be confusing "JIT" with dynamic recompilation. The term is somewhat nebulous. I don't think it's appropriate to apply it to the result of a traditional compilation process that occurs immediately prior to execution. If (for instance) I write a script in c and run it with tcc -run, what happens is that that file is compiled—very similarly to a ‘traditional’ AOT, though the dynamic linker is bypassed—and the result is run. Essential to JIT, in my view, is not dynamic recompilation, but plain dynamic compilation. Compilation should occur concurrently with execution, and is usually accompanied by some heuristic for deciding what to compile first (e.g. tracing) as well as an interpreter. Wikipedia agrees: > JIT is a way of executing computer code that involves compilation during execution of a program ______________________________________ > what do you think happens to C? Under most implementations, it is statically compiled to a native binary. Even if it is not, however, ECL does not JIT c, but produces it statically.
- sedachv 6y ago> No, but new javascript programs are frequently loaded. This is probably what confuses a lot of people into thinking that program distribution has anything to do with JIT. JavaScript is the only programming language for which the main method of program distribution is source-code-only, and why all the trade-offs of adaptive optimization seem necessary, to the point that now people are making its necessity into a virtue. Likewise for Java stealing credit for popularizing portable bytecode as the main method of program distribution - although Gosling coined the term JIT years before Java had a JIT compiler. > If (for instance) I write a script in c and run it with tcc -run And what happens when you use libtcc? > Compilation should occur concurrently with execution Execution of what? You do not need an interpreter or a bytecode VM to have a JIT compiler. > usually accompanied by some heuristic for deciding what to compile first (e.g. tracing) That is adaptive optimization, and is orthogonal to compiling (you can have adaptive optimizations in an interpreter or a bytecode VM). Tracing (which is not a heuristic btw) is a variation of profile-guided optimization, which is orthogonal to JIT. > Even if it is not, however, ECL does not JIT c, but produces it statically. I posted this elsewhere in this thread: https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/src/cmp/cmpmain.lsp#L732 https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop... Can you explain why you think that is not a JIT.