SlideShare a Scribd company logo
1 of 30
Download to read offline
Introduction to JRubME

 Roy Ben Hayun
 Engineering Services
 CSG

                         1
Topics
• Requirements for mobile Ruby
• Port of the native Ruby VM (MRI)
• Porting JRuby to Java ME
  > CLDC
  > CDC
• More things to do..




                        Sun Confidential: Internal Only   2
Requirements for mobile Ruby




          Sun Confidential: Internal Only   3
Possible usages for mobile Ruby
•   Simple application development
•   Prototyping
•   Development tools
•   Education
•   Not Ruby on Rails.

• Not much usage today.
• Possibly in few years when/if scripting languages
  gain more traction in mobile space
                       Sun Confidential: Internal Only   4
Requirements from JRubyME
• What do we actually want to get?
  > The power of Ruby language
  > JRuby's Java bindings
  > An acceptable working subset


• What can we keep for later?
  > Ruby to JVM bytecode compilation
  > Threading
  > Any advanced feature


                       Sun Confidential: Internal Only   5
Port of the native Ruby VM (MRI)




            Sun Confidential: Internal Only   6
Porting the native Ruby MRI
• See
  http://developer.symbian.com/main/tools/opensrc/ruby
• Native porting effort is lengthy
• Need to port per OS
• Requires additional effort for API access
  > Mobile APIs
  > GUI
• MRI port gives only barebones Ruby language
  > No mobile APIs

                     Sun Confidential: Internal Only     7
Comparing native MRI vs JRuby port
• Porting involved:
  > Hybrid of C, K&R C, Symbian C++ vs Java only


• Porting time:
  > Weeks vs Days


• Value achieved in those ports:
  >   Interpreter – approximately same in both
  >   No OS APIs vs Java APIs via JRuby Java binding
  >   Required customization vs platform independent
  >   JRubME is easier to extend and enhance
                          Sun Confidential: Internal Only   8
Porting JRuby to Java ME




        Sun Confidential: Internal Only   9
Choosing the Java ME plaform
• CLDC based solution
  >   The current Java ME de-facto standard
  >   MIDP provides rich mobile APIs
  >   Requires build-time modifications to replace reflection
  >   Requires source modifications to JRuby

• CDC based solution
  > e.g., Sony Ericsson P990, M600
  > Closer to a desktop Java environment
  > Requires source modifications to JRuby

                           Sun Confidential: Internal Only      10
Choosing the JRuby baseline
• Newer versions (v0.9.8 from 2007)
  > Closer to the main JRuby branch for easy integration
  > Has more advanced features


• Taking an older version (v0.8.2 from 2006)
  > Has less advanced features
  > Minimize the porting effort to get a working subset
     – Less code, fewer dependencies, fewer libraries
  > Provides the interpreter and Java bindings
     – Which is what we need for now


                         Sun Confidential: Internal Only   11
Various options for JRuby on Java ME
• Newer JRuby mainlines (X axis)
   > More language and VM features
   > Better Maintainability

• Java platform power (Y axis)
   > Less porting effort
   > More usability
                                                                                             features
                                                                         Effort


  / JRuby 0.8.2   / JRuby 0.9.8
  CDC             CDC                                                                     Maintainability
                                  Java platform
                                  closer to desktop                          Usability


  / JRuby 0.8.2   / JRuby 0.9.8                                        trade-off line
  CLDC            CLDC



                                                                  Newer JRuby mainlines

                                     Sun Confidential: Internal Only                                        12
JRuby 0.9.8 on CLDC
• Initial exploration to get some hands-on feeling
• Minor obstacles
  >   Missing classes/packages (i.e. collections, nio, regex)
  >   Missing methods in existing classes
  >   Migrating to GCF
  >   Obstacles accumulate



                                                             / JRuby 0.9.8
                                                             CLDC



                           Sun Confidential: Internal Only                   13
