Re: GJS API changes



Hi Philip(

On Wednesday, 16 November 2016, <philip chimento gmail com> wrote:
Hi list,

I'm on the verge of merging a branch [1] to GJS master, which will port the underlying JS engine to SpiderMonkey 31 (was 24). This will bring a bunch of new JS features (and I hope performance improvements as well) to gnome-shell and extension authors.

With the new engine, gnome-shell code will be required to call gjs_init() before making any other calls to the GJS API, and call gjs_shutdown() after destroying your last GjsContext. It is planned for both of these methods to be new API in GJS 1.47.1.

I'm always a bit sad when libraries require explicit initialisation and deinitialisation functions; they usually impose additional cognitive burden on developers.

Since GJS is written as a C++ library with a C ABI, wouldn't be possible to use a static constructor to automatically call gjs_init() before the main() function is called? And, symmetrically, use a static destructor to shut it down after main() returns? Is it an ordering problem?

My questions:
- Will it be a problem for gnome-shell master to bump its dependency on GJS to >= 1.47.1?
- Is it likely that this would be a problem with backwards compatibility (e.g. if anyone would try to run, say, gnome-shell 3.18 with GJS 1.48)

If the Shell acquires a compile time dependency on a newer GJS then everybody packaging the Shell will also update GJS, and vice versa, so I would not worry about this.

Ciao,
 Emmanuele.


--
https://www.bassi.io
[@] ebassi [@gmail.com]


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