Re: GJS Status



On Mon, Dec 7, 2015 at 1:26 AM, Andrea Giammarchi <andrea giammarchi gmail com> wrote:
First of all, I'd like to say hello to everyone. I've been using GNOME on ArchLinux for more than a year now and I love pretty much everything about it.
Recently I've found GJS project and I've started playing with it making it more "JSish" than "Pythonic" and implementing partially some node.js core API and functionalities such require, fs, path, os, with some synchronous and asynchhronous API too.

Hello, welcome.

You might want to check in with Jasper St. Pierre (Jasper on IRC), he has been interested in bootstrapping the Gnome stack onto Node.js.
 
So far, so good ... however, there are 2 main questions I'd like to ask about GJS:

  1. is this project still alive? It works like a charm but repositories look untouched for long time

Yes, there was a 1.44.0 release just last month. It's not the most active GNOME project though.
 
  2. is it posible to know how to generate the Giovanni's documentation? I've talked with him directly and apprently he's not working on that branch anymore but beside static assets that are present in such branch, all generated content fails to build (tried in ArchLinux, Ubuntu) and I've no idea what I should do in order to generate the documentation for Gtk-3.0 or Gdk and others that are not Gio, GObject, and GLib.

The result of the parsing of such documentation  gives me the ability to create files like the following one: https://github.com/WebReflection/jsgtk/blob/master/jsgtk/gi.js

Since the Proxy implemented in  js24 seems to fail if used directly as Gtk instance, that's the way to tarnsform all accessors and methods from lower_case to camelCase but this is only one part of the project, the rest will be at some point documented as long as I understand it's worth keep improving it.

I would strongly recommend that you not parse the documentation but instead parse the GIR files directly.

Even better would be, in my opinion, to write some code on the C side of things to handle both underscored and camelcased methods. Here's where it's done for GObject property names: https://git.gnome.org/browse/gjs/tree/gi/object.cpp#n282

(I suspect a change like this would be controversial, though; I'm not sure of the reason why it was originally done for GObject properties and not methods, but hardly any existing GJS code that I've seen takes advantage of camelcased properties.)

Coincidentally I've been working off and on, on getting the GJS documentation into a local instance of devdocs.io. If you want to try it out, build this branch of gobject-introspection (https://github.com/ptomato/gobject-introspection/tree/wip/ptomato/devdocs) and check out this branch of devdocs (https://github.com/ptomato/devdocs/tree/gir-redux). In your Ruby environment run "thor gir:generate_all" then "thor gir:generate gio --force" (repeat the last one for whichever GIR documentation you want to generate), then "rackup" to start the webapp.
 
Right now the quick demo I can provide is that if you `npm install jsgtk` in a folder that contains a `node_modules` directory and you create a `hello-world` like the following

```
#!/usr/bin/env sh
imports=imports// "exec" "gjs" "-I" "$(dirname $0)/node_modules/jsgtk/" "$0" "$@"

let {console} = imports.jsgtk;
console.info('Hello jsgtk!');
```

and you `chmod +x hello-world` and run it or simply `sh hello-world` you should see the message in console.

Thanks for any sort of info or comment or clarification.
 
Personally I'm not a fan of Node.js's API, rather see something with promises than more callback hell, but it would indeed be nice to have some sort of standard module that lowers the barrier of entry for people new to Gnome who are used to web development. But that's my opinion and I'm not a GJS maintainer, just a heavy user.

Satyajit Sahoo who I think reads this list, also has something similar: https://github.com/satya164/gjs-helpers

Regards,
--
Philip


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]