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

Usage in Iodide #23

Open
filips123 opened this issue Mar 16, 2019 · 1 comment
Open

Usage in Iodide #23

filips123 opened this issue Mar 16, 2019 · 1 comment

Comments

@filips123
Copy link

It would be great to use PHP in Iodide. It also uses languages (currently only Python) that are compiled to WebAssembly so it should not be hard to do this.

For details how to do this see iodide-project/iodide#1637.

@filips123
Copy link
Author

@oraoto I started implementing a PHP plugin. You can see discussion in iodide-project/iodide#1637. I have a few questions and I need some help from someone that knows how exactly PIB works :)


From iodide-project/iodide#1637 (comment):

The evaluate function should return the return value of whatever is run, not just a success/fail. If that is what the PHP wasm library you are using does, that would have to be changed in order to the get the return value out.

Iodide expects that evaluate function (which calls phpModule.ccall and executes code) return the return value of script. The problem is that currently just returns 0 of execution is OK and -1 of it is wrong.

So, phpModule.ccall would need to be changed to return the return value. Another possible solution would be to get it from another source.


From iodide-project/iodide#1637 (comment):

To answer your question about how Level 2 can be acheived: that's very specific on the implementation of the language itself. In Python, for example, there is a whole C API to handle Python data types, and this can be used (and even called directly from Javascript) to convert Python data types to Javascript data types. I don't know anything about the implementation of PHP, but if you're lucky, it has something similar. You can look here for how that's done in Python, but it would mostly have to be converted to PHP-specific calls.

Is it possible to handle PHP data types, like in Python? How can this be done?

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

No branches or pull requests

1 participant