Skip to content

Embedded devices: i8/i16 and memory pages less than 64KiB #899

Closed
@Ekleog

Description

@Ekleog

Hello,

I have just read this post that appears to confirm that WebAssembly is still willing to have a future in embedded devices. So here is my feedback in trying to make WebAssembly run on such a device:

  • Mandatory support for i32/i64 is not nice when the hardware only offers i8 / i16 arithmetic. It's possible to work around it by re-implementing primitives, but it'd be great if i8 / i16 types just existed. Because then, assuming the application compiled in WebAssembly uses them, the polyfills would just not be used most of the time. Ideally, there'd be a wasm16 target that'd support only up to i16 arithmetic in addition to having a 16-bit address space, but that's maybe a bit too much to hope for.
  • 64KiB per memory page is a lot. The devices I'm running on just don't have that much memory. So currently I compile with a patch to LLVM to reduce the memory page size to 1 byte, which makes things work, but are no longer officially wasm. If some way was available for applications to claim that they use less than a full page existed, this problem would vanish.

Hope this feedback can help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions