AndyObtiva / glimmer

DSL Framework consisting of a DSL Engine and a Data-Binding Library used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS
MIT License
556 stars 17 forks source link

Support native binaries with GraalVM+TruffleRuby #3

Closed megatux closed 2 years ago

megatux commented 4 years ago

Do you think it is possible to use Truffle Ruby to generate native binaries? Also, is SWT actively developed? Does it works with latest GTK3.x?

AndyObtiva commented 2 years ago

Sorry, I was getting hit by many trolls during the period when you created this issue, and I thought you were a troll too, so I closed it immediately.

Regardless of whether you were a troll or not though, it is OK to answer your questions today.

Glimmer DSL for SWT already generates native binaries using jpackage for Mac, Windows, and Linux.

However, if you mean native AOT (Ahead-of-time) compilation binaries, then perhaps Truffle Ruby and GraalVM could help with that. I have not tried them yet, but I am finally ready to give them a try, so I am reopening this issue.

SWT is definitely actively developed as you can see from the Glimmer DSL for SWT README, which always lists the latest version of the SWT library used (currently, SWT 4.22, which was released on November 24, 2021).

Also, SWT automatically uses GTK3.x on Linux, so you don't have to do anything. Just install Java (like standard openjdk-17 on Linux) and JRuby (like using RVM), and you're good to go! That said, if you only want to build GTK applications for Linux and do not care about native look and feel on Mac and Windows, then you can use Glimmer DSL for GTK instead, albeit it is a very new alpha library still that is not fully developed (whereas Glimmer DSL for SWT became a final and complete release long time ago, with new features added every once in a while)

AndyObtiva commented 2 years ago

According to the research I just did, TruffleRuby is not compatible with JRuby. Worse yet, its Graal Native Image does not really do AOT (ahead-of-time) compilation to the Ruby code itself, yet only to the Graal+Truffle implementation code: https://github.com/oracle/truffleruby/blob/67ee8b015d729749591ceff8b77037eb606bf3df/doc/contributor/native-image.md

As such, my initial gut feeling was right for avoiding TruffleRuby, and I do not see value in supporting it for the time being, especially given that Glimmer DSL for SWT already supports native executable packaging on Mac, Windows, and Linux.