Forum: Ruby JRuby on Java ME

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-02-27 11:25
(Received via mailing list)
Another one several of you have asked about...JRuby running on Java ME:

http://gist.github.com/71393

This is using Sun's reference implementation "cvm" with the CDC
(Connected Device Configuration) and the PBP (Personal Basis Profile)
set of classes. It's basically the same as what you'd have on a Java
ME-enabled phone or embedded device supporting the same level of APIs.

PBP is available here, for Linux only. I'm not sure whether it's been
open-sourced yet or not, but I thought it was planned:

http://java.sun.com/javame/downloads/index.jsp

The project is hosted here:

http://github.com/headius/jruby-cdc/tree/master

It's essentially JRuby 1.2 forked and stripped of libraries and code
that aren't supported in CDC. My intention with this is to get it
running with a base set of Ruby classes but with Java integration still
functional. That will allow most basic Ruby scripts to work while
providing access to the rest of the Java APIs for bits I had to rip out.

It's only running interpreted right now, just like the Android version
of JRuby, but as in that case I expect most people would want to
precompile Ruby code and ship it all as one unit.

I think there are many other possible ways we could repurpose JRuby like
this; it really only took me a couple days of trimming to get this far.
Android will take far less time, and other "mini ruby" profiles might be
possible for other platforms as well.

Questions, comments, patches welcome :)

- Charlie
324ce80d9dbe9417607192038fb880bf?d=identicon&s=25 Andrew S. Townley (Guest)
on 2009-02-27 12:01
(Received via mailing list)
Hi Charlie,

That's great news!  I was wondering about this again since I saw the
post about JRuby on Android.  I've been trying to figure out the best
way to get Ruby on my Windows mobile phone so I could do some quick
scripting without needing to go through the compile process for either
J2ME or WinMobile/.NET CF, because I don't have those set up at the
moment.

Looks like this may be just the thing I need to test a couple of things.

Cheers,

ast
6e366eb5a71be2bad7f383d42aeb4788?d=identicon&s=25 Justin Collins (Guest)
on 2009-02-27 22:12
(Received via mailing list)
Charles Oliver Nutter wrote:
> open-sourced yet or not, but I thought it was planned:
> still functional. That will allow most basic Ruby scripts to work
> profiles might be possible for other platforms as well.
>
> Questions, comments, patches welcome :)
>
> - Charlie
>

This would be awesome!
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2009-03-05 23:39
(Received via mailing list)
From: "Charles Oliver Nutter" <charles.nutter@sun.com>
>
> I think there are many other possible ways we could repurpose JRuby like
> this; it really only took me a couple days of trimming to get this far.
> Android will take far less time, and other "mini ruby" profiles might be
> possible for other platforms as well.

This idea of a stripped-down JRuby running precompiled Ruby code,
still able to access Java APIs sounds ideal for applets.

Do you think it would be a lot of work to target one of these "mini
rubys"
for applets?

This gentleman currently has an OpenGL / JRuby applet proof of
concept -- but has he points out, the complete JRuby jar is large
and implies a lengthy download:

http://sikanrong.com/blog/jruby_applet__opengl_run...

I think it would be awesome to have a compact JRuby runtime for
use in applets.  I don't see requiring the ruby code to be precompiled
to be a problem at all.  (Perhaps even a benefit.)


Regards,

Bill
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-03-06 01:11
(Received via mailing list)
Bill Kelly wrote:
> This idea of a stripped-down JRuby running precompiled Ruby code,
> still able to access Java APIs sounds ideal for applets.
>
> Do you think it would be a lot of work to target one of these "mini rubys"
> for applets?

Yes, and I have applets firmly in mind as I start thinking about
modularizing/stripping/shrinking JRuby. Applets are a little less
restrictive than either JavaME or Android, since we'll have a "full"
Java impl, but we still need to make things more modular and make it
easier to ship only what you need. I suspect the same logic will apply
equally to applet and Android deployments (jruby-cdc is a separate fork
for JavaME that will live a life of its own).

- Charlie
7067095abfc198a023c3a9b5e31e67ea?d=identicon&s=25 Peter Booth (peterbooth)
on 2009-03-06 03:21
(Received via mailing list)
Bill,

What would be the "sweet spot" for applets?

I acknowledge my prejudice, reluctantly accepting that memories of
ancient rants about "craplets" are not just a bad dream.