JRuby 0.9.8 on CLDC main obstacles
• Obstacles accumulate

• Java bindings require reflection capability
• Possible solutions:
  > Pseudo reflection mechanism
  > Hard wired code support for specific classes
     – LCDUI, PIM, connectivity, persistance etc.
  > Same process as using the C API for the native Ruby
    VM


                        Sun Confidential: Internal Only   14
Usability obstacle on CLDC
• Sandboxing limits the usage of JRuby on mobiles
  > Limits usage to MIDP APIs
  > Can not jump out of the sandbox
  > Limits options of development tools
     – i.e. Limits dynamic extensions of testing frameworks




                            Sun Confidential: Internal Only   15
Summary of obstacles on CLDC
• CLDC porting effort becomes a handcrafted port
  > Although, it’s not a full rewrite
  > But big enough to diverge from the mainline JRuby


• Need to have a CLDC version.

• A more powerful JRuby on CDC should come first
  > Provide a proof of concept
  > Prototype for mobile usage
  > Attract developers
                        Sun Confidential: Internal Only   16
Porting process to CDC
• Avoid “We don’t need all that!”
• Avoid the big bang blind port


• Decremental iterations to downgrade JRuby mainline and platform
   > Ensure it is running on Java SE 1.X
   > Regress down to Java SE 1.X-1

• Move to CDC
   > And tell the world!
                                                                       / JRuby 0.8.2   / JRuby 0.9.8
                                                                       CDC             CDC
• Incremental iterative steps
   > Integrate with newer JRuby mainlines                              / JRuby 0.8.2   / JRuby 0.9.8
   > Migrate to CLDC                                                   CLDC            CLDC




                                     Sun Confidential: Internal Only                                   17
Regress on Java SE 1.4
• Ensuring it runs on Java SE 1.5 and 1.4

• Less libraries to remove then newer JRuby mainlines
  > junit.jar
  > bsf.jar and javasupport.bsf.*
  > ant.jar and the AST serialization
• Remove asserts
• No java.nio.*
• (No autoboxing in the source..)
                         Sun Confidential: Internal Only   18
Regress on Java SE 1.3
• Chained exceptions

• Few more minor removals
  > Missing methods i.e. String.split(), Boolean.valueOf()
  > Missing classes i.e. StackTraceElement
  > Restricted access i.e. java.util.Calendar.setTimeInMills()




                         Sun Confidential: Internal Only         19
Regress on Java SE 1.3
• Bigger obstacle is that there is no java.util.regex.*
• Solution
  > Find a replacement package e.g.,Java 1.4
  > Paste into a new package jrubyme.poc.[package]
  > Modifications as required to package and client code
     – e.g., sun.text.Normalizer silently commented out.


• And do the same for other dependencies


                        Sun Confidential: Internal Only    20
Move to CDC
• Introspection support incompatible
  > java.beans.Introspector required by BeanExtender Ruby
    class
• Solution:
  > Disable the Ruby beans extension
  > Serialize Abstract Syntax Tree and redeploy *.ast.ser
    files




                         Sun Confidential: Internal Only    21
Evaluating the CDC port
• How does downgrading JRuby to 0.8.2 simplify things?
  > i.e. Less than 40 locations of java.util.Regex package usage
  > Less code e.g., 318 source files compared to 574 in 0.9.8


• How does porting to CDC via Java SE simplify things?
  > Moving closer to CDC gradually
  > Much fewer new APIs or API differences
    – No need for handcrafted porting


• Remember: we’re trying to get to a working subset
                         Sun Confidential: Internal Only       22
Demo on a real device
• AWT UI
• Can load, modify and launch a script
• On device programming




                      Sun Confidential: Internal Only   23
Demo on a real device




              Sun Confidential: Internal Only   24
Demo on a real device




              Sun Confidential: Internal Only   25
There's a lot to do from here..




           Sun Confidential: Internal Only   26
