4 ms·
Right now maybe you wouldn't, very much (though you should profile your code to see which performs better). But having a JIT written in Ruby potentially makes f
by sparker72678 4y ago
Right now maybe you wouldn't, very much (though you should profile your code to see which performs better). But having a JIT written in Ruby potentially makes further development on it more accessible to the community. We will see!
- weatherlight 4y agoseems strange, since most rubyist aren't compiler engineers. I feel like you'd still want to keep writing your compiler in Rust, and try to eek out your performance there. I'm still scratching my head, other than accessibility, Why Ruby over Rust. Note: I'm a Ruby dev, I don't know Rust. I've written few toy interpreters in Elixir and OCaml. This is my very limited understanding of compiler design, etc.
- sparker72678 4y agoI think you could say yjit fills that role; in any case, having multiple active jit projects leaves open a lot of room for experimentation. In the end, you might be right and rjit will fade away — we will see!
- simlevesque 4y ago> most rubyist aren't compiler engineers. You could say that about any language.
- weatherlight 4y agoCan you say that about Standard ML? theres traditionally certain langs with particular ergonomics that lend them self to this kinda work. Like having (parser, lexer libs as apart of the lang's stdlib) Rust's ADT seem particularly useful in this context. it really makes refactoring a breeze. (OCaml has a similar type system.) Your point is generally true though.
- ColonelPhantom 4y agoWhat if you turn it around? "Most compiler engineers aren't Rubyists." I don't know if that's true or not, but I imagine most compiler engineers tend to be more engrossed in languages like *ML, Rust, or Haskell. Or languages that are common in general, like C++ or Python. Ruby isn't that popular (outside of the Rails niche at least?), and it doesn't fit very well in a compiler niche either, I think.
- greenpeas 4y agoBut why would a compiler engineer that's not familiar with Ruby work on Ruby? They have so many other languages to choose from. I don't necessarily think that writing a JIT in Ruby is a good strategy to attract people to work on it, but if you are going to attract compiler people, you most likely want those who are also Rubyists.
- JonChesterfield 4y agoSpeaking mostly for myself, at least some compiler engineers like difficult source or target languages. The very dynamic ones are difficult to compile efficiently and thus more interesting than some alternatives. Plus Ruby hasn't had the attention paid to it that JavaScript has so the design space is closer to greenfield. I can see the attraction.
- sudhirj 4y agoUsing a JIT seems different from creating a JIT, though, and doesn't seem to require compiler engineers. From what I understand this converts Ruby code directly into C object code? Or does it transpile to C and then compile it? Either way, transpiling doesn't seem as complicated as compiling.
- pjmlp 4y agoThe JIT being replaced did that, this one compiles directly to machine code.
- chillfox 4y agoThere's benefits to be had for the average developer from being able to easily read the compiler/jit/vm code of their language. I write Crystal code and the fact that the Crystal compiler is written in Crystal allows me to make my code better/faster by taking a peak into the compiler code occasionally to see how things are done without having to get good at another language.