Absytree icon indicating copy to clipboard operation
Absytree copied to clipboard

Compile to wasm instead of js

Open Nimaoth opened this issue 1 year ago • 0 comments

Currently the browser version is based on js

Problems:

  • Slow (bad Nim->JS codegen, interaction with DOM (technically not necessary))
  • Optimizations are either good for native and bad for js or the other way round
    • E.g. Native prefers object, stack allocation etc., JS prefers ref object and preventing copies
  • Lots of wrapping around APIs because JS backend and native backend are so different
  • Issues with big int

Advantages of wasm:

  • Closer to native backend -> ptr, cast etc work properly
  • Better performance

Rendering should probably switch to WebGL

Open questions:

  • How to do interface between WASM <-> JS with async functions

Nimaoth avatar Jun 29 '24 15:06 Nimaoth