Bringing JRuby to the mobile space
• Co-existence of the native and Java options
  > Attracts developers from different backgrounds
  > No reason to limit the hosting platform options


• Anatomy of free open source success
  > Governance and decision making capability
  > Tools for collaboration
  > Strong community values and commitment



                         Sun Confidential: Internal Only   27
Bringing JRuby to the mobile space
• JRubME ‘TODO’ list
  >   Create a mobile spec (desktop too)
  >   Adapt to mobile constraints (ROM, performance, ..)
  >   Rectify the initial porting
  >   Move upwards in the JRuby versions
  >   Migrate to CLDC as well




                          Sun Confidential: Internal Only   28
Bringing JRuby to the mobile space
• JRubME ‘Wish-list’
  > Scripting languages gain more traction in the mobile
    space
  > CDC (or embedded Java SE flavour) to become the
    mobile Java de-facto standard
  > Dual compilation and JSR-292 (invokedynamic)
     – Moore’s law will take care of speed




                            Sun Confidential: Internal Only   29
Thank you


 Roy Ben Hayun
 Engineering Services
 CSG

                        30

More Related Content

What's hot

Xen PV Performance Status and Optimization Opportunities
Xen PV Performance Status and Optimization OpportunitiesXen PV Performance Status and Optimization Opportunities
Xen PV Performance Status and Optimization OpportunitiesThe Linux Foundation
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der PraxisJonathan Weiss
 
SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloudaidanshribman
 
Performance Profiling of Virtual Machines
Performance Profiling of Virtual MachinesPerformance Profiling of Virtual Machines
Performance Profiling of Virtual MachinesJiaqing Du
 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & JitAnkit Somani
 
Introduction to Android by Demian Neidetcher
Introduction to Android by Demian NeidetcherIntroduction to Android by Demian Neidetcher
Introduction to Android by Demian NeidetcherMatthew McCullough
 
JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management DetailsAzul Systems Inc.
 
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...The Linux Foundation
 
Bare-Metal Hypervisor as a Platform for Innovation
Bare-Metal Hypervisor as a Platform for InnovationBare-Metal Hypervisor as a Platform for Innovation
Bare-Metal Hypervisor as a Platform for InnovationThe Linux Foundation
 
WildFly AppServer - State of the Union
WildFly AppServer - State of the UnionWildFly AppServer - State of the Union
WildFly AppServer - State of the UnionDimitris Andreadis
 
Performance Profiling in a Virtualized Environment
Performance Profiling in a Virtualized EnvironmentPerformance Profiling in a Virtualized Environment
Performance Profiling in a Virtualized EnvironmentJiaqing Du
 

What's hot (20)

Xen PV Performance Status and Optimization Opportunities
Xen PV Performance Status and Optimization OpportunitiesXen PV Performance Status and Optimization Opportunities
Xen PV Performance Status and Optimization Opportunities
 
XS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt EnglishXS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt English
 
Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
Android Optimization: Myth and Reality
Android Optimization: Myth and RealityAndroid Optimization: Myth and Reality
Android Optimization: Myth and Reality
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der Praxis
 
SAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego CloudSAP Virtualization Week 2012 - The Lego Cloud
SAP Virtualization Week 2012 - The Lego Cloud
 
Performance Profiling of Virtual Machines
Performance Profiling of Virtual MachinesPerformance Profiling of Virtual Machines
Performance Profiling of Virtual Machines
 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & Jit
 
Introduction to Android by Demian Neidetcher
Introduction to Android by Demian NeidetcherIntroduction to Android by Demian Neidetcher
Introduction to Android by Demian Neidetcher
 
JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management Details
 
LFCOLLAB15: Xen 4.5 and Beyond
LFCOLLAB15: Xen 4.5 and BeyondLFCOLLAB15: Xen 4.5 and Beyond
LFCOLLAB15: Xen 4.5 and Beyond
 
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
 
