Friday, October 08, 2021

Glimmer DSL for LibUI Beta Release

I recently mentioned that a new Glimmer DSL was brewing; that is Glimmer DSL for LibUI

It has been a passion project for the last 3 weeks that ended today with Glimmer DSL for LibUI becoming feature-complete and moving from Alpha to Beta.

What is LibUI?

LibUI is a thin Ruby wrapper around libui, a relatively new C GUI library that renders native controls on every platform (similar to SWT, but without the heavy weight of the Java Virtual Machine).

One of the biggest benefits of Glimmer DSL for LibUI as opposed to Glimmer DSL for SWT is that it is a prerequisite-free MRI CRuby desktop development GUI library. No need to pre-install any prerequisites. Just install the gem and have platform-independent native GUI that just works!

The main trade-off in using Glimmer DSL for LibUI as opposed to Glimmer DSL for SWT or Glimmer DSL for Tk is the fact that SWT and Tk are more mature than mid-alpha libui as GUI toolkits. Still, if there is only a need to build a small simple application, Glimmer DSL for LibUI could be a good convenient choice due to having zero prerequisites beyond the dependencies included in the Ruby gem. Also, just like Glimmer DSL for Tk, its apps start instantly and have a small memory footprint. LibUI is a promising new GUI toolkit that might prove quite worthy in the future.

One nifty innovation that this project came up with is implicit data-binding for table data as you will see in the table example below.

Glimmer DSL for LibUI aims to provide a DSL similar to the Glimmer DSL for SWT to enable more productive desktop development in Ruby with:

  • Declarative DSL syntax that visually maps to the GUI control hierarchy
  • Convention over configuration via smart defaults and automation of low-level details
  • Requiring the least amount of syntax possible to build GUI
  • Custom Control support
Hello, World!

Basic Table Progress Bar

Area Gallery

Check out many more examples at the project page.

Keep in mind that just like with Glimmer DSL for LibUI, you can build a complete and elaborate DSL in Glimmer in as fast as 3 weeks (with the first version done in a matter of hours). Glimmer offers ultimate flexibility in sculpting a DSL exactly the way you want whether it involves arguments, keyword arguments, block variables, nested attributes, or content blocks. Use Glimmer for your next DSL project.

Happy Glimmering!

1 comment:

Николай Войнов said...

You're done pretty big work with all those UI libraries and this one seems promising enough, it seems much easier and native. Thank you!