
Ruby 2.6 introduces an initial implementation of JIT compiler - whizzkid
https://www.ruby-lang.org/en/news/2018/12/06/ruby-2-6-0-rc1-released/
======
pmontra
> The main purpose of this JIT release is to provide a chance to check if it
> works for your platform and to find out security risks before the 2.6
> release.

Generating the C source code probably helps finding bugs.

------
yoklov
> Ruby’s JIT compiler does JIT compilation in a unique way, which prints C
> code to a disk and spawns common C compiler process to generate native code

Well, uh, that _is_ one way to do it...

~~~
lifthrasiir
There are some convincing rationales [1]. In short, they chose to trade-off
warm-up time and (probably) base line performance for implementation
complexity and peak performance after warming up. I'm pretty much amazed that
this idea does seem to work somehow.

[1]
[https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#a-few...](https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#a-few-
possible-approaches-in-jit-implementation)

~~~
rurban
For sure it works, because it's the most primitive hack one can think of. But
it doesn't scale when the filesystem locking gets in your way, esp. on slow
systems. In Perl we did something similar with an embedded tcc, but then
eventually switched to emit machine-code directly to memory, or using llvm
with linked bitcode, as later done in postgresql.

Shame that his stack branch also got turned down, because this was more
important.

