Re:Introducing PyScript (summary of PyCon keynote)
by toyg on Thursday June 23, 2022 @07:42AM
(#31847692)
> Any optimizations at WASM level won't change the bytecode.
No, but the bytecode gets better and more efficient with new releases. The point at which it becomes acceptable depends on the use case, of course.
> it is unlikely that compiling to WASM will be more effective than to native code
It doesn't have to be more effective, it only has to reach a point where the penalty is worth paying. After all, JS is slower than C, but you accept that as a part of larger trade-offs on manpower, ease of deployment, etc. Once the trade-off becomes acceptable for the use case, absolute benchmarks stop being relevant.
> If you want to benefit from amazing optimizations that were done for JS, then it is better to transpile your Python code directly into JS.
Why stop there? At that point you might as well use JS, since you get the best speeds and chances are you'll have to deal with it anyway at some point. There are already solutions like that out there, and they are not popular precisely for that reason. The beauty of using WASM is that you'll probably never have to touch JS.
No, but the bytecode gets better and more efficient with new releases. The point at which it becomes acceptable depends on the use case, of course.
> it is unlikely that compiling to WASM will be more effective than to native code
It doesn't have to be more effective, it only has to reach a point where the penalty is worth paying. After all, JS is slower than C, but you accept that as a part of larger trade-offs on manpower, ease of deployment, etc. Once the trade-off becomes acceptable for the use case, absolute benchmarks stop being relevant.
> If you want to benefit from amazing optimizations that were done for JS, then it is better to transpile your Python code directly into JS.
Why stop there? At that point you might as well use JS, since you get the best speeds and chances are you'll have to deal with it anyway at some point. There are already solutions like that out there, and they are not popular precisely for that reason. The beauty of using WASM is that you'll probably never have to touch JS.