2 ms·
The documentation is pretty minimal here, so I'm wondering if this has anything to do with WebAssembly[1]. If not, wouldn't it make more sense to target WebAss
by smt88 11y ago
The documentation is pretty minimal here, so I'm wondering if this has anything to do with WebAssembly[1].
If not, wouldn't it make more sense to target WebAssembly?
1. http://arstechnica.com/information-technology/2015/06/the-web-is-getting-its-bytecode-webassembly/ http://arstechnica.com/information-technology/2015/06/the-we...
- techdragon 11y agoThe goal is being able to pickle something like a Django template and then run it client side. It's based on past work that has shown its possible to build bytecode interpreters without much code. It's not as much about targets and cross compilation or anything like coffeescript. It's about trying to run existing Python bytecode with as little code as possible.
- smt88 11y agoI'm not sure I was clear or understand what you're saying. It sounds like you mean this: Python source -> Python bytecode -> Python bytecode interpreter -> JavaScript engine -> browser And what I meant was this: Python source -> WebAssembly bytecode -> browser Does that make sense? It's not like there's a bunch of Python bytecode sitting around that we can't possibly re-compile. It makes a ton of sense to create a Python-to-WebAssembly compiler, but very little sense to spend time adding functionality to a browser that's specific to Python bytecode.
- dragonwriter 11y ago> wouldn't it make more sense to target WebAssembly? I don't think it would. A Python source -> WebAssembly bytecode compiler needs updates with every enhancement to the Python language. An engine for running Python bytecode in the browser only needs updates with change to Python bytecode, which is presumably more stable than the language -- all the language-side work can be shared with the mainline CPython implementation.