3 ms·
Requiring any implementation who wants to read the data to be able to run webassembly means the format is ill-suited to any environment which aims to reduce dep
by mgaunard 1y ago
Requiring any implementation who wants to read the data to be able to run webassembly means the format is ill-suited to any environment which aims to reduce dependencies or bloat.
- aDyslecticCrow 1y agoWasm is pretty simple; Don't confuse it with the "web" part of the acronym. And as others point out; wasm is a backup. You can use native binding without going through wasm, which provide better performance,
- mgaunard 1y agoit needs a compiler to convert it to machine code, it also has a non-trivial runtime...
- Bigpet 1y agoDon't know if you need to compile, you might want to but I think interpreting might seem reasonable if size/complexity is a concern. Is the runtime really that large? I know with wasm 2.0 with garbage collection and exceptions is a bit of a beast but wasm 1.0? What's needed (I'm speaking from a place of ignorance here, I haven't implemented a WASM runtime)? Some contiguous memory, a stack machine, IEEE float math and some utf-8 operations. I think you can add some reasonable limitations like only a single module and a handful of available imports relevant to the domain. I know that feature creep would almost inevitably follow, but if someone cares about minimizing complexity it seems possible.
- drob518 1y agoIf you view WASM as a worst case fallback, then you could implement a simple interpreter and transcode the file to something that your program has native decoders for. Yes, that might be slow, but at least the data remains usable. At least, that’s my understanding. I don’t have a dog in the hunt.
- Certhas 1y agoIf you have a native decoder you don't need to run WASM. It's literally in the abstract.
- Someone 1y agoBut given a file in this format, you cannot know whether your native decoder can read it without running WASM; the file you read may use a feature that was invented after your library was written.