Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile to wasm instead of js #14

Open
Nimaoth opened this issue Jun 29, 2024 · 0 comments
Open

Compile to wasm instead of js #14

Nimaoth opened this issue Jun 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Nimaoth
Copy link
Owner

Nimaoth commented Jun 29, 2024

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 Nimaoth added the enhancement New feature or request label Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant