News for hackers. Stuff that matters.
Re:TruffleRuby Status by miloshadzic on Saturday January 14, 2017 @12:48PM (#13399529)
Re: the C extensions: Since the performance is so much better, would it make sense to replace gems that use c extensions with pure ruby implementations? Would that still yield better performance than MRI?
Re:TruffleRuby Status by chrisseaton on Saturday January 14, 2017 @01:12PM (#13399673)
> would it make sense to replace gems that use c extensions with pure ruby implementations

I think that the best practice for C extensions when used for performance is that Gems have both a pure Ruby reference implementation and a C extension. This means all implementations can run them and more people can read the code. OilyPNG and PSD Native do this and it's been extremely helpful to my research.

C extensions, even when run in our interpreter, tend to run faster than Ruby code because C has simpler semantics and needs fewer guards (checks) when running code.

I haven't done a careful comparison of C extension performance compared to Ruby performance when both are running on Graal. I should do that.

Re:TruffleRuby Status by miloshadzic on Saturday January 14, 2017 @06:25PM (#13401249)
Thanks
Re:TruffleRuby Status by ianopolous on Saturday January 14, 2017 @01:08PM (#13399656)
It's not clear that would result in a speed up as graal + truffle can already do optimisations across language boundaries. So optimising a Ruby function that calls a C one can for example inline the C function and then continue optimising.
Re:TruffleRuby Status by nine_k on Saturday January 14, 2017 @01:45PM (#13399851)
Any chance to use existing Java libs instead of C libs?

Pure Java is pretty fast, and an existing library has the advantage of not just already being around, but probably being battle-tested.

Re:TruffleRuby Status by amorphid on Saturday January 14, 2017 @05:43PM (#13401020)
There's nothing that prevents that. However, Ruby is traditionally thought of as a language written in C, and the gold standard for a Ruby interpreter to be 100% compatible with anything that runs on MRI. So writing JVM specific extensions means losing MRI compatibly, at which point you're deviating from tradition.
Re:TruffleRuby Status by computerwizard on Saturday January 14, 2017 @03:08PM (#13400281)
What about using Mirah ( http://www.mirah.org/ )? Performance should be the same as Java.