News for hackers. Stuff that matters.
Re:RubyFlux: a Ruby to Java compiler by miles_matthias on Friday December 28, 2012 @06:37PM (#4980187)
Could someone explain why this is needed?

I don't understand why someone wouldn't just write Java if they wanted to write Java.

I also don't understand why anyone would want generated code. The unnecessary abstraction leaves you less expressive and with less control.

Not trying to be a troll here, just hoping to learn something I'm missing.

Re:RubyFlux: a Ruby to Java compiler by scott_s on Friday December 28, 2012 @07:43PM (#4980426)
It may not be needed. The author may just have done it because they could, and thought it was neat.

But the potential reasons for wanting it is that now the runtime is the JVM, MRI (Matz's Ruby interpreter). JRuby accomplishes using the JVM as the runtime for Ruby by reimplementing the Ruby runtime in Java. This is a different approach, one in which Ruby code is compiled to Java code, rather than using Java runtime interpret Ruby code.

Re:RubyFlux: a Ruby to Java compiler by amalter on Friday December 28, 2012 @07:07PM (#4980291)
This could be useful for someone wanting to whip up some Android code in Ruby, but not wanting to import the full JRuby or Ruby NDK overhead.

I bet it's mostly for fun. He essentially extracted his JRuby JIT into a conventional compiler.

In other words, a neat hack.

Re:RubyFlux: a Ruby to Java compiler by rst on Friday December 28, 2012 @08:08PM (#4980511)
All the more so because current "jruby-on-Android" has performance problems. This hits particularly hard on startup (where a simple app can take several seconds to get past a splash page; see http://ruboto-startup.heroku.com/measurements for timing). But even once the app gets running, things still drag compared to a conventional JVM because the JIT doesn't work (due to Android's nonstandard Dalvik bytecodes).

If rubyflux winds up bypassing most of this overhead, it could be a major win. (Right now, I've got a project to try to use Scala to try to build a full-featured, reduced-boilerplate Android environment here: http://rst.github.com/positronic_docs.html --- but I'd really rather be using Ruby if the performance penalties could be ironed out.)

Re:RubyFlux: a Ruby to Java compiler by yareally on Friday December 28, 2012 @08:40PM (#4980621)
Definitely with Android. Lots of people want to make Android apps, but a decent percentage do not want to use Java. I prefer Mono for Android as a native alternative, but this could be nice for those that want to use a more dynamic language than C# or F# (Mono for Android does not have real support for dynamic languages due to limitations imposed by the Dalvik VM).
Re:RubyFlux: a Ruby to Java compiler by pit on Friday December 28, 2012 @07:01PM (#4980271)
Weirdly, I was wondering about the existence of something like this about 20 minutes ago. I'm using Grails for work, and it's pretty unpleasant. I don't want to write Groovy, but I have to write Groovy.
Re:RubyFlux: a Ruby to Java compiler by bascule on Saturday December 29, 2012 @01:38PM (#4982935)
You're essentially asking why someone would write a compiler. Why wouldn't someone consume target language X directly instead of using a compiler to generate output in target language X. We want our programs to wind up as machine language, so why not write opcodes for the host ISA instead of writing in, say, any other language?
Re:RubyFlux: a Ruby to Java compiler by zem on Friday December 28, 2012 @07:14PM (#4980313)
there are a lot of people who want to have java written, but don't want to write java. this way you might get less control, but you get the greater expressiveness of ruby.