Tom Enebo and I are putting together our JRuby presentation for RubyConf, and there's just too much stuff to fit into 45 minutes. So what areas would people most like to hear about?
- Rails (or Merb, Rack, etc) deployment
- Performance
- Java integration (calling Java libraries)
- FFI
- Ruby 1.9 support
- General compatibility
- How to help or contribute
- Technical/implementation details
- GUI development (there's also a MonkeyBars talk already)
- Graphics/game development
Others?
Hopefully the talks will be recorded as well, so those of you not at RubyConf can see it too.
Tom Enebo and I are putting together our JRuby presentation for RubyConf, and there's just too much stuff to fit into 45 minutes. So what areas would people most like to hear about?
- Rails (or Merb, Rack, etc) deployment
- Performance
- Java integration (calling Java libraries)
- FFI
- Ruby 1.9 support
- General compatibility
- How to help or contribute
- Technical/implementation details
- GUI development (there's also a MonkeyBars talk already)
- Graphics/game development
Others?
Applets?
- are applets supported? work OK or problematic?
- what's the minimum or typical jar file size to get a reasonable jruby runtime in an applet?
Thanks!
Bill
···
From: "Charles Oliver Nutter" <charles.nutter@sun.com>
Tom Enebo and I are putting together our JRuby presentation for
RubyConf, and there's just too much stuff to fit into 45 minutes. So
what areas would people most like to hear about?
I'd like a few examples of embedding Ruby into JEE - Ola Binis book had some
stuff on writing an EJB in Ruby for example, I've seen OpenESB demos
with JRuby scripts
as objects in the workflow, etc.
The Net is full of Rails+AR+MySQL+Jruby walkthroughs, but I'm trying
to write a JRuby MBean
(so i can run Ruby code when my cluster changes state)
and Google is looking back at me pretty blankly, I can tell you
···
On Tue, Nov 4, 2008 at 8:51 PM, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
Tom Enebo and I are putting together our JRuby presentation for RubyConf,
and there's just too much stuff to fit into 45 minutes. So what areas would
people most like to hear about?
- Rails (or Merb, Rack, etc) deployment
- Performance
- Java integration (calling Java libraries)
- FFI
- Ruby 1.9 support
- General compatibility
- How to help or contribute
- Technical/implementation details
- GUI development (there's also a MonkeyBars talk already)
- Graphics/game development
Tom Enebo and I are putting together our JRuby presentation for
RubyConf, and there's just too much stuff to fit into 45 minutes. So
what areas would people most like to hear about?
- Rails (or Merb, Rack, etc) deployment
- Performance
- Java integration (calling Java libraries)
- FFI
- Ruby 1.9 support
- General compatibility
- How to help or contribute
- Technical/implementation details
- GUI development (there's also a MonkeyBars talk already)
- Graphics/game development
Others?
Hopefully the talks will be recorded as well, so those of you not at
RubyConf can see it too.
- Charlie
···
On Nov 5, 2:51 am, Charles Oliver Nutter <charles.nut...@sun.com> wrote:
Applets?
- are applets supported? work OK or problematic?
- what's the minimum or typical jar file size to get a reasonable jruby runtime in an applet?
Yeah, good idea. How about mobile too? We get a lot of questions about whether JRuby could work on Android et al, and though we're not working on it it's most definitely possible. I figure we could cover the current state and possible future for both applets and mobile and give people the step-by-step needed to make either work.
I'd like a few examples of embedding Ruby into JEE - Ola Binis book had some
stuff on writing an EJB in Ruby for example, I've seen OpenESB demos
with JRuby scripts
as objects in the workflow, etc.
The Net is full of Rails+AR+MySQL+Jruby walkthroughs, but I'm trying
to write a JRuby MBean
(so i can run Ruby code when my cluster changes state)
and Google is looking back at me pretty blankly, I can tell you
There's actually some work going on in the GlassFish team to make Ruby a first-class citizen of the Java EE world, so you could actually just define an MDB in Ruby or a Sesion Bean in Ruby and it would wire all that up. As painful and ugly as that sounds...we've seen other APIs become actually pretty nice with a little Ruby sprinkled on them, and it's an obvious way to start using it in an existing EE company.
For the moment though, we really just need to iron out the embedding story. Three or four different APIs, all slightly different, all with their own compatibility and migration stories. Not the best state of affairs.
So far here's what we're hoping to show at RubyConf this year, if
we're accepted:
* Android support in JRuby
* "Real" Java class support, enabling things like Hibernate
* 2D and 3D games and game libraries
* Desktop app development using various frameworks
* Cloud deployments a la GAE and EY Cloud
* Maybe a quick feature roundup, including FFI, 1.9 support, etc
* New, cooler Java scripting demonstrations, like the MIDI library stuff
* New compiler work for better Java integration and improved performance
* Integration with other JVM languages like Clojure and Scala
* Roundup of new JRuby users in the last year
There's too much to cover...so feel free to cast a vote here if
there's specific things you'd really like to hear about.
Applets?
- are applets supported? work OK or problematic?
- what's the minimum or typical jar file size to get a reasonable jruby runtime in an applet?
Yeah, good idea. How about mobile too? We get a lot of questions about whether JRuby could work on Android et al, and though we're not working on it it's most definitely possible. I figure we could cover the current state and possible future for both applets and mobile and give people the step-by-step needed to make either work.
So much stuff we could include.
Indeed. I'd like to hear more about JRuby on the Web for non-Rails apps. (I've been hacking around getting a straight-up Rack app up running on Glassfish via Warbler, and want to do the same for a Ramaze project; if there are others at RubyConf in the same boat give a yell, we can swap war (ha ha!) stories.)
That sounds rather cool - do you have any pointers to more information?
I've actually chosen to get into J2EE for a new project based on the
ability to deploy both a Rails app and a JRuby MDB using the same app
together in Glassfish, and while it wasn't that difficult (even for
this EE newb), it's far from just writing some Ruby. If there was
something like the equivalent of Warbler for beans, that would be
ideal.
Chris.
···
On Tue, Nov 18, 2008 at 1:53 PM, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
There's actually some work going on in the GlassFish team to make Ruby a
first-class citizen of the Java EE world, so you could actually just define
an MDB in Ruby or a Sesion Bean in Ruby and it would wire all that up. As
painful and ugly as that sounds...we've seen other APIs become actually
pretty nice with a little Ruby sprinkled on them, and it's an obvious way to
start using it in an existing EE company.
Indeed. I'd like to hear more about JRuby on the Web for non-Rails apps. (I've been hacking around getting a straight-up Rack app up running on Glassfish via Warbler, and want to do the same for a Ramaze project; if there are others at RubyConf in the same boat give a yell, we can swap war (ha ha!) stories.)
Maybe there's enough interest in JRuby practicalities that we should try to pull together a hackfest and/or BOF? As I understand it there's going to be a lot of available rooms for that kind of thing. Anyone know how BOFs and breakout rooms will be scheduled?
That sounds rather cool - do you have any pointers to more information?
I've actually chosen to get into J2EE for a new project based on the
ability to deploy both a Rails app and a JRuby MDB using the same app
together in Glassfish, and while it wasn't that difficult (even for
this EE newb), it's far from just writing some Ruby. If there was
something like the equivalent of Warbler for beans, that would be
ideal.
Ahh, yeah, a "Beaner" or something to package up Ruby + JRuby for EE stuff. That's a good idea.
I don't have a link to it, since it's more internal discussion at this point. Asking on JRuby mailing list would probably produce some discussion. I believe the idea is that you would just be able to configure a Ruby script or class as the MDB, for example, and GF would know how to spin up JRuby and get at it. Sorta like how Spring can wire in Ruby components (though Spring still ships JRuby 1.0ish, now basically EOLed).
I am very interested in rack app deployment to non-glassfish environmets. JBoss, Tomcat, etc. I am setting up vm's to test with locally, but it's an uphill battle for me.
···
On 2008-11-04 19:58:22 -0500, James Britt <james.britt@gmail.com> said:
Charles Oliver Nutter wrote:
Bill Kelly wrote:
Applets?
- are applets supported? work OK or problematic?
- what's the minimum or typical jar file size to get a reasonable
jruby runtime in an applet?
Yeah, good idea. How about mobile too? We get a lot of questions about
whether JRuby could work on Android et al, and though we're not working
on it it's most definitely possible. I figure we could cover the current
state and possible future for both applets and mobile and give people
the step-by-step needed to make either work.
So much stuff we could include.
Indeed. I'd like to hear more about JRuby on the Web for non-Rails
apps. (I've been hacking around getting a straight-up Rack app up
running on Glassfish via Warbler, and want to do the same for a Ramaze
project; if there are others at RubyConf in the same boat give a yell,
we can swap war (ha ha!) stories.)
Indeed. I'd like to hear more about JRuby on the Web for non-Rails apps. (I've been hacking around getting a straight-up Rack app up running on Glassfish via Warbler, and want to do the same for a Ramaze project; if there are others at RubyConf in the same boat give a yell, we can swap war (ha ha!) stories.)
Maybe there's enough interest in JRuby practicalities that we should try to pull together a hackfest and/or BOF?
That'd work. I plan on hacking on Wiimote-driven Monkeybars app (excited that I just picked up a very nice wireless IR sensor bar).
I would greatly appreciate some general overview of the internals. Are
ruby files compiled into bytecode and then executed or java is invoked
to execute code line by line. If the first option is possible how do
you handle dynamic typing issues. Are any code optimizations applied
to ruby code?
Thanks
···
On Nov 19, 10:58 am, Charles Oliver Nutter <charles.nut...@sun.com> wrote:
Chris Andrews wrote:
> That sounds rather cool - do you have any pointers to more information?
> I've actually chosen to get into J2EE for a new project based on the
> ability to deploy both a Rails app and a JRuby MDB using the same app
> together in Glassfish, and while it wasn't that difficult (even for
> this EE newb), it's far from just writing some Ruby. If there was
> something like the equivalent of Warbler for beans, that would be
> ideal.
Ahh, yeah, a "Beaner" or something to package up Ruby + JRuby for EE
stuff. That's a good idea.
I don't have a link to it, since it's more internal discussion at this
point. Asking on JRuby mailing list would probably produce some
discussion. I believe the idea is that you would just be able to
configure a Ruby script or class as the MDB, for example, and GF would
know how to spin up JRuby and get at it. Sorta like how Spring can wire
in Ruby components (though Spring still ships JRuby 1.0ish, now
basically EOLed).
Oh, sorry. Rubyconf is over, I have not looked at the date of the
first message, shame on me
However I still will be grateful for the useful resources on this
topic. And looking forward for the presentation to be published
somewhere.
···
On Nov 19, 2:31 pm, Maksim Ananjev <maksim.anan...@gmail.com> wrote:
I would greatly appreciate some general overview of the internals. Are
ruby files compiled into bytecode and then executed or java is invoked
to execute code line by line. If the first option is possible how do
you handle dynamic typing issues. Are any code optimizations applied
to ruby code?
Thanks
On Nov 19, 10:58 am, Charles Oliver Nutter <charles.nut...@sun.com> > wrote:
> Chris Andrews wrote:
> > That sounds rather cool - do you have any pointers to more information?
> > I've actually chosen to get into J2EE for a new project based on the
> > ability to deploy both a Rails app and a JRuby MDB using the same app
> > together in Glassfish, and while it wasn't that difficult (even for
> > this EE newb), it's far from just writing some Ruby. If there was
> > something like the equivalent of Warbler for beans, that would be
> > ideal.
> Ahh, yeah, a "Beaner" or something to package up Ruby + JRuby for EE
> stuff. That's a good idea.
> I don't have a link to it, since it's more internal discussion at this
> point. Asking on JRuby mailing list would probably produce some
> discussion. I believe the idea is that you would just be able to
> configure a Ruby script or class as the MDB, for example, and GF would
> know how to spin up JRuby and get at it. Sorta like how Spring can wire
> in Ruby components (though Spring still ships JRuby 1.0ish, now
> basically EOLed).
Oh, sorry. Rubyconf is over, I have not looked at the date of the
first message, shame on me
However I still will be grateful for the useful resources on this
topic. And looking forward for the presentation to be published
somewhere.
···
On Nov 19, 2:31 pm, Maksim Ananjev <maksim.anan...@gmail.com> wrote:
I would greatly appreciate some general overview of the internals. Are
ruby files compiled into bytecode and then executed or java is invoked
to execute code line by line. If the first option is possible how do
you handle dynamic typing issues. Are any code optimizations applied
to ruby code?
Thanks
On Nov 19, 10:58 am, Charles Oliver Nutter <charles.nut...@sun.com> > wrote:
> Chris Andrews wrote:
> > That sounds rather cool - do you have any pointers to more information?
> > I've actually chosen to get into J2EE for a new project based on the
> > ability to deploy both a Rails app and a JRuby MDB using the same app
> > together in Glassfish, and while it wasn't that difficult (even for
> > this EE newb), it's far from just writing some Ruby. If there was
> > something like the equivalent of Warbler for beans, that would be
> > ideal.
> Ahh, yeah, a "Beaner" or something to package up Ruby + JRuby for EE
> stuff. That's a good idea.
> I don't have a link to it, since it's more internal discussion at this
> point. Asking on JRuby mailing list would probably produce some
> discussion. I believe the idea is that you would just be able to
> configure a Ruby script or class as the MDB, for example, and GF would
> know how to spin up JRuby and get at it. Sorta like how Spring can wire
> in Ruby components (though Spring still ships JRuby 1.0ish, now
> basically EOLed).
Oh, sorry. Rubyconf is over, I have not looked at the date of the
first message, shame on me
However I still will be grateful for the useful resources on this
topic. And looking forward for the presentation to be published
somewhere.
No problem The talk should be published soon, but I can answer this question here too.
I would greatly appreciate some general overview of the internals. Are
ruby files compiled into bytecode and then executed or java is invoked
to execute code line by line. If the first option is possible how do
you handle dynamic typing issues. Are any code optimizations applied
to ruby code?
JRuby is a mixed-mode implementation. We have both an interpreter that walks the Ruby AST, just like Ruby 1.8 (though quite a bit faster), and a compiler that turns Ruby into JVM bytecode. You can run all interpreted, all compiled, or allow us to compile code just-in-time (JIT) as the application runs. You can also compile all code ahead-of-time (AOT) and ship .class files.
The compiled bytecode, however, is not exactly like a typical Java class. Because Ruby's class structures are very fluid, we do not (can not) present a normal Java type. So the compilation is solely to create "bytecode chunks" that will be executed independently as method, block, and class bodies. The .class that results from AOT compilation is basically just a "blob of methods" that are wired up at runtime into Ruby code bodies.
Is that clear?
Here's an example of the methods that result from compiling a very simple script into a .class. The name mangling shows that we're using these simply as blobs of bytecode:
[headius @ cnutter:~/projects/jruby]
$ cat foo.rb
class Foo
def bar
baz { }
end
end
[headius @ cnutter:~/projects/jruby]
$ javap foo
Compiled from "foo.rb"
public class foo extends org.jruby.ast.executable.AbstractScript{
public foo();
public static {};
public IRubyObject __file__(...);
public IRubyObject class_0$RUBY$Foo(...);
public IRubyObject method__1$RUBY$bar(...);
public IRubyObject block_0$RUBY$__block__(...);
public IRubyObject method__1$RUBY$bar(...);
public IRubyObject class_0$RUBY$Foo(...);
public IRubyObject __file__(...);
public IRubyObject load(...);
public static void main(java.lang.String);
}
The __file__ methods correspond to the body of the script. The two class_0$RUBY$Foo methods represent the class body. The method__1$RUBY$bar methods are the body of the "bar" method. The block_0$RUBY$__block__ method is the body of the block. And finally the load and main methods are used for loading this script as a library (via require or load) and for executing it as a normal Java "main", respectively.
Generally, you don't need to know about any of this to get the benefit of JIT or AOT compilation in JRuby.
- Charlie
···
On Nov 19, 2:31 pm, Maksim Ananjev <maksim.anan...@gmail.com> wrote:
Hey Charles, I often find myself writing jruby scripts in java just for the code completion on the larger java packages I work with.
Do you think netbeans will support java-library code completion for jruby at some point? Thanks and hope this isn't off topic.
···
On Nov 19, 2008, at 7:57 AM, Charles Oliver Nutter <charles.nutter@sun.com > wrote:
Maksim Ananjev wrote:
Oh, sorry. Rubyconf is over, I have not looked at the date of the
first message, shame on me
However I still will be grateful for the useful resources on this
topic. And looking forward for the presentation to be published
somewhere.
No problem The talk should be published soon, but I can answer this question here too.
On Nov 19, 2:31 pm, Maksim Ananjev <maksim.anan...@gmail.com> wrote:
I would greatly appreciate some general overview of the internals. Are
ruby files compiled into bytecode and then executed or java is invoked
to execute code line by line. If the first option is possible how do
you handle dynamic typing issues. Are any code optimizations applied
to ruby code?
JRuby is a mixed-mode implementation. We have both an interpreter that walks the Ruby AST, just like Ruby 1.8 (though quite a bit faster), and a compiler that turns Ruby into JVM bytecode. You can run all interpreted, all compiled, or allow us to compile code just-in-time (JIT) as the application runs. You can also compile all code ahead-of-time (AOT) and ship .class files.
The compiled bytecode, however, is not exactly like a typical Java class. Because Ruby's class structures are very fluid, we do not (can not) present a normal Java type. So the compilation is solely to create "bytecode chunks" that will be executed independently as method, block, and class bodies. The .class that results from AOT compilation is basically just a "blob of methods" that are wired up at runtime into Ruby code bodies.
Is that clear?
Here's an example of the methods that result from compiling a very simple script into a .class. The name mangling shows that we're using these simply as blobs of bytecode:
[headius @ cnutter:~/projects/jruby]
$ cat foo.rb
class Foo
def bar
baz { }
end
end
[headius @ cnutter:~/projects/jruby]
$ javap foo
Compiled from "foo.rb"
public class foo extends org.jruby.ast.executable.AbstractScript{
public foo();
public static {};
public IRubyObject __file__(...);
public IRubyObject class_0$RUBY$Foo(...);
public IRubyObject method__1$RUBY$bar(...);
public IRubyObject block_0$RUBY$__block__(...);
public IRubyObject method__1$RUBY$bar(...);
public IRubyObject class_0$RUBY$Foo(...);
public IRubyObject __file__(...);
public IRubyObject load(...);
public static void main(java.lang.String);
}
The __file__ methods correspond to the body of the script. The two class_0$RUBY$Foo methods represent the class body. The method__1$RUBY$bar methods are the body of the "bar" method. The block_0$RUBY$__block__ method is the body of the block. And finally the load and main methods are used for loading this script as a library (via require or load) and for executing it as a normal Java "main", respectively.
Generally, you don't need to know about any of this to get the benefit of JIT or AOT compilation in JRuby.