4 ms·
Not random code, but specifically written with type checking should be doable. There was an asm,js subset for example.
by mixmastamyk 7y ago
Not random code, but specifically written with type checking should be doable. There was an asm,js subset for example.
- ufo 7y agoCalling asm.js a subset of Javascript is a bit of a stretch. It looks nothing like idiomatic Javascript, and was more of a low-level statically-typed language dressed up in Javascript clothing. At some point they realized that representing this low-level code as Javascript text instead of as specially-designed bytecode added a significant ammount of parsing and compilation overhead, which was one of the initial motivations for the creation of WebAssembly. If I had to sum up WASM in one sentence, it is that it is kind of like the JVM, except that its instruction set was designed specifically for running programs downloaded from the web. Special attention was paid to security and startup latency.
- cwp 7y agoErm... the JVM was also designed specifically for running programs downloaded from the web. Special attention was paid to security and startup latency. Javascript got its name because it was the only other language designed to be downloaded and executed in a browser!
- firethief 7y agorpython might be a better example