4 ms·
I'm always interested in running WASM in microcontrollers, but AFAIK there is a severe limitation of WASM spec: the minimum size of heap (WASM memory page) is 6
by kbumsik 7y ago
I'm always interested in running WASM in microcontrollers, but AFAIK there is a severe limitation of WASM spec: the minimum size of heap (WASM memory page) is 64KiB, which is too big for many of microcontrollers. Otherwise a WASM module must run in stack-only mode.
Unless this problem is resolved I don't think WASM can be adopt widely in the world of microcontrollers.
- BubRoss 7y agoWhy is it a problem to not have the wasm heap with less than 64KB of memory? At that level you could deal with all your memory explicitly, by creating fixed size arrays.
- kbumsik 7y agoWe could and it is always better to have fixed sized arrays, but having no choices is totally different situation than doing something preferable. It will make your life much harder in some operations such as string manipulation. Having minimum 64KB of WASM memory is still a huge cost for mainstream microcontrollers. Most of dynamic memory stuff in embedded system requires at most ~10KB (and often less than 1KB) of memory. We are just throwing away the rest of the precious memory.
- jononor 7y agoOn a microcontroller one probably controls both the runtime and the application. Is there something that prevents configuring the run-time to have only 1kB memory (stack and heap)?
- sound_and_form 7y agoI'm working on a Wasm interpreter. Yes, Wasm ideally needs a smaller page size for embedded applications. But, the 64kB page size is more of an interoperability specification. If you own the environment and you're already doing bounds checking on memory accesses, you can treat the memory size as virtual and dynamically allocate only what is used.
- kbumsik 7y ago> But, the 64kB page size is more of an interoperability specification. Could you tell me a bit more on it? Does the particular number 64kB have something to do with?