On Wed, May 02, 2018 at 02:41:59PM +0100, Ramy Elkest wrote:
Hi all,
As a quick introduction, I'm Ramy Elkest, a student at Georgia Tech and
one of the lucky ones selected by libvirt for this year's Google Summer
of Code.
During the next months I'll be working with my mentors Martin Kletzander
and Erik Skultety to introduce nodejs to libvirt's family of bindings.
In short, the aim is to generate the nodejs bindings from the XMLs (as we
do for python).
On a very high level my current approach is as follows:
- Re-use libvirt-python's generator (mainly the parser) possibly re-written
in node (TBD)
Personally I would put focus on outputting the Node code,
rather than porting the generator from Python to Node,
since the former is more immediately useful to developers.
By all means port the generator to Node later at the end
once the bindings are succesfully being generated.
- Draw from existing projects (eg. node-libvirt) to generate
preliminary
templates
There are a few things to look into before jumping in:
- Code generation framework (or lack of)
- Node Abstractions for Node (NAN) vs. Node-API (N-API)
If you have preliminary thoughts / background info about any of the above,
I'd love to hear it. I'm usually around on irc, "relkest".
Even if you try to auto-generate APIs, the libvirt API complexity and
variance is such that you'll inevitably end up manually writing a good
number of API bindings, as we've done in Python. A key thing to thus
understand is what level of coverge you have of libvirt APIs. So I
would suggest writing a test that analyses the combination of the
manual code and autogenerated code, to validate that together they have
100% API coverage.
We did this in the python binding with sanitytest.py or in the Go
binding with api_test.go or Perl with t/030-api-coverage.t if you
want insipiration.
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|