r/Clojure • u/HotSpringsCapybara • Jun 10 '25
Clojure for desktop widgets & GUI tools?
Keeping it short: I'm looking into developing a bunch of desktop tools, strictly for personal use. I use the term "widgets" here to signify that they're intended to be simple (mostly single-purpose) pieces of software, with GUIs that integrate with the (Linux) desktop. Subsequently: they need to launch with minimal latency, and ideally use GTK or Qt, though this is not at all a strict requirement.
Naturally, my first instinct is to use some variant of Clojure, simply because that's what gives me joy. Is it really the right tool for the job though? I can't really think of any combination of runtime & libraries that fulfills my criteria.
ClojureDart may well be it, but I've been a little reluctant to reach out for it since I'm not familiar with the Dart+Flutter world. The sheer size of Flutter SDK had me wondering if this wasn't too ambitious a tool for my humble use-case.
Another option would be to use Common Lisp instead. It seems like a feasible fit since it produces fast binaries and offers the necessary UI bindings. I have a very shallow grasp of that language & ecosystem though.
What do you think? I'll be grateful for any advice.
EDIT: I'd like to thank you for all of your suggestions. I thought I'd be grasping at straws but instead it seems there are numerous very compelling options to consider.
14
u/Borkdude Jun 10 '25
Announced a few days ago on this Reddit: https://www.reddit.com/r/Clojure/comments/1l5hv9l/announcement_clojure_desktop_toolkit/
Not sure what the current state is, but HumbleUI is worth looking into.
I don't have opinions on or experience with these frameworks since I hardly ever built a desktop app.
You could also use a webview like Portal does.
4
u/CoBPEZ Jun 10 '25
Have a look at Membrane too.
3
u/BaptisteDupuch Jun 12 '25
Hey, ClojureDart co-author here so obviously biased 😜 - I would honestly argue that Flutter & ClojureDart is one of the best option to write native GUI apps. ClojureDart is « just » a compiler to Dart so that one can leverage the whole flutter ecosystem. I don’t understand your remark concerning the development kit given all the response I could read in this thread 😊
2
u/joinr Jun 10 '25
What is acceptable latency?
I still using swing via seesaw with either substance or flatlaf for cross platform good looking theming. Although last I tried, swing was still not playing well with native-image (this was a while back, maybe everything is cool now), but who knows how far it's come by now.
9
u/kwitcherbichen Jun 10 '25
If you don't insist on native widgets/appearance, https://openjfx.io/ and Clojure's java interop.
Personally I'm considering dipping my toe into Clojure/ClojureScript and Dart for native and mobile where I can't use a browser front-end.
(Aside, this is not a recommendation as it's now retired but Apache Pivot was nice to work with)
5
u/nunzarius Jun 11 '25
I believe that the editor for the game engine Defold is made with clojure using cljfx https://github.com/cljfx/cljfx
4
u/didibus Jun 11 '25 edited Jun 11 '25
A few additional options.
Stick to Clojure + GraalVM native:
Try ClojureScript (maybe nbb can be used too)
Try ClojureCLR maybe (with native AOT, but not sure if ClojureCLR supports native AOT of .net Core)
Wait for Jank... https://jank-lang.org/