Traditionally, Glimmer GUI gems have been mostly a one-sided effort, with a few 3rd party contributions here and there (like Drag and Drop support for Glimmer DSL for Tk). Well, that changes with Glimte! Glimte is a 3rd party framework built on top of Glimmer (Tk flavor) by Phaengris to facilitate following a certain variation of the MVC pattern (Model-View-Controller) called MVVM (Model-View-ViewModel). It encourages a model of programming for desktop GUI views that is similar to Rails .erb and GTK .glade files, but using the Glimmer GUI DSL in .glimmer.rb files as the view format. As such, it provides a much lighter more programmer-friendly Ruby-native replacement for HTML, ERB, and Glade. Consequently, Glimte ushers in the next era of Glimmer; that is The Glimmer Ecosystem!
The Glimmer Ecosystem enables the democratization of the style of development followed when building Glimmer desktop applications in Ruby, among many other obvious benefits. That in turn facilitates a vision similar to the Rails vision explained by Yahuda Katz in his keynote speech at RailsConf 2014 (at which I presented too), which was borrowed from Steve Jobs. What Yahuda alluded to was that by continuously building more floors for the lower levels of a building in the form of a framework and a community of open-source projects, we enable developers to start development at higher and higher levels than they would have been able to otherwise, thus helping them leapfrog earlier ways of development in ever increasing productivity!
So, what is Glimte?
"MVVM framework based on Glimmer for creating desktop apps in Ruby / Tk"
What is pass, the Linux password manager that PasswordStore is built for?
"Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities.
pass makes managing these individual password files extremely easy. All passwords live in ~/.password-store, and pass provides some nice commands for adding, editing, generating, and retrieving passwords. It is a very short and simple shell script. It's capable of temporarily putting passwords on your clipboard and tracking password changes using git."
Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library) v0.0.54 and v0.0.55 just got released with two new samples:
Hello, Labelframe!: demonstrates the `labelframe` widget, also known as the named group widget, which wraps around a group of other widgets and adds a title to them at the top-left by default
Hello, Scale!: demonstrates the `scale` widget, which is a scale slider that can be data-bound to a float or integer value
I am happy to comfortably answer this question today with a resounding YES!!!
2021 WAS THE YEAR of THE RUBY DESKTOP!!!
In fact, 2021 was the year Desktop Development became a first-class citizen in Ruby again!
To clarify, here are all the Ruby desktop development gems that came out of Glimmer in 2021:
Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library): this gem just won a 2022 Fukuoka Ruby Special Award after getting judged directly by Matz (creator of Ruby) and the Fukuoka Ruby Award Competition Judges! How is that for a Year of The Ruby Desktop accomplishment!!?!
Actually, there is quite a bit of irony in Glimmer supporting JavaFX. Glimmer was initially inpsired by the earliest version of JavaFX, having a very lightweight syntax called JavaFX Script. It was completely different from the JavaFX of today, which has a heavyweight Java syntax and an even heavier-weight XML syntax sadly. Things have come full circle in 2021 when Glimmer has become the proven technology that would rescue JavaFX from its new self with the much lighter-weight Glimmer DSL syntax!
That said, Glimmer is not only rescuing JavaFX, but it is also rescuing the entire Ruby community from non-native-looking overly verbose and imperative non-Ruby-style GUI toolkits. Thankfully, Glimmer steps in to save the day whether software engineers need to run on JRuby in SWT or on CRuby in LibUI.
Additionally, Glimmer adopts a pragmatic software engineering approach by supporting numerous GUI toolkits that have different trade-offs and are used by software engineers for various reasons (like FXRuby, which in fact has the highest number of downloads out of all Ruby GUI toolkits; 900,000+ downloads and counting). I mean after all, why not use a software-engineer-friendly Glimmer DSL instead of the default complicated verbose imperative code that scares developers away from desktop development!?!! Glimmer GUI DSL syntax is not only lightweight and declarative, but thanks to the one-language Ruby DSL approach, it is in fact much more convenient to use than any web technology, period.
Furthermore, Glimmer intentionally makes an effort to adopt the community standards of each GUI toolkit it supports. That way, when SWT or LibUI developers decide to use Glimmer DSLs, they feel right at home (e.g. SWT widget constructors usually receive SWT styles as the main argument whereas LibUI widget constructors usually receive the initial value as the main argument; and corresponding Glimmer DSLs behave the same way).
Glimmer is a community service. In fact, here are some of the impacts Glimmer can have on society:
Customers will receive desktop products in a matter of months not years, weeks not months, days not weeks, or hours not days, depending on the size of the project
Software engineers and customers will reap great savings in software engineering costs by not having to write and maintain complicated imperative GUI code
Software engineers will be maximally productive by working at the speed of thought without any technology friction, thanks to the highly expressive GUI DSL, convention over configuration, smart defaults, and being able to write the minimum amount of syntax needed to specify GUI and data-bind it.
The GUI DSL syntax makes it simple for newcomers to get into building desktop apps, in fact much simpler than building web apps. This will lower the barrier of entry to computer programming and encourage a lot more people in society to get into software engineering.
The extensibility of the GUI DSL makes it convenient for software engineers all around the world to contribute Custom Controls and help each other in meeting customer demands with open-source software
Thankfully, community members do contribute back to Glimmer too, such as vin1antme's big 2021 contribution of lightweight declarative drag and drop support for Glimmer DSL for Tk.
In fact, there are many areas where Ruby community members could contribute to Glimmer:
Text Editors & IDEs that can be customized with Ruby (I am no Text Editor developer though here is my attempt at building my own Text Editor in Glimmer: Gladiator - Glimmer Editor)
Native Executable Packaging for CRuby (Glimmer in JRuby already has Native Executable Packaging support for building Mac APP/DMG/PKG files, Windows EXE/MSI files, and Linux DEB/RPM files)
Visualization Tools to make Ruby compete with Python at building GUIs for data-science visualizations (using Glimmer is so much simpler and more productive than any GUI technology in Python).
External Sample Applications
Plugin Architecture Support (and perhaps codifying Desktop Application Design Patterns)
Themes
Gaming Frameworks that uniquely take advantage of retained-mode canvas graphics with bidirectional data-binding, resulting in much shorter and simpler code than any other gaming engines (avoiding imperative frame-rate-based rendering)
Video and Blog Tutorials
More documentation (perhaps translating toolkit API references into Ruby API references, like the SWT javadoc becoming a Ruby doc instead)
In any case, I would like to conclude this celebratory blog post by sharing with you an introductory video tutorial for Glimmer's first DSL (got extracted out of Glimmer into its own project): Glimmer DSL for SWT (make sure to raise the video quality to HD, like HD1080)
It demonstrates the just added explicit support for Contextual Menus. These are also known as pop-up menus, which show up when right-clicking in an application.
Glimmer was originally created on top of SWT because Tk did not support native GUI widgets on Mac, Windows, and Linux back in 2007. Tk used to be more akin of Java Swing, having painted widgets that looked foreign on all platforms.
Tk 8.5 changed that by supporting native themed widgets.
Glimmer was also originally created on top of JRuby because standard Ruby did not have truly parallel multi-threading, required for desktop application development to run jobs in the background while letting the user interact with the GUI in the foreground.
Upcoming Ruby 3.0 changes that by finally supporting truly parallel multi-threading via Ractor (formerly known as Ruby Guilds).
SWT is a highly proven GUI toolkit in the Java world, with the best example being the Eclipse IDE.
Tcl/Tk is also a very proven and stable GUI toolkit, especially as the default toolkit for a number of languages like Ruby and Python.
The trade-off is that while SWT provides a plethora of high quality reusable widgets (such as Nebula) for the Enterprise, Tk enables very fast startup time via MRI Ruby.
Below is the project README with a Hello, World! GUI code sample.