Bare-Metal Hypervisor as a Platform for Innovation
Bare-Metal Hypervisor as a Platform for InnovationBare-Metal Hypervisor as a Platform for Innovation
Bare-Metal Hypervisor as a Platform for Innovation
 
Chen Haibo
Chen HaiboChen Haibo
Chen Haibo
 
Minimizing I/O Latency in Xen-ARM
Minimizing I/O Latency in Xen-ARMMinimizing I/O Latency in Xen-ARM
Minimizing I/O Latency in Xen-ARM
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
WildFly AppServer - State of the Union
WildFly AppServer - State of the UnionWildFly AppServer - State of the Union
WildFly AppServer - State of the Union
 
ARM and SoC Traning Part I -- Overview
ARM and SoC Traning Part I -- OverviewARM and SoC Traning Part I -- Overview
ARM and SoC Traning Part I -- Overview
 
XS Boston 2008 Memory Overcommit
XS Boston 2008 Memory OvercommitXS Boston 2008 Memory Overcommit
XS Boston 2008 Memory Overcommit
 
Performance Profiling in a Virtualized Environment
Performance Profiling in a Virtualized EnvironmentPerformance Profiling in a Virtualized Environment
Performance Profiling in a Virtualized Environment
 

Similar to Introduction to JRubMe

Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Rittercatherinewall
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deploymentThilo Utke
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyajuckel
 
Introduction to Java Part-2
Introduction to Java Part-2Introduction to Java Part-2
Introduction to Java Part-2RatnaJava
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiSoftware Guru
 
talk at jazoon 12 in Zürich
talk at jazoon 12 in Zürichtalk at jazoon 12 in Zürich
talk at jazoon 12 in ZürichHenning Blohm
 
JAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptxJAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptx20EUEE018DEEPAKM
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java Hitesh-Java
 
Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...Codemotion
 
javalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdfjavalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdfRichHagarty
 
Introduction To NetBeans IDE
Introduction To NetBeans IDEIntroduction To NetBeans IDE
Introduction To NetBeans IDEMuhammad Ghazali
 
Ceph in the GRNET cloud stack
Ceph in the GRNET cloud stackCeph in the GRNET cloud stack
Ceph in the GRNET cloud stackNikos Kormpakis
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
Android and Hard Real Time
Android and Hard Real TimeAndroid and Hard Real Time
Android and Hard Real TimeAkshar Desai
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the CloudJim Driscoll
 

Similar to Introduction to JRubMe (20)

Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Ritter
 
Mac ruby deployment
Mac ruby deploymentMac ruby deployment
Mac ruby deployment
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Introduction to Java Part-2
Introduction to Java Part-2Introduction to Java Part-2
Introduction to Java Part-2
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
 
talk at jazoon 12 in Zürich
talk at jazoon 12 in Zürichtalk at jazoon 12 in Zürich
talk at jazoon 12 in Zürich
 
JAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptxJAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptx
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 
Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...Refactor your Java EE application using Microservices and Containers - Arun G...
Refactor your Java EE application using Microservices and Containers - Arun G...
 
javalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdfjavalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdf
 
Introduction To NetBeans IDE
Introduction To NetBeans IDEIntroduction To NetBeans IDE
Introduction To NetBeans IDE
 
Ceph in the GRNET cloud stack
Ceph in the GRNET cloud stackCeph in the GRNET cloud stack
Ceph in the GRNET cloud stack
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Android and Hard Real Time
Android and Hard Real TimeAndroid and Hard Real Time
Android and Hard Real Time
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Java 9 sneak peek
Java 9 sneak peekJava 9 sneak peek
Java 9 sneak peek
 

Recently uploaded

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 

