Skip to content

WAMR integration & WASM/WASI compilers #2

Open
@KaruroChori

Description

Or the real Path of Pain with even less rewards at the end.

The integration of WAMR should enable vs:

  • To download distributed toolchains for arbitrary languages supporting wasm as target, and run them in pipelines.
    For example, a C compiler running in WAMR and generating a wasm output.
  • To run embedded scripts in one of the languages for which a toolchain is available, or to run pre-compiled wasm files.
  • To run native components compiled for wasm, not really for safety in this case but for portability.
    To the extreme of this, running the full app in vs after XML->C->wasm

All this is technically feasible, and would be more or less as complex as the other integration have been so far.
The only exception would be running native components, for which it is unclear the scope of the exposed interface:

  • Either we provide cfltk bindings, allowing real custom widgets to be defined and used, while wrapping them as ui_base objects
  • Providing access only to the same APIs needed by the XML builder, which are based on prepacked widgets without directly interfacing with fltk.
  • Both of them.

Subtasks:

  • Integrate an engine (WAMR)
  • Find a way to have llvm/clang running as wasm an build to wasm (no emscripten) spoiler, not working
  • Find a way to integrate assemblyscript as a language and embeding the compiler ahah. not even close

However...

Issues with WASM

Why is WASM so frustrating to work with!?! Virtually no compiler can compile itself into a functional wasm/wasi binary.
I am starting to regret the portability of java bytecode already. I never considered this day would have come.

AssemblyScript is barely able to do so with some magic tricks, but it still requires binaryen distributed alongside. Because of that, V8 is virtually the only runtime capable of running that combo.

There are also some LLVM patches to support wasm/wasi, but they all have been failures so far (at best half working). Aside from the fact it would end up being quite slow.

Notice: the wasmer registry seems to have a small collection of clang builds on it. It might be good enough to start experimenting.

If you have insights to share, please do that because I am really out of ideas.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions