News for hackers. Stuff that matters.
Re:Ruby 2.6.0-preview2 released with JIT by kryptiskt on Sunday June 03, 2018 @02:00PM (#17220760)
Not at runtime.
Re:Ruby 2.6.0-preview2 released with JIT by atombender on Sunday June 03, 2018 @02:55PM (#17221095)
Varnish uses GCC to compile VCL into a dynamically loaded library. Not a general-purpose language, but it's done at runtime.
Re:Ruby 2.6.0-preview2 released with JIT by useranme on Sunday June 03, 2018 @02:07PM (#17220800)
MemSQL and Smalltalk generate C at runtime.
Re:Ruby 2.6.0-preview2 released with JIT by pjmlp on Sunday June 03, 2018 @03:02PM (#17221123)
If you mean Squeak, it surely does not.

Generating C is part of the bootstrapping process, it isn't used at runtime, the JIT generates the usual machine code directly.

Re:Ruby 2.6.0-preview2 released with JIT by floatboth on Sunday June 03, 2018 @02:31PM (#17220951)
Which Smalltalk?
Re:Ruby 2.6.0-preview2 released with JIT by dfox on Sunday June 03, 2018 @04:18PM (#17221547)
Smalltalk/X can fileout packages as C projects that are then compiled by C compiler. But AFAIK this was never meant to be used as JIT and is primarily an deployment mechanism and non-ancient versions use in-process code generator implemented in Smalltalk as JIT backend.

There are Common Lisp implementations that support similar mechanism of generating C code (ECL, Kyoto CL...), but I don't think any of then compiles C into .so which then gets dlopened right away as poor-mans JIT.

Re:Ruby 2.6.0-preview2 released with JIT by kazinator on Sunday June 03, 2018 @10:25PM (#17224059)
KCL generates .c files and compiles those to .o object files. I played with this year ago (via the descendant GCL: GNU Common Lisp). The load function handles object files, like COFF or whatever. It's reminiscent of the Linux kernel modules.

See here, starting on P. 36: http://www.softwarepreservation.org/projects/LISP/kcl/doc/kc...

When KCL compiles a lambda expression, it generates a C file called "gazonk.lsp" and compiles that.

(The above paper report is a little confusing; in some places it claims that an object file has a .o suffix, but then with regard to this gazonk implicit name, it claims that the fasl file is gazonk.fasl.)

Re:Ruby 2.6.0-preview2 released with JIT by lispm on Monday June 04, 2018 @03:41AM (#17225429)
Example with GCL: compile individual function to C, compile it with C to a .o (for example on my 32bit ARM it is a elf32-littlearm file) file and then load it:

    >(defun foo (a) (* a 42)) 

    FOO

    >(compile 'foo)

    Compiling /tmp/gazonk_24158_0.lsp.
    End of Pass 1.  
    End of Pass 2.  
    OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
    Finished compiling /tmp/gazonk_24158_0.lsp.
    Loading /tmp/gazonk_24158_0.o
    start address -T 0x888488 Finished loading /tmp/gazonk_24158_0.o
    #<compiled-function FOO>
    NIL
    NIL