Hacker News new | past | comments | ask | show | jobs | submit login
Ruby 2.6 introduces an initial implementation of JIT compiler (ruby-lang.org)
49 points by whizzkid on Dec 13, 2018 | hide | past | favorite | 5 comments

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

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

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

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.

is Vladimir still working on Ruby?

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