News for hackers. Stuff that matters.
Re:Rubinius 2.0 Preview Release by mitchty on Tuesday June 07, 2011 @11:33PM (#2631926)
For my needs, jruby will never suffice as java isn't going to be installed on the servers I'm on. Nor to be honest would I want it, and JNI for c extensions is also a nonstarter. We have puppet at work for server deploys, and well, jruby may suffice for web/app server deploys that just run rails. But not all ruby users actually give a rats about rails (that's me, don't use it at all at work), nor do we have a need for java interop. Basically I'm in the exact opposite of your vantage.

I need c bindings for a few gems I made that need c ffi bindings, I don't need/care/use any java interop, and personally, I'd rather not have the jvm running on any of my servers.

I look at rubinius as the eventual YARV for the compiled version as YARV was to MRI, not as an academic project. But I admit, I seem to be a ruby outlier ever since rails has been around.

Re:Rubinius 2.0 Preview Release by headius on Wednesday June 08, 2011 @04:44AM (#2632453)
Your reluctance to install Java on the servers you're on means you're missing out on one of the best Ruby implementations available. You'd be well served by putting aside your prejudice and just giving JRuby a try.

That said, there's certainly domains where JRuby is not a great fit. C extension-heavy systems are one; because C extensions are so crippling to more modern VMs like the JVM or Rubinius, you're better off using the implementation the C API was designed for (MRI). Or if Rubinius suits your needs and C extensions work well enough, I'll recommend Rubinius over JRuby any day. I hate C extensions, or at least I hate them in the form they exist in MRI, since they're invasive and damaging to modern VM features like good GC and concurrent threads.

In any case, it's worth seeing if FFI (the Ruby API that Rubinius pioneered and JRuby made generally available) serves your purposes, because it works extremely well in JRuby and requires no C extension support. And I'd suggest you actually give JRuby a try; it's so much more than "Ruby for Java interop" and may work better as a "plain old Ruby impl" than you expect.

Re:Rubinius 2.0 Preview Release by tptacek on Wednesday June 08, 2011 @01:05PM (#2633983)
I just used JRuby FFI to implement a native x86-64 debugger on WinAPI; we had x86 working for a long time on Win32, Linux, and OSX using MRI, and JRuby was actually the only way to get around LP64 issues with MRI. JRuby has been a compat and native code win for us; it is a better platform for accessing C code than MRI Ruby is.
Re:Rubinius 2.0 Preview Release by abrandoned on Wednesday June 08, 2011 @02:50PM (#2634489)
Huge fan of FFI (I use it to wrap/test all my shared libraries, mysql ext, etc..), but the problem of cross platform compilation still exists. I write a shared library and an FFI interface, but packaging it for use on Windows/*nix is still a pain (for compilation during install). Is there anything that solves for compilation across implementations and platforms? (FFI makes the interface simple after that)
Re:Rubinius 2.0 Preview Release by tptacek on Wednesday June 08, 2011 @03:08PM (#2634573)
I don't think we should have to sign up for coupling with a specific Ruby's runtime internals just to get cross-platform compilation of a shared library. For whatever it's worth, even autoconf can be made to work cross-platform.
Re:Rubinius 2.0 Preview Release by headius on Wednesday June 08, 2011 @06:39PM (#2635302)
Yeah, for that I don't have a solution. It seems like there ought to be a way to have FFI libraries bring along the lib they need and compile it right there, but portable C libs are still a bitch to manage across platforms no matter what you do. I hate to say it, but JVM libraries have a huge advantage here; most JRuby-specific libs that ship a jar file just work on any platform with no recompile and no portability issues. Hard to beat that :(
Re:Rubinius 2.0 Preview Release by headius on Wednesday June 08, 2011 @01:43PM (#2634161)
That's great to hear! Given that FFI is intended to work across all Ruby impls, I wish there were more attention paid to using FFI instead of C extensions. I will admit there are some usability problems, especially around cross-platform struct mapping, but the resulting libraries are vastly easier to deal with than a bunch of grotty Ruby C API code.
Re:Rubinius 2.0 Preview Release by enebo on Wednesday June 08, 2011 @01:43PM (#2634163)
We have had other JRuby users state that most 64 bit stuff just works with JRuby and not so much with MRI. Thanks for sharing another example.
Re:Rubinius 2.0 Preview Release by jvoorhis on Thursday June 09, 2011 @03:38PM (#2638502)
JRuby's FFI implementation is great, but I've had about as much success with MRI, so I test my FFI libs on MRI 1.8.7, 1.9.2 and the latest JRuby. I'm looking forward to the day when Rubinius' FFI converges with the other implementations.
Re:Rubinius 2.0 Preview Release by ssmoot on Tuesday June 07, 2011 @11:47PM (#2631948)
I don't use Rails. I see the JVM as a tool that gives me access to code I might find useful, and web-servers that are (IMO) 1000X superior to anything available to MRI. That and much better performance than REE anyways.

If you need C-extensions, well, there you go. Rubinius as a better MRI I totally get/agree with.

I think we agree on that as a good reason for the season for Rubinius.

It'd just be nice for EY to put up a "Why Rubinius?" page. And further, a "Which VM best targets my project? JRuby or Rubinius?" page would make me very happy. I can't imagine it could hurt the adoption of either.

Re:Rubinius 2.0 Preview Release by andrewvc on Wednesday June 08, 2011 @12:14AM (#2631993)
Jruby is working on cext support
Re:Rubinius 2.0 Preview Release by headius on Wednesday June 08, 2011 @04:38AM (#2632442)
C ext support shipped in an "experimental" form in JRuby 1.6. The main problem is that C extensions suck in so many ways:

* Can't have multiple VMs in process, because C exts load all their state into C globals * Can't run them concurrently, because they can't be trusted not to segfault * Don't participate well in modern GCs, so they have significantly higher call overhead in JRuby or Rubinius than they do in MRI

FFI is a better option in almost every case, although it is admittedly a much trickier path to cross-platform library binding. The best thing the Ruby community could do to move Ruby forward is to either come up with a better C API or start using FFI for everything. C exts suck.