AndyObtiva/glimmer

Feature Request: GraalVM Native Image

tekanic opened this issue · 3 comments

Add an option to the CLI tool to build executable using GraalVM Native Image.

I was curious to see if you experimented with GraalVM Native Image to see if it improved startup time.

Glimmer DSL for SWT JRuby startup time has already improved significantly with the new Mac M1 Chip (having 8+ cores) as apps start in about 3-4 seconds on it instead of the 5+ seconds it took on older systems, rendering startup time practically a non-issue.

I expect startup time to become even less of an issue on the faster CPUs that are coming out nowadays.

And, any Glimmer DSL for SWT software built for the enterprise to start at the beginning of the day and remain running all day does not suffer from any real practical issues regarding JRuby startup time.

Concerning GraalVM, as far as I know, it only supports TruffleRuby, not JRuby (which is a lot more mature and popular in the software community), so it is a non-starter.

Also, the GraalVM Native Image makes a closed-world assumption that complicates building native executables significantly by requiring you to have the Java source code for SWT, so it is not as simple as 1-2-3 or as convenient as Glimmer DSL for SWT's current glimmer package command since it puts the onus on the developer to meet all of GraalVM Native Image's closed-world assumption requirements for their application.

Moreover, GraalVM Native Image currently has lower peak performance because it lacks some optimizations that are only available in the standard JDK.

Furthermore, the GraalVM Native Image Generator is not an ahead-of time compiler for Ruby code, yet only the Java components.

Right now, GraalVM Native Image seems like experimental immature software to me that is not worth the effort of supporting. If anything changes in the future, I would be happy to explore.

Please keep in mind that there are Glimmer CRuby (MRI) alternatives that have instant startup time like Glimmer DSL for LibUI, which has native widgets just like SWT and is a Fukuoka Ruby 2022 Special Award Winner (after getting judged by Matz, the creator of Ruby).