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

Cross-compilation to WASM? #121

Open
johncalvinyoung opened this issue Sep 23, 2019 · 2 comments
Open

Cross-compilation to WASM? #121

johncalvinyoung opened this issue Sep 23, 2019 · 2 comments

Comments

@johncalvinyoung
Copy link

johncalvinyoung commented Sep 23, 2019

Has anyone looked into trying to compile the C# to WASM? This library appears to be well ahead of any non-GPL library in JS, and I'd love to be able to bind it in to some heavy JS geometry work I'm doing. Not sure of the current state of the C#-to-WebAssembly ecosystem though...

@visose
Copy link

visose commented Sep 24, 2019

From what I understand there are two ways to approach this:

  1. Ahead of time compilation to wasm
    This is the route Unity takes, see:
    https://blogs.unity3d.com/2018/08/15/webassembly-is-here/
    Unity's is probably the most tested/mature and performant.

  2. Only the runtime is compiled to wasm
    Mono has a wasm version of the runtime, this is used by Blazor (a SPA framework):
    https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor
    You can then run .NET dlls directly in the browser, they don't need to be compiled/transpiled.
    The main issue is performance, you are basically running a virtual machine (.NET) on top of a virtual machine (the javascript vm).

@johncalvinyoung
Copy link
Author

Thanks for those details! I'm looking into the Unity approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants