4 ms·
Running a javascript interpreter, written in C and cross compiled to WASM, in a browser, does feel like a joke. However, it probably is most simple and effectiv
by CJefferson 7y ago
Running a javascript interpreter, written in C and cross compiled to WASM, in a browser, does feel like a joke. However, it probably is most simple and effective way of running user submitted code in a sandbox which they can't escape from.
- bsaul 7y agoIndeed. The more i read about wasm technology, the more i agree with people that think it's going to change everything.
- pjmlp 7y agoI just get déjà-vu from all virtual machines that have been designed since the 60's.
- bsaul 7y agoExcept it’s already proven to run in the most hostile environment : the browser, with just random code from internet. This is where the JVM stumbled.
- pjmlp 7y agoIt is not proven at all. Black hat hackers are yet to be bothered to attack it. Those WASM related CVEs will start coming when they do. For starters it lacks bounds checking on memory access inside the sandbox, which is an easy target if the module happened to be originally written in C, C style C++, or any other systems language without bounds checking enabled by default. Not even its Harvard architecture based design can help there. The JVM stumbled in library logical errors implementation and FOSS devs hate. While WASM for whatever reason has become the new hip child, with many acting as if it hasn't never been done before. Plenty of IoT devices with sandbox based VMs for download of hostile code have been designed throughout the years. WASM is just yet another one. I think the biggest punishment for all that cheering will be the return of Flash, ActiveX, Java, ..., using Canvas/WebGL/WebGPU and now you cannot turn it off. Welcome to the new Web experience.
- bsaul 7y agoyou seem concerned about security (which was a big factor against the flash VM), but i was more thinking about performance and integration with the environment. Java applets were slow, couldn’t run on most mobile browsers and were sticking out like a sore thumb on each page they ran into. I was talking about the javascript VM (not specifically wasm), which has been the target of hackers for years and run fine on even modest mobile phone. i understand running VM assembly code directly may change a few things relative to security, but other than that we pretty much have the guarantee that wherever javascript is able to run today, wasm will be, and the experience is going to be better (don’t see why wasm couldn’t call the DOM once browser decide it)
- AgentME 7y ago>For starters it lacks bounds checking on memory access inside the sandbox Right, but you can't use that to escape the sandbox.
- pjmlp 7y agoWhat matters is subverting the sandbox behavior, no need to escape it.
- deleted 7y ago[deleted]
- jml7c5 7y ago>Running a javascript interpreter, written in C and cross compiled to WASM, in a browser, does feel like a joke. Every day I see more clearly how prophetic "The Birth & Death of Javascript"[1] (2014) was. I'd love to pluck 1996 Brendan Eich into the future and show him how far his little programming language would go. [1]: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- BrendanEich 7y agoI was closely involved as CTO and then SVP of Engineering at Mozilla from the inceptions of both WebGL (originally Canvas 3D) and asm.js (see http://asmjs.org/ http://asmjs.org/ for docs), which led to the 4 day port via Emscripten or Unreal Engine 3 and Unreal Tournament from native to web and in Firefox at 60fps. This prefigured WebAssembly, which came in 2015 after it was clear from MS and the V8 team that one VM (not two as for Dart or PNaCL) would win. Gary added the insight that system call overhead is higher than VM safety in one process (he may have exaggerated just a little) to predict migration of almost all native code. The general idea of a safe language VM+compiler being smaller and easier to verify than a whole OS+browser-native-codebase, as well as having lower security check overhead, I first heard articulated by Michael Franz of UCI, and it inspired my agenda at Mozilla that led to the current portable/multiply implemented JS+WebAssembly VM standard.