-
Notifications
You must be signed in to change notification settings - Fork 1
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
What issues exist with using Webassembly type compilers to transfer PHP stdlib? #1
Comments
Hi @roundmidnight - can I assume you're talking about this discussion here: asmblah/uniter#46 ? I've considered using Emscripten here, but not experimented with it much other than some experiments with a JS build of the PCRE library for full support of the Aside from the compiled size issue, I'd imagine another hurdle being the mapping of PHPCore's Cheers! |
Hi, thanks for the reply. The "discussion" referenced was unite project note on github at https://github.com/asmblah/uniter - phpruntime is the extended "full" runtime library. After pulling in phpcore, it installs the remaining builtin classes and functions, such as array_merge(...). Only a small subset of PHP's standard library has been implemented so far - please open a GitHub issue in the phpruntime repository if you would like to request something that is missing. Thinking about the existing state of PHP, Javascript, Typescript, Web Assembly worlds and where they are going, I see the ability to convert big chunks of existing or new backend PHP library to javascript, asm.js, or Web Assembly could have broad utility. Node & Web Assembly both have a lot of momentum, and a lot of potentiial, starting from a small base. Converting the standard library calls of PHP 7.X would be a key hurdle to running large chunks of existing PHP libraries. It's written in C. Some I'd try to figure out how much conversion could be done automatically, using tools like Cheerp, which leverages the large effort being put into creating Web Assembly as a new key target platform for C++, by way of LLVM. I also noticed that a few years prior, the Facebook implementers of HipHop compiler for PHP, had implemented an LLVM backend for their parser and intermediate language. But they later dropped it from the code because their interest was in JIT compilation of PHP, and the LLVM optimizations weren't giving them any significant performance boost in that case for their virtual machine type framework. But they may still have their version of the stdlib organized in an interesting way to support current PHP. |
Ah I see - this sounds like something we should definitely look into. I know there isn't much (or anything, really) in the way of documentation in the various Uniter repositories, so do feel free to ask anything you need either here or in the Gitter room: https://gitter.im/asmblah/uniter Thanks! |
I saw your message about how you have a project to reimplement more of the PHP stdlib in javscript. I was curious to know if you had tried to use some of the existing compilers to do that - e.g. https://github.com/leaningtech/cheerp-meta/wiki - and what the issues/hurdles/problems are in practice.
The text was updated successfully, but these errors were encountered: