Skip to content

Enhancement: WebAssembly Module Support #940

@r6915ee

Description

@r6915ee

Please check for duplicates or similar issues before creating this issue.

What is your suggestion, and why should it be implemented?

NDLLs, simply put, are quite unusual to work with. They're from the rather outdated NekoVM and have various limitations:

  • They are expected to be written in C++
    • Codename Engine expects macros and conditional compilation, which can slow compilation
  • NDLL projects are awkwardly structured
  • Platform-specific builds
  • Barely any documentation (BARELY!)

A format was recently devised called WebAssembly, which fulfills some of the same goals as NDLLs, but negates much of its flaws:

  • Can work with a far wider range of programming languages (e.g. Rust, Zig, C)
    • Little to no macro usage (macros are entirely dependent on the project, not the build process)
  • Language-specific project structure
  • Compile once, run anywhere
  • LOTS of documentation

WebAssembly can also be sandboxed quite easily.

Implementing a WebAssembly runtime in Codename Engine could really help with implementing libraries that are difficult to work on if done through NDLLs.

That being said, there would need to be platform-specific changes. C++ builds could theoretically use a runtime like Wasmer, which has C headers available, but Build.xml would need to be supplied correctly. Modern web browsers typically have a runtime built-in, but the API would need to be interacted with properly with the usage of Lime.

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