GNOME JavaScript (GJS) bindings for GLib, Gtk4, cairo, clutter,

Hello folks,

To create a gnome-shell extension I’ve started writing purescript-gjs bindings for the GNOME JavaScript. The GJS conveniently exports many libraries and it can be used without the GNOME desktop environment.

I wrote enough ffi to implement simple programs using Gtk4, Clutter and a DBus client. Perhaps the bindings could be generated using the gobject-introspection (GIR) files, but I’m not entirely sure how to handle object inheritance and type convertions.

Anyway, it seems like PureScript is working really well for GJS. Please let me know if you are interested, I’d be happy to add you to the project.

Cheers,
-Tristan

11 Likes

Finally! I’ve been waiting for someone to do this, and you seem like a person who’s capable of doing it well.

2 Likes

Thank you for the kind words. Well I’m still learning the API, and reaching a decent coverage is probably a lot of work. My plan is to add bindings for the basic use cases, for example for iostream, subprocess and signal. Then once enough demo examples are working, I think we should consider a code generator, similar to what has been done with haskell-gi.

This is quite an interesting project, and it could use some help :slight_smile:

3 Likes