Nishant Gupta
2016-06-02 13:38:43 UTC
Hi, My name is Nishant Gupta. I'm currently working on extending swig to
support HHVM <http://hhvm.com>, as part of Google Summer of Code 2016,
under the guidance of Olly. HHVM is a JIT compiler for PHP developed by
Facebook. I am using the extension API
<https://github.com/facebook/hhvm/wiki/Extension-API> provided by HHVM for
this purpose. (N.B. This mail is in HTML, so I request you to turn on html.
The mail only contains hyperlinks, nothing creepy)
I have implemented parts of wrapping constants and functions, and would
kindly request you to please review these parts (especially the function
wrapper). The repo is located at github.com/ng420/swig-hhvm . The module
can be found at Source/Modules/hhvm.cxx
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/hhvm.cxx>
I'm currently facing a few problems while implementing overloaded
functions. I have implemented code to wrap each variant of the overloaded
function. Now, I wish to add a 'switching function' as done by other
modules. However, the format of my function is functionname(arg1, arg2..),
and I couldn't find how to dispatch
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/hhvm.cxx#L202>
in this format. Thanks to Olly, I came to know there is $commaargs
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/overload.cxx#L389>,
which is only used by chicken (module). However, it generates a leading
comma
<https://github.com/ng420/swig-hhvm/blob/master/sample/ext_example.cpp#L243>,
and I'm not sure how to get rid of it. Should I go for creating a similar
$commaargs (call it $printedargs), or should I just amend the existing one
and reflect the changes in checken.cxx? Simply adding a leading comma at
$commaargs in chicken.cxx
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/chicken.cxx#L1308>
can break things in case of zero arguments, and I am not sure if by
customizing the format string I can achieve the desired effect.
Another issue is returning result. When the overloaded function is selected
(by the switching function), I wish to return the result of non-void
functions. How can I achieve that?
A simple fall-back to above issues is to completely discard the generation
of switching function, which, as I understand, java and C# do. What are
your thoughts?
Thanks
Nishant
support HHVM <http://hhvm.com>, as part of Google Summer of Code 2016,
under the guidance of Olly. HHVM is a JIT compiler for PHP developed by
Facebook. I am using the extension API
<https://github.com/facebook/hhvm/wiki/Extension-API> provided by HHVM for
this purpose. (N.B. This mail is in HTML, so I request you to turn on html.
The mail only contains hyperlinks, nothing creepy)
I have implemented parts of wrapping constants and functions, and would
kindly request you to please review these parts (especially the function
wrapper). The repo is located at github.com/ng420/swig-hhvm . The module
can be found at Source/Modules/hhvm.cxx
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/hhvm.cxx>
I'm currently facing a few problems while implementing overloaded
functions. I have implemented code to wrap each variant of the overloaded
function. Now, I wish to add a 'switching function' as done by other
modules. However, the format of my function is functionname(arg1, arg2..),
and I couldn't find how to dispatch
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/hhvm.cxx#L202>
in this format. Thanks to Olly, I came to know there is $commaargs
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/overload.cxx#L389>,
which is only used by chicken (module). However, it generates a leading
comma
<https://github.com/ng420/swig-hhvm/blob/master/sample/ext_example.cpp#L243>,
and I'm not sure how to get rid of it. Should I go for creating a similar
$commaargs (call it $printedargs), or should I just amend the existing one
and reflect the changes in checken.cxx? Simply adding a leading comma at
$commaargs in chicken.cxx
<https://github.com/ng420/swig-hhvm/blob/master/Source/Modules/chicken.cxx#L1308>
can break things in case of zero arguments, and I am not sure if by
customizing the format string I can achieve the desired effect.
Another issue is returning result. When the overloaded function is selected
(by the switching function), I wish to return the result of non-void
functions. How can I achieve that?
A simple fall-back to above issues is to completely discard the generation
of switching function, which, as I understand, java and C# do. What are
your thoughts?
Thanks
Nishant