morning all, has anyone had any luck writing an ap...
# javascript
c
morning all, has anyone had any luck writing an app using GJS? (The gnome javascript stuff, lets you write GTK+ apps in javascript and shell extensions.) I got something working in a very frankenstein way, was wondering if anyone had a nicer approach
n
Many of the GTK based apps written in Kotlin use the official GTK C API (via Kotlin Native), which aren't the easiest to use but will be much easier to interop with compared to the JS APIs. The C APIs unlike the JS ones don't require mapping files to be created.
If your'e planning to develop GTK apps then the GTK C API will be a better choice (will require more work upfront to get started). The C API is much more mature, stable, comprehensive, and has better documentation than the JS API.
Currently there is work underway to develop a thin wrapper (exposed as a Kotlin API) around the C API: https://github.com/kropp/kotlin-native-gtk
c
cheers Nick, I'll be starring that repo, but still wouldn't mind knowing if there is anyone who's done the nasty with the GJS stuff- my understanding is that the gnome-shell is extensively developed in javascript, so being able to jimmy kotlin in there would make me happy (only because of my zeal for kotlin)
n
As far as I understand all extensions that are developed for Gnome Shell are written in JS (incl languages that transpile to JS). Many of the major GTK based applications use the official GTK C API, and JS isn't commonly used to develop these applications.