JavaFX In Action #21 with Vlad Protsenko, Combining Clojure with JavaFX for Game Development with Defold

Vlad Protsenko is a Clojure developer working at Defold. While I initially wanted to learn about the Cljfx project, our conversation evolved into a learning experience: a practical getting-started guide to Clojure, a hands-on demonstration of building JavaFX user interfaces with minimal code, and an inside look at the Defold game engine and its JavaFX-based IDE.
About Vlad
Vlad is a Senior Developer with proficiency in many JVM-based languages. He worked both in very small and large teams, gaining experience in developing projects of various sizes, from scratch and from legacy codebases. He enjoys full-stack development, writing backend, frontend, and Android applications. He started as a game developer and switched to developing enterprise software, currently mixing both at Defold.
You can find him on:
Cljfx Library
Cljfx is a declarative, functional, and extensible wrapper of JavaFX. It’s inspired by the better parts of react and re-frame.
Like react, it allows to specify only desired layout, and handles all actual changes underneath. Unlike react (and web in general) it does not impose xml-like structure of everything possibly having multiple children, thus it uses maps instead of hiccup for describing layout.
Like reagent, it allows to specify component descriptions using simple constructs such as data and functions. Unlike reagent, it rejects using multiple stateful reactive atoms for state and instead prefers composing ui in more pure manner.
Like re-frame, it provides an approach to building large applications using subscriptions and events to separate view from logic. Unlike re-frame, it has no hard-coded global state, and subscriptions work on referentially transparent values instead of ever-changing atoms.
Like fn-fx, it wraps underlying JavaFX library so developer can describe everything with clojure data. Unlike fn-fx, it is more dynamic, allowing users to use maps and functions instead of macros and deftypes, and has more explicit and extensible lifecycle for components.
Defold Game Editor IDE
Defold is a game engine for high-performance cross-platform games. It comes fully featured out of the box. There’s nothing to set up or configure, not even when building. Simply download the editor and get creative! That editor is created with JavaFX and Clojure.
Video content
00:00 Who is Vlad?
00:48 Looking back in time with ActionScript
01:49 About Clojure compared to Scala and Java 21
05:23 About the cljfx project
06:59 Demo of Clojure code and the use of cljfx
12:21 Demo of Defold game editor
15:51 The goal of the cljfx project
16:33 Changes needed in JavaFX