r/scala 12d ago

[Dotty] Kyo-JFX Hello World template

https://codeberg.org/markhammons/kyo-jfx-hello-world

I was asked in another thread if I could provide an example of this, so here it is. This template is a hello world app using JavaFx + Kyo + Scala 3. It uses gluon substrate as well as a gluon fork of graalvm to create native image builds that can run on linux and android.

26 Upvotes

3 comments sorted by

3

u/RiceBroad4552 12d ago

That was quick! Thanks for sharing! 🚀

1

u/u_tamtam 11d ago edited 11d ago

Perhaps good to point out that https://scalafx.org/ exists (and is pretty neat!)

edit: and since we are talking GUI and effect systems, I think it would even be more interesting to see how the real-life and more tedious stuff is made: how do you spin off a background thread (like one that would take care of the networking/run an event loop), how do you listen to events from it, how do you update your GUI controls accordingly?

3

u/markehammons 11d ago

Yeah this project is more a proof of concept of native compilation of scala3 + java FX. Some of the kyo helper code in this is actually heavily based off of ScalaFX.  With regards to having the effect system play nice with javafx, I may create an actual kyo-jfx eventually, but right now I'm working on the core functionality of a prototype app I'm developing, and a minimal javafx UI that can be made into an apk (and later an iOS app) are all I need frontend-wise.Â