Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch extensions from IDL to HNI #1480

Closed
simonwelsh opened this issue Jan 3, 2014 · 28 comments
Closed

Switch extensions from IDL to HNI #1480

simonwelsh opened this issue Jan 3, 2014 · 28 comments

Comments

@simonwelsh
Copy link
Contributor

@simonwelsh simonwelsh commented Jan 3, 2014

This is more a longish-term task list issue to help track migrating extensions from IDL to HNI. I'll try to keep it updated as the migration progresses and include hints/types/recommendations as I come across them.

As part of this I'm also tidying up some of the API where possible, trying to move away from Variant if only a single type's expected/returned and getting everything working with ZendParamMode.

I'm using 512ecad as an example of what to do.

Existing idl files:

My current observations: (please correct if these are wrong)

  • You can't use closures inside a systemlib.php
  • Type hint parameters and return types (see the aforementioned commit for examples)
  • Feel free to move C++ methods/functions into PHP if it makes sense and is easy to do so.
@staabm
Copy link
Contributor

@staabm staabm commented Jan 3, 2014

doing all at once could make it really hard to review..?

@simonwelsh
Copy link
Contributor Author

@simonwelsh simonwelsh commented Jan 3, 2014

Also, would be really boring to do ;)

I was thinking of using this more as organising/tracking and then doing one extension at a time (for instance, I'm currently doing ext/reflection) and keeping a record of things that I've discovered if others want to help.

@staabm
Copy link
Contributor

@staabm staabm commented Jan 3, 2014

ah got it now... ;-).

@scannell
Copy link
Contributor

@scannell scannell commented Jan 3, 2014

Thanks for working on this @simonwelsh!

@JoelMarcey
Copy link
Contributor

@JoelMarcey JoelMarcey commented Jan 7, 2014

This is awesome. Making sure @ptarjan and @sgolemon are a permanent part of this thread too...

@ptarjan
Copy link
Contributor

@ptarjan ptarjan commented Jan 7, 2014

Wow, awesome! I'd love if the IDL machinery died.

@jdelong and I were chatting about this, and migrating them is a great time to clean them as they move over.

  1. Move anything that can be done in PHP, into PHP (constant declaration, wrapper functions, anything that doesn't call C++)
  2. Remove any hand-rolled type checking
  3. Check the zend tests for any low hanging incompatibility fruit
This was referenced Jan 10, 2014
@Pomyk
Copy link
Contributor

@Pomyk Pomyk commented Jan 14, 2014

I started working on mongo, but it will take some time ;)

@awakmu
Copy link

@awakmu awakmu commented Jan 16, 2014

Hi all,

What is an IDL? What it's differents with HNI?

And I know about HNI from the last release note: Hhvm Native Interface -> Possibility to call c++ function from PHP.
But I still not sure about these two and can't found any documentation about them.

-Aris

@elgenie
Copy link
Contributor

@elgenie elgenie commented Jan 18, 2014

Thanks for taking this on @simonwelsh . Are you using a script that reads in .idl.json and produces the .php declarations? If so, is that script checked in as part of these conversion commits?

@simonwelsh
Copy link
Contributor Author

@simonwelsh simonwelsh commented Jan 19, 2014

@elgenie No, I'm doing it all by hand, basing of the PHP docs, then what the function actually returns. I've found that the IDL files aren't accurate enough to convert directly, so just deciding to skip the segfaults from mismatching types.

@WizKid
Copy link
Contributor

@WizKid WizKid commented Jan 19, 2014

tools/docskel/docskel.php uses the Zend docs to create a HNI skeleton. At least I think that was the script I used when I created that start of mysqli. But @sgolemon should know more.

@simonwelsh
Copy link
Contributor Author

@simonwelsh simonwelsh commented Jan 20, 2014

@WizKid Sweet, that'll save me copy+pasting the descriptions. Still have to manually do the signatures, given how many edge cases the signature in the docs doesn't cover. Or things like bzopen with completely undocumented (but tested) features (it can take an open file resource instead of a filename).

@WizKid
Copy link
Contributor

@WizKid WizKid commented Jan 20, 2014

@simonwelsh Yea it is far from perfect but it usually give you a good start.

@igorastds
Copy link

@igorastds igorastds commented Feb 4, 2014

What's a reason for having Bountysource record for this one? Is it actual? (I can help with porting..)

@scannell
Copy link
Contributor

@scannell scannell commented Feb 4, 2014

@igorastds: There is a lot of otherwise relatively thankless work to do here that, once complete, will allow us to clean up the extensions story. It is to encourage community assistance with that.

hhvm-bot added a commit that referenced this issue Oct 30, 2014
Summary: Convert system/idl/function to HNI.
Also fixes compatibility with PHP, when func_get_arg() is called with non-integer parameter.

Part of #1480.
Closes #3942

Reviewed By: @​svcscm

Differential Revision: D1608060

Pulled By: @ptarjan
@Orvid
Copy link
Contributor

@Orvid Orvid commented Sep 25, 2015

Just a poke to point out this hasn't been updated in almost a year. Also, I just noticed that this has a $1000 bounty on it on bountysource.

@JoelMarcey
Copy link
Contributor

@JoelMarcey JoelMarcey commented Sep 25, 2015

@sgolemon's got this! She has asio and simplexml in the pipeline; next up is collections.

@simonwelsh
Copy link
Contributor Author

@simonwelsh simonwelsh commented Jan 29, 2016

Only the remainder of collections left :D

@hhvm-bot hhvm-bot closed this in 1f9180e Apr 14, 2016
@simonwelsh
Copy link
Contributor Author

@simonwelsh simonwelsh commented Apr 14, 2016

Woot woot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.