InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Mobile Ruby Roundup: Symbian Ruby 1.9, Android, JME, iPhone and Mono

Posted by Werner Schuster on Nov 23, 2008

Sections
Development,
Architecture & Design
Topics
Ruby ,
Mobile ,
.NET ,
Runtimes ,
Java
Tags
iPhone ,
Mono ,
Java ME ,
IronRuby ,
Symbian ,
Android ,
JRuby

A port of Ruby 1.9 for Symbian is now available, a Ruby 1.8 version has been available for some time (as well as Python for Symbian).

Besides Symbian's Ruby, there isn't too much support for Ruby on mobile phones right now.  It's possible to run Ruby's ARM version on Android.

Since Android is Java based, another option would be to get JRuby to run on Android. One issue is that Android doesn't execute Java bytecodes, but instead Dalvik bytecodes (JVM bytecodes have to be translated to Dalvik bytecodes). In a discussion on the jruby-user list, JRuby's Charles Nutter lists possible solutions:

There's two possible execution scenarios that would work with these limitations:
* Pure interpreted, where all code gets parsed on the device and executed with our AST-walking interpreter logic. This would probably be slower than we'd like, but easy to make work.
* Pure compiled, with all invokers/handles generated ahead-of-time as well.
Both cases are already possible in the current codebase; the only trick would be producing a deliverable .jar that provides only the one and has no dependencies on the other.


Running JRuby on JME is is not really an option today. A port of JRuby to JME was presented at JavaOne 2007. The Zip file at the linked location contains the slides of the JavaOne presentation, which details the process involved in getting a subset of JRuby to run on JME. Since JME is a cut down version of Java, getting JRuby to run involves a rewrite of large parts of JRuby. JRuby's current versions rely on Java 5 - but as the slides show, JME lacks classes and methods added as far backs as Java 1.2. Among the bigger omissions are Regular Expressions or large parts of the Collections API.

Another option might soon become available in the form of IronRuby and Mono for the iPhone. While the iPhone AppStore doesn't allow to download interpreters, the latest Mono versions have a solution: Ahead of Time compilation, ie. code in CIL is compiled to CPU instructions, in the iPhone's case to ARM instructions. Since IronRuby can compile Ruby code to CIL, instead of interpreting them, it's possible to compile a Ruby application down to CIL, AOT compile it and run that on the iPhone. As Miguel de Icaza mentions, a few minor issues remain before IronRuby code can be made to run:

Of course, once you remove the JIT you will not be able to use any dynamically generated code. This means no Reflection.Emit dynamically and at least for the time being or no IronPython/IronRuby.
John Lam told me at the PDC that they are looking into bringing static compilation for IronPython/IronRuby/DLR back, so this might just be a short-lived limitation.

No comments

Watch Thread Reply

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.