Peter Booth
(917) 445 5663 peter_booth@mac.com
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2009-03-06 05:25
(Received via mailing list)
Peter,

From: "Peter Booth" <pbooth@nocoincidences.com>
>
> What would be the "sweet spot" for applets?
>
> I acknowledge my prejudice, reluctantly accepting that memories of
> ancient rants about "craplets" are not just a bad dream.

For me, I'm interested in hardware accelerated 2D and 3D
graphics.

Although I'm impressed with what people are accomplishing
with dynamic HTML and JavaScript these days, most of the
best web applications still feel clunky to me.

Recently, it has become possible to write applets that
make use of both 2D and 3D hardware accelerated graphics,
which run in modern browers on windows, linux, and OS X.

2D example:
https://jdk6.dev.java.net/Java2DApplet.html

Simple 3D example (gears demo)
https://jogl-demos.dev.java.net/applettest.html

The following is a nice example mixing 2D rendering into
3D textures.  (It is not packaged as an applet, but, it
could be!)
http://weblogs.java.net/blog/campbell/archive/2007...

Finally, an older demo, nothing too special graphically,
but showing some of the GUI widgets available to applets:
http://java.sun.com/products/plugin/1.4.1/demos/jf...

Also - it's also now possible to actually drag and drop
files from your desktop, onto an applet!

For that to work the applet binary has to be signed, and
the user has to click OK at a prompt allowing the applet
to run.  But still... real drag & drop from the desktop
into a web app has nice possibilities:
http://www.radinks.com/upload/applet.php


My feeling is, the above technologies could be combined
in a way that could result in a pretty formidable web
application.  (Also, note, while the above tend to show
fixed size applets, one only need place the applet in
a variable width div (e.g. width="80%" or whatever) and
the applets resize just fine along with the browser
window.)

But -- of course -- I'd **much** rather code an app like
this in Ruby, than Java... :)

Thus my excitement at the possibility of having a mini
version of JRuby for applets.


Regards,

Bill
2f55791ab9018b4d01fb741fab21843d?d=identicon&s=25 Tony Arcieri (Guest)
on 2009-03-06 06:52
(Received via mailing list)
On Thu, Mar 5, 2009 at 9:23 PM, Bill Kelly <billk@cts.com> wrote:

> Simple 3D example (gears demo)
> https://jogl-demos.dev.java.net/applettest.html
>

glxgears in an applet!

It's all bugged out though, at least in Firefox/Mac.  When I switch tabs
the
gears are still there... and even though it claims the applet doesn't
need
to be signed I get a warning saying the signing certificate is invalid
and
asking if I want to make an exception.
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2009-03-06 08:56
(Received via mailing list)
From: "Tony Arcieri" <tony@medioh.com>
> gears are still there... and even though it claims the applet doesn't need
> to be signed I get a warning saying the signing certificate is invalid and
> asking if I want to make an exception.

Hmm... I'm seeing the same thing on Firefox/Mac.  :(

It works fine for me on Firefox/Windows and (surprisingly)
IE6/Windows.

It works OK for me on Safari/Mac (it does ask if I want
to trust the applet, but it says the cert is valid.)

No tab problems on Safari/Mac or Firefox/Windows... but,
I get the tab switching issue you described on Firefox/Mac.

Sigh... always something.  <grin>

(I tried submitting a bug to Sun, but they only accept
Java bugs for Windows/Linux/Solaris.  Submitted to Apple
instead.)


Regards,

Bill
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-03-06 09:38
(Received via mailing list)
Bill Kelly wrote:
> (I tried submitting a bug to Sun, but they only accept
> Java bugs for Windows/Linux/Solaris.  Submitted to Apple
> instead.)

FWIW, the JavaFX guys sound hopeful that Apple will release Java updates
including the many improvements Sun's made for JavaFX. This will
obviously help JavaFX, but also could greatly improve graphics
performance and startup speed of applets in general.

I hope they're right. People keep telling me JavaFX and/or applets are
superfast on recent Windows Java 6 releases.

- Charlie
2ee1a7960cc761a6e92efb5000c0f2c9?d=identicon&s=25 William James (Guest)
on 2009-03-07 09:55
(Received via mailing list)
Bill Kelly wrote:

> But -- of course -- I'd much rather code an app like
> this in Ruby, than Java... :)

Consider Clojure.
This topic is locked and can not be replied to.