-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support for other languages #1637
Comments
@filips123 we'd love to see an example with any of these that have been compiled to WebAssembly! In some cases, adding a language is quite easy. In others, it is often much more difficult. The details matter a lot. Our team doesn't have a lot of bandwidth to add other languages, so we're hoping the community can contribute here. Once you have a language compiled, making a plugin for Iodide is pretty straightforward. Take a look at our docs here: https://iodide-project.github.io/docs/language_plugins/ |
@hamilton I didn't test any of them so I can't provide you any examples. |
I will try to do something for PHP. There is already project to compile PHP to WASM, but it needs to be added as plugin. I created oraoto/pib#23 for this. Do you know how to fix those errors? Also, how can communication (level 2+) be implemented between language and JS? |
@filips123 fantastic - I'll take a look at this once my work week has gotten under way. I think @mdboom may be able to give you some pointers re: level 2 and beyond (or point you to the source where he handles things in Pyodide, for inspiration). Worth noting that this kind of wasm use case is relatively new, so there aren't really that many domain experts here. You may have to make your own fire! |
@filips123: Thanks for working on this. As to the specific error -- The gist is loading With that, I was able to get the
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. |
Some problem with PHP plugin is that it sometimes needs some time to initialize. In the original project, the module will call some function after it is initialized (source - see
What should The problem is that execution is async. When execution is done, it will call
I know... I just add it until output will have better handling. I will try to do level 2 later, because first level 1 needs to be done :) |
I think you could just follow the pattern you linked to -- set the
It should be the return value. |
Yes, but what should
If I am correct, the return value can't be changed by the script. It is just "compiler status", so when the code is correct it is "0". |
I'm sorry, I misunderstood the question. Iodide expects the language plugin code to define a
|
The |
@filips123 any progress on this front? |
@hamilton I currently don't have much time, but I will continue working. I contacted author of PHP In Browser about questions for return value and level 2. |
Has anyone made a plugin for Typescript? Happy to give it a go, but dont want to duplicate effort |
No one to my knowledge has done so! A typescript plug-in would be welcome.
…On Sat, Mar 23, 2019 at 11:08 AM Simon Frost ***@***.***> wrote:
Has anyone made a plugin for Typescript? Happy to give it a go, but dont
want to duplicate effort
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1637 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAF1945LlzDH5R_ZqHvmesNpOwlVh9LIks5vZm2WgaJpZM4b2-lQ>
.
|
i'm going to close this issue because it's a bit broad (and more than we can tackle in general), but please do feel free to file issues regarding difficulties you encounter during specific language implementations! |
@bcolloran Maybe create some tracking system for language suggestions and implementations. |
@filips123 i'm open to suggestions about how to track that, but to expand on this a little: we are a very a small team, and unfortunately we don't have the resources to respond to suggestions that we implement language X. What we can do is offer support when someone from the community undertakes an implementation of language X -- if there are specific bugs or questions that come up in the process of such an implementation, then we can try to help with specific issues. but as much as we would love to do so, we just don't have the resources to help with issue like "please implement language X", so they just end up as noise in the tracker and dilute the signal. I hope that makes sense I suppose we could do something like create a repo of language plugins or language plugin definitions so that there is a place where people can go (in addition to our docs https://iodide-project.github.io/docs/language_plugins/ ) to see what language plugins exist and discuss implementations etc. I'm not sure something like that would really be helpful in the end, but we can discuss ideas like that if you wish. |
Something like this would probably be good. |
There should also be support for other languages:
This is because some of them are very used in web development and some of them provide research tools. There are already some projects to compile them to WebAssembly.
The text was updated successfully, but these errors were encountered: