Re: Compilation to Javascript
- Posted by ghaberek (admin) Dec 12, 2017
- 4482 views
petelomax said...
Something I have been wanting to try with Phix is compiling it to javascript, however I am struggling with even the first little baby-steps.
One of the better ones seems to me to be Pyjs, at least in terms of examples.
Does anyone have any suggestions for me, such as/specifically this bit of Phix/OE should be translated to this bit of (working) javascript?
Alternatively, just some (simple/working) javascript that you'd love to be able to do in Phix/OE.
Neat! I'd be very interested to help.
Potential approaches, in order of increasing difficulty:
- Euphoria-to-JavaScript translator (a la the existing translator)
- Euphoria interpreter written in JavaScript
- Euphoria-to-WebAssembly compiler (possibly via LLVM)
Potential challenges to overcome:
- Euphoria types and builtins (via native JS classes?)
- Rebuilding the standard library in JavaScript
- Navigating the DOM in the browsers (it's very object oriented)
-Greg