GSoC 2015 - Writing a JS Plugin Loader

Gary Kramlich grim at reaperworld.com
Mon Mar 9 01:34:15 EDT 2015


GPlugin has had two javascript loaders that were actually both removed
recently.  One was using Seed [1] which was removed since they don't allow
you to properly subclass objects.  The other was gjs [2], or GNOME
JavaScript, which was removed recently because they moved from the
SpiderMonkey C bindings to the C++ bindings and I didn't see a quick
solution to making it work.

That said, writing a single loader for GPlugin is actually pretty simple if
there is an existing gobject-introspection library for the language you're
trying to bind to.  For example, I wrote both the Seed and GJS loaders in
one night a piece.  Hardly enough work to be considered a full blown Summer
of Code project.

When it comes to JavaScript, there's so many different ways it could be
done, which makes it far more complicated than it should be.  Which is
exactly why GNOME itself has two JavaScript bindings; Seed and GJS.  What I
really mean is, which JavaScript engine to support, how to handle packages,
etc.

In the case of JavaScript engines, SpiderMonkey (Mozilla's) was working
just fine in GJS until GJS switched what bindings they were using.  I
realized after I removed it from the GPlugin tree, that I could probably
rewrite the GJS loader in C++ and call it a day.  However, I don't have any
C++ bindings for GPlugin and last I checked GTKmm was still using custom
bindings and not gobject-introspection.  So that might be a bit more
difficult that it should be.

Seed uses the WebKit JavaScript engine (not v8, that's specific to Chrome,
Chromium, NodeJS, and Opera), but as noted earlier it's limitations make it
only usable for the most simplest of cases.  As far as I know, there are no
gobject-introspection bindings for any of the other JavaScript engines.
Also, last time I checked NodeJS is not capable of being embedded which
removes it from the list of possibilities as well.

Long story short, it would be great to have JavaScript support for GPlugin
and thus Pidgin, however, the current state of gobject-introspection in
regards to JavaScript is terrible at best.

[1]
https://wiki.gnome.org/action/show/Projects/Seed?action=show&redirect=Seed
[2] https://wiki.gnome.org/action/show/Projects/Gjs?action=show&redirect=Gjs

Thanks,

--
Gary Kramlich <grim at reaperworld.com>


On Sun, Mar 8, 2015 at 6:04 PM, Alangi Derick <alangiderick at gmail.com>
wrote:

> Hello,
>      My name is Alangi Derick, i am from Africa and precisely Cameroon. I
> went through the idea list for Pidgin and i saw an interesting project i
> want work on. I am a web developer with very good knowledge in JavaScript,
> so i would like to contribute to this organisation by writing a JS plugin
> loader.
>      My idea is improving on GPlugin by writing a JS plugin loader for
> them in which Pidgin will now integrate GPlugin into their software. I
> don't know if this is a good idea but that is the approach i want to use.
> So i will like suggestions and comment on whether to continue with this
> idea or change to something else.
>     I wish to do this project as my GSoC project 2015, i am available in
> the channel and my irc nick is: d3r1ck and waiting for suggestions. Thanks
>
> Regards
> Alangi Derick Ndimnain
>
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> https://pidgin.im/cgi-bin/mailman/listinfo/devel
>



-- 
Thanks,

--
Gary Kramlich <grim at reaperworld.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pidgin.im/pipermail/devel/attachments/20150309/6d22bf2c/attachment.html>


More information about the Devel mailing list