Polycompiler: Merge Python and JavaScript code into one file that runs in both
1–10 of 17 posts
Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#2Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#3Ok, now write your code in a metalanguage(i believe fut might work), and now we can write once and run on two different engines.
Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#4Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#5Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#6You could also write your app in Haxe instead and cross compile to Javascript, Python, C++, Java, Lua,...
Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#7Ok, now write your code in a metalanguage(i believe fut might work), and now we can write once and run on two different engines.
Maybe we can convince Marc Feeley to write a backend for Gambit that targets this.
I understand your comment was tongue-in-cheek, but we certainly have an interest in cross-language interoperability! You can check out our work here:
- https://try.gambitscheme.org is Gambit compiled to JavaScript with the universal backend. Evaluate \alert("hello!") at the REPL to see the JSScheme Syntactic FFI in action.
- https://codeboot.org is our own Python interpreter running in the browser. It has a PythonJS FFI. Evaluate \alert("hello!") at the REPL to test it out. You can even import JS libraries using the standard Python syntax by replacing the identifier with a string: import "https://mycdn.com/mylibrary.js".
- https://github.com/gambit/python is a Gambit module that integrates Gambit with CPython, using the same syntactic FFI. You can import PyPI modules from Gambit.
References to conferences/papers describing these features can be found on my GH profile (https://github.com/belmarca). AMA if you wish!
Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#8You could also write your app in Haxe instead and cross compile to Javascript, Python, C++, Java, Lua,...
This seems to be intended as an interesting experiment (in the same genre as things like quines). There are obviously more production-ready ways to compile code for multiple runtimes.
Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#9Earlier quoted context omitted.
Maybe we can convince Marc Feeley to write a backend for Gambit that targets this.
Hey, I'm writing this from Pr Feeley's lab :) I understand your comment was tongue-in-cheek, but we certainly have an interest in cross-language interoperability! You can check out our work here: - https://try.gambitscheme.org is Gambit compiled to JavaScript with the universal backend. Evaluate \alert("hello!") at the REPL to see the JS Scheme Syntactic FFI in action. - https://codeboot.org is our own Python interpr…
Re: Polycompiler: Merge Python and JavaScript code into one file that runs in both
#10You could also write your app in Haxe instead and cross compile to Javascript, Python, C++, Java, Lua,...
I ported an entire AS3/Flash game to Haxe that my friends had written during our college years, as a kind of "thank you" present for ten years of friendship (adding mobile, cross-platform, gamepad controller, netplay and other things).
While the tooling was spotty, I found the experience wonderful! Haxe felt like a decent language with laudable goals and a nice community.
I hope one day I find another reason to work with Haxe.
Does anyone have any project that is using Haxe in production? Would love to hear about such stories!!