Recently uploaded (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Introduction to JRubMe

  • 1. Introduction to JRubME Roy Ben Hayun Engineering Services CSG 1
  • 2. Topics • Requirements for mobile Ruby • Port of the native Ruby VM (MRI) • Porting JRuby to Java ME > CLDC > CDC • More things to do.. Sun Confidential: Internal Only 2
  • 3. Requirements for mobile Ruby Sun Confidential: Internal Only 3
  • 4. Possible usages for mobile Ruby • Simple application development • Prototyping • Development tools • Education • Not Ruby on Rails. • Not much usage today. • Possibly in few years when/if scripting languages gain more traction in mobile space Sun Confidential: Internal Only 4
  • 5. Requirements from JRubyME • What do we actually want to get? > The power of Ruby language > JRuby's Java bindings > An acceptable working subset • What can we keep for later? > Ruby to JVM bytecode compilation > Threading > Any advanced feature Sun Confidential: Internal Only 5
  • 6. Port of the native Ruby VM (MRI) Sun Confidential: Internal Only 6
  • 7. Porting the native Ruby MRI • See http://developer.symbian.com/main/tools/opensrc/ruby • Native porting effort is lengthy • Need to port per OS • Requires additional effort for API access > Mobile APIs > GUI • MRI port gives only barebones Ruby language > No mobile APIs Sun Confidential: Internal Only 7
  • 8. Comparing native MRI vs JRuby port • Porting involved: > Hybrid of C, K&R C, Symbian C++ vs Java only • Porting time: > Weeks vs Days • Value achieved in those ports: > Interpreter – approximately same in both > No OS APIs vs Java APIs via JRuby Java binding > Required customization vs platform independent > JRubME is easier to extend and enhance Sun Confidential: Internal Only 8
  • 9. Porting JRuby to Java ME Sun Confidential: Internal Only 9
  • 10. Choosing the Java ME plaform • CLDC based solution > The current Java ME de-facto standard > MIDP provides rich mobile APIs > Requires build-time modifications to replace reflection > Requires source modifications to JRuby • CDC based solution > e.g., Sony Ericsson P990, M600 > Closer to a desktop Java environment > Requires source modifications to JRuby Sun Confidential: Internal Only 10
  • 11. Choosing the JRuby baseline • Newer versions (v0.9.8 from 2007) > Closer to the main JRuby branch for easy integration > Has more advanced features • Taking an older version (v0.8.2 from 2006) > Has less advanced features > Minimize the porting effort to get a working subset – Less code, fewer dependencies, fewer libraries > Provides the interpreter and Java bindings – Which is what we need for now Sun Confidential: Internal Only 11
  • 12. Various options for JRuby on Java ME • Newer JRuby mainlines (X axis) > More language and VM features > Better Maintainability • Java platform power (Y axis) > Less porting effort > More usability features Effort / JRuby 0.8.2 / JRuby 0.9.8 CDC CDC Maintainability Java platform closer to desktop Usability / JRuby 0.8.2 / JRuby 0.9.8 trade-off line CLDC CLDC Newer JRuby mainlines Sun Confidential: Internal Only 12
  • 13. JRuby 0.9.8 on CLDC • Initial exploration to get some hands-on feeling • Minor obstacles > Missing classes/packages (i.e. collections, nio, regex) > Missing methods in existing classes > Migrating to GCF > Obstacles accumulate / JRuby 0.9.8 CLDC Sun Confidential: Internal Only 13
  • 14. JRuby 0.9.8 on CLDC main obstacles • Obstacles accumulate • Java bindings require reflection capability • Possible solutions: > Pseudo reflection mechanism > Hard wired code support for specific classes – LCDUI, PIM, connectivity, persistance etc. > Same process as using the C API for the native Ruby VM Sun Confidential: Internal Only 14
  • 15. Usability obstacle on CLDC • Sandboxing limits the usage of JRuby on mobiles > Limits usage to MIDP APIs > Can not jump out of the sandbox > Limits options of development tools – i.e. Limits dynamic extensions of testing frameworks Sun Confidential: Internal Only 15
  • 16. Summary of obstacles on CLDC • CLDC porting effort becomes a handcrafted port > Although, it’s not a full rewrite > But big enough to diverge from the mainline JRuby • Need to have a CLDC version. • A more powerful JRuby on CDC should come first > Provide a proof of concept > Prototype for mobile usage > Attract developers Sun Confidential: Internal Only 16
  • 17. Porting process to CDC • Avoid “We don’t need all that!” • Avoid the big bang blind port • Decremental iterations to downgrade JRuby mainline and platform > Ensure it is running on Java SE 1.X > Regress down to Java SE 1.X-1 • Move to CDC > And tell the world! / JRuby 0.8.2 / JRuby 0.9.8 CDC CDC • Incremental iterative steps > Integrate with newer JRuby mainlines / JRuby 0.8.2 / JRuby 0.9.8 > Migrate to CLDC CLDC CLDC Sun Confidential: Internal Only 17
  • 18. Regress on Java SE 1.4 • Ensuring it runs on Java SE 1.5 and 1.4 • Less libraries to remove then newer JRuby mainlines > junit.jar > bsf.jar and javasupport.bsf.* > ant.jar and the AST serialization • Remove asserts • No java.nio.* • (No autoboxing in the source..) Sun Confidential: Internal Only 18
  • 19. Regress on Java SE 1.3 • Chained exceptions • Few more minor removals > Missing methods i.e. String.split(), Boolean.valueOf() > Missing classes i.e. StackTraceElement > Restricted access i.e. java.util.Calendar.setTimeInMills() Sun Confidential: Internal Only 19
  • 20. Regress on Java SE 1.3 • Bigger obstacle is that there is no java.util.regex.* • Solution > Find a replacement package e.g.,Java 1.4 > Paste into a new package jrubyme.poc.[package] > Modifications as required to package and client code – e.g., sun.text.Normalizer silently commented out. • And do the same for other dependencies Sun Confidential: Internal Only 20
  • 21. Move to CDC • Introspection support incompatible > java.beans.Introspector required by BeanExtender Ruby class • Solution: > Disable the Ruby beans extension > Serialize Abstract Syntax Tree and redeploy *.ast.ser files Sun Confidential: Internal Only 21
  • 22. Evaluating the CDC port • How does downgrading JRuby to 0.8.2 simplify things? > i.e. Less than 40 locations of java.util.Regex package usage > Less code e.g., 318 source files compared to 574 in 0.9.8 • How does porting to CDC via Java SE simplify things? > Moving closer to CDC gradually > Much fewer new APIs or API differences – No need for handcrafted porting • Remember: we’re trying to get to a working subset Sun Confidential: Internal Only 22
  • 23. Demo on a real device • AWT UI • Can load, modify and launch a script • On device programming Sun Confidential: Internal Only 23
  • 24. Demo on a real device Sun Confidential: Internal Only 24
  • 25. Demo on a real device Sun Confidential: Internal Only 25
  • 26. There's a lot to do from here.. Sun Confidential: Internal Only 26
  • 27. Bringing JRuby to the mobile space • Co-existence of the native and Java options > Attracts developers from different backgrounds > No reason to limit the hosting platform options • Anatomy of free open source success > Governance and decision making capability > Tools for collaboration > Strong community values and commitment Sun Confidential: Internal Only 27
  • 28. Bringing JRuby to the mobile space • JRubME ‘TODO’ list > Create a mobile spec (desktop too) > Adapt to mobile constraints (ROM, performance, ..) > Rectify the initial porting > Move upwards in the JRuby versions > Migrate to CLDC as well Sun Confidential: Internal Only 28
  • 29. Bringing JRuby to the mobile space • JRubME ‘Wish-list’ > Scripting languages gain more traction in the mobile space > CDC (or embedded Java SE flavour) to become the mobile Java de-facto standard > Dual compilation and JSR-292 (invokedynamic) – Moore’s law will take care of speed Sun Confidential: Internal Only 29
  • 30. Thank you Roy Ben Hayun Engineering Services CSG 30