# What would you like to know about JRuby?

**URL:** <https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006>\
**Category:** ruby-talk\
**Created:** [4 November 2008 20:51 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006 "2008-11-04T20:51:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles\_Oliver\_Nutte](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@Charles\_Oliver\_Nutte](https://rubytalk.org/u/Charles_Oliver_Nutte)\
**Post date:** [4 November 2008 20:51 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/1 "2008-11-04T20:51:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bill\_Kelly](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bill\_Kelly](https://rubytalk.org/u/Bill_Kelly)\
**Post date:** [4 November 2008 21:17 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/2 "2008-11-04T21:17:27Z")

</div>

> 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?  
&nbsp;&nbsp;- are applets supported? work OK or problematic?  
&nbsp;&nbsp;- 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\>

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [5 November 2008 23:59 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/3 "2008-11-05T23:59:19Z")

</div>

Charles Oliver Nutter 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?

I won't be there but android support 🙂  
-=R

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Dick\_Davies1](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@Dick\_Davies1](https://rubytalk.org/u/Dick_Davies1)\
**Post date:** [18 November 2008 13:24 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/4 "2008-11-18T13:24:49Z")

</div>

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
> > 
> > Others?

---

<div class="post-metadata">

**Author:** ![Maksim\_Ananjev](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@Maksim\_Ananjev](https://rubytalk.org/u/Maksim_Ananjev)\
**Post date:** [19 November 2008 08:26 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/5 "2008-11-19T08:26:23Z")

</div>

> 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:

---

<div class="post-metadata">

**Author:** ![Nick\_Brown](https://avatars.discourse-cdn.com/v4/letter/n/49beb7/32.png) [@Nick\_Brown](https://rubytalk.org/u/Nick_Brown)\
**Post date:** [20 August 2009 02:43 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/6 "2009-08-20T02:43:52Z")

</div>

I would be interested in hearing about JRuby on Google App Engine.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Charles\_Oliver\_Nutte](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@Charles\_Oliver\_Nutte](https://rubytalk.org/u/Charles_Oliver_Nutte)\
**Post date:** [4 November 2008 22:24 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/7 "2008-11-04T22:24:22Z")

</div>

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.

- Charlie

---

<div class="post-metadata">

**Author:** ![Charles\_Oliver\_Nutte](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@Charles\_Oliver\_Nutte](https://rubytalk.org/u/Charles_Oliver_Nutte)\
**Post date:** [18 November 2008 13:53 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/8 "2008-11-18T13:53:30Z")

</div>

Dick Davies wrote:

> 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.

- Charlie

---

<div class="post-metadata">

**Author:** ![Charles\_Nutter](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/charles_nutter/32/2567_2.png) [@Charles\_Nutter](https://rubytalk.org/u/Charles_Nutter)\
**Post date:** [20 August 2009 06:24 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/9 "2009-08-20T06:24:00Z")

</div>

I love that this thread is revived a year later 🙂

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.

- Charlie

---

<div class="post-metadata">

**Author:** ![James\_Britt3](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@James\_Britt3](https://rubytalk.org/u/James_Britt3)\
**Post date:** [5 November 2008 00:58 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/10 "2008-11-05T00:58:22Z")

</div>

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.)

> **···**
>
> --  
> James Britt
> 
> [www.happycamperstudios.com](http://www.happycamperstudios.com) - Wicked Cool Coding  
> [www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
> [www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
> [www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff

---

<div class="post-metadata">

**Author:** ![Chris\_Andrews1](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Chris\_Andrews1](https://rubytalk.org/u/Chris_Andrews1)\
**Post date:** [18 November 2008 23:17 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/11 "2008-11-18T23:17:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Charles\_Oliver\_Nutte](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@Charles\_Oliver\_Nutte](https://rubytalk.org/u/Charles_Oliver_Nutte)\
**Post date:** [5 November 2008 01:26 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/12 "2008-11-05T01:26:25Z")

</div>

James Britt wrote:

> 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?

- Charlie

---

<div class="post-metadata">

**Author:** ![Charles\_Oliver\_Nutte](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@Charles\_Oliver\_Nutte](https://rubytalk.org/u/Charles_Oliver_Nutte)\
**Post date:** [19 November 2008 04:58 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/13 "2008-11-19T04:58:15Z")

</div>

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).

- Charlie

---

<div class="post-metadata">

**Author:** ![Nathan1](https://avatars.discourse-cdn.com/v4/letter/n/8baadc/32.png) [@Nathan1](https://rubytalk.org/u/Nathan1)\
**Post date:** [19 August 2009 22:30 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/14 "2009-08-19T22:30:07Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![James\_Britt3](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@James\_Britt3](https://rubytalk.org/u/James_Britt3)\
**Post date:** [5 November 2008 05:55 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/15 "2008-11-05T05:55:06Z")

</div>

Charles Oliver Nutter wrote:

> James Britt wrote:
> 
> > 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).

> **···**
>
> --  
> James Britt
> 
> [www.happycamperstudios.com](http://www.happycamperstudios.com) - Wicked Cool Coding  
> [www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
> [www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
> [www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff

---

<div class="post-metadata">

**Author:** ![Maksim\_Ananjev](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@Maksim\_Ananjev](https://rubytalk.org/u/Maksim_Ananjev)\
**Post date:** [19 November 2008 08:31 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/16 "2008-11-19T08:31:21Z")

</div>

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).
> > 
> > - Charlie

---

<div class="post-metadata">

**Author:** ![Maksim\_Ananjev](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@Maksim\_Ananjev](https://rubytalk.org/u/Maksim_Ananjev)\
**Post date:** [19 November 2008 08:46 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/17 "2008-11-19T08:46:21Z")

</div>

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).
> > 
> > \> - Charlie

---

<div class="post-metadata">

**Author:** ![Maksim\_Ananjev](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@Maksim\_Ananjev](https://rubytalk.org/u/Maksim_Ananjev)\
**Post date:** [19 November 2008 08:46 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/18 "2008-11-19T08:46:25Z")

</div>

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).
> > 
> > \> - Charlie

---

<div class="post-metadata">

**Author:** ![Charles\_Oliver\_Nutte](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@Charles\_Oliver\_Nutte](https://rubytalk.org/u/Charles_Oliver_Nutte)\
**Post date:** [19 November 2008 12:57 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/19 "2008-11-19T12:57:34Z")

</div>

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.

> > 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  
&nbsp;&nbsp;&nbsp;def bar  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;baz { }  
&nbsp;&nbsp;&nbsp;end  
end  
[headius @ cnutter:~/projects/jruby]  
$ javap foo  
Compiled from "foo.rb"  
public class foo extends org.jruby.ast.executable.AbstractScript{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public foo();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public static {};  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject \_\_file\_\_(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject class\_0$RUBY$Foo(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject method\_\_1$RUBY$bar(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject block\_0$RUBY$\_\_block\_\_(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject method\_\_1$RUBY$bar(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject class\_0$RUBY$Foo(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject \_\_file\_\_(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public IRubyObject load(...);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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:

---

<div class="post-metadata">

**Author:** ![List.rb](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@List.rb](https://rubytalk.org/u/List.rb)\
**Post date:** [19 November 2008 19:41 UTC](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006/20 "2008-11-19T19:41:40Z")

</div>

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  
> > &nbsp;&nbsp;&nbsp;baz { }  
> > end  
> > end  
> > [headius @ cnutter:~/projects/jruby]  
> > $ javap foo  
> > Compiled from "foo.rb"  
> > public class foo extends org.jruby.ast.executable.AbstractScript{  
> > &nbsp;&nbsp;&nbsp;public foo();  
> > &nbsp;&nbsp;&nbsp;public static {};  
> > &nbsp;&nbsp;&nbsp;public IRubyObject \_\_file\_\_(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject class\_0$RUBY$Foo(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject method\_\_1$RUBY$bar(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject block\_0$RUBY$\_\_block\_\_(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject method\_\_1$RUBY$bar(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject class\_0$RUBY$Foo(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject \_\_file\_\_(...);  
> > &nbsp;&nbsp;&nbsp;public IRubyObject load(...);  
> > &nbsp;&nbsp;&nbsp;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

[Next page](https://rubytalk.org/t/what-would-you-like-to-know-about-jruby/50006.md?page=2)
