Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I don't get this part
> If it is not, then why don't browsers transpile JS to webassembly?
Is it not the opposite? WebAssembly is transpiled into JavaScript? -
hack64562yI don't know how webassembly works but probably because transpiling cost + running webassembly is slower than just running js. Idk
-
̶I̶ ̶d̶o̶n̶'̶t̶ ̶g̶e̶t̶ ̶t̶h̶i̶s̶ ̶p̶a̶r̶t̶
̶>̶ ̶ ̶I̶f̶ ̶i̶t̶ ̶i̶s̶ ̶n̶o̶t̶,̶ ̶t̶h̶e̶n̶ ̶w̶h̶y̶ ̶d̶o̶n̶'̶t̶ ̶b̶r̶o̶w̶s̶e̶r̶s̶ ̶t̶r̶a̶n̶s̶p̶i̶l̶e̶ ̶J̶S̶ ̶t̶o̶ ̶w̶e̶b̶a̶s̶s̶e̶m̶b̶l̶y̶?̶
̶I̶s̶ ̶i̶t̶ ̶n̶o̶t̶ ̶t̶h̶e̶ ̶o̶p̶p̶o̶s̶i̶t̶e̶?̶ ̶W̶e̶b̶A̶s̶s̶e̶m̶b̶l̶y̶ ̶i̶s̶ ̶t̶r̶a̶n̶s̶p̶i̶l̶e̶d̶ ̶i̶n̶t̶o̶ ̶J̶a̶v̶a̶S̶c̶r̶i̶p̶t̶?̶
I got it all mixed up. -
rantydev2962yJS is often JIT compiled to bytecode that runs in the browser.
Webassembly is an assembly language that targets directly the VM.
The main reason why WASM is more efficient that JIT JS is types: JS needs to do a lot of runtime checks that aren't needed in ahead of time compiled languages (like WASM -
rantydev2962y@rantsauce exactly. It would be impossible to ahead of time compile a dynamic language :)
Is the JS VM in browsers as efficient as the webassembly interface?
If it is not, then why don't browsers transpile JS to webassembly?
I realize JS does do JIT in a lot of browsers (all?).
question
transpile
webassembly
javascript