DEV Community

Cover image for Befunge GUI by Glimmer (2 for 1: LibUI & SWT)
Andy Maleh
Andy Maleh

Posted on

Befunge GUI by Glimmer (2 for 1: LibUI & SWT)

In light of the recent Beta release of Glimmer DSL for LibUI, I have been looking for applications that could take advantage of its productivity and speed in building desktop GUI with its Ruby DSL. One such application has been Befunge98 GUI, built for a Ruby implementation of the Befunge98 programming language done by Victor Maslov (GitHub username: Nakilon).

According to Wikipedia, Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, right, up or down, and loops are constructed by sending the control flow in a cycle. It has been described as "a cross between Forth and Lemmings".

In fact, I built its GUI twice with two different approaches, one using the up and coming Glimmer DSL for LibUI on CRuby relying on a multi-canvas-grid (LibUI area) approach, and one using the very mature Glimmer DSL for SWT on JRuby by relying on a button-grid approach.

Thanks to Glimmer's highly productive GUI DSLs, both implementations took me no more than a few hours. In fact, they both took 5 minutes for the initial simplest version that received Befunge input from GUI and rendered output to terminal. Afterwards, the simplest version was upgraded with bidirectional synchronization between the input grid and input multiline-entry/text field in addition to auto-saving/loading of the last program entered and a window-based output terminal or a read-only multiline-entry output control.

Befunge98 GUI (Glimmer DSL for LibUI)

screenshot 1 libui

Befunge98 GUI (Glimmer DSL for SWT)

screenshot 1 swt

screenshot 2 swt

Happy Glimmering!

Discussion (0)