4 ms·
Why would I want to run AutoCad inside a web browser instead of just downloading it? Why do web browser developers feel that "run existing C++ code in a web pag
by repolfx 8y ago
Why would I want to run AutoCad inside a web browser instead of just downloading it? Why do web browser developers feel that "run existing C++ code in a web page" is the most important thing facing the web?
And for the microcontroller, likewise - why would I want the overhead of a WASM VM on such a device? You won't fit V8 on it. Anyway, Graal can AOT compile programs down to small native binaries, but they're not that small at this time: give it a few megabytes of RAM and then yes it's possible.
- vardump 8y ago> Why do web browser developers feel that "run existing C++ code in a web page" is the most important thing facing the web? Well, not only browser developers. Often the corporate higher ups just suddenly want things like being able to run C++ based product in a web browser. I'd also rather use a native application, but others don't seem to always agree. > why would I want the overhead of a WASM VM on such a device? For example for rapid prototyping or as a way to safely provide plugins at runtime on the device without requiring to flash firmware (or more expensive, larger flash chip). Anyways, there'd be no VM (or GC) overhead during execution other than bounds checks, because you can just compile WebAssembly into native in one go. > You won't fit V8 on it. Why would you need V8? You'd just need something that can read WebAssembly bytecode, allocate registers and emit platform native assembler. I think direct 1-1 stack machine mapping codegen could be made in few tens of kB. A bit more for basic register allocation.
- repolfx 8y agoAre there any WASM runtimes that give (back) C/C++ level performance today, other than V8? I'm talking about software stacks that exist today rather than hypothetical future runtimes. I mean, if you're going to compile to WASM then compile again to native, why bother - why not just compile straight to native? Compilers like LLVM can insert any bounds checks required or wanted.
- vardump 8y ago> Are there any WASM runtimes that give (back) C/C++ level performance today, other than V8? People are currently working on them. Also 100% performance is not always necessary, getting to 50%ish shouldn't be that hard. That's plenty for a scripting engine replacement scenario, for example. Or for bit banging some GPIOs on a microcontroller. I think Mozilla's WASM engine is somewhat faster than WASM module in V8. The point is regardless you won't need a Javascript engine in the first place. > why not just compile straight to native To be able to run validation checks on the bytecode, so that you can still execute programs that are trusted only to a certain point. And to support multiple platforms. There are also a lot of platforms that aren't supported by LLVM or are not first tier targets.