Hacker News new | ask | show | jobs
by Benvie 4907 days ago
I had considered this, but it would also require the other end of it. RPython is basically compiled to C which is compiled to machine code. The ultimate output format for this needs to be JavaScript, something like the form specified by https://github.com/dherman/asm.js. So we need JavaScript (ES6) coming in one end and asm.js coming out the other end. At this point the only remaining usable pieces from PyPy are the processing that happens in the middle. Admittedly this is a huge part of it and would still be very valuable to have access to, but there's probably a better approach to this than having to redo both ends of the pipeline, and losing the ability to self-host the compilation process in a JavaScript engine (browser).

Perhaps pairing PyPy with emscripten would be the ideal solution for this, but that would have to be a completely new project because nothing that's currently in Continuum would be useful for that (except probably the standard library that's written in ES6 and executed in the VM).

1 comments

OK, I understand. I was under the impression that the purpose of the meta-interpreter was to create a virtual machine outside of the browser, but having re-read your README, I now understand this isn't the case.

Still, I would recommend trying to reuse PyPy's infrastructure, even if only for the short term. An immense amount of time and thought has gone into creating it that you would end up replicating otherwise.

Besides, PyPy doesn't just target C, it also target's JVM and .Net, so in writing a new backend for JS, you wouldn't be working against the grain.