Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ncave/dna-redux
Running C#/F# code in Node.js or Browser with WebAssembly
https://github.com/ncave/dna-redux
csharp dotnet dotnetanywhere fsharp wasm webasm webassembly
Last synced: 3 days ago
JSON representation
Running C#/F# code in Node.js or Browser with WebAssembly
- Host: GitHub
- URL: https://github.com/ncave/dna-redux
- Owner: ncave
- License: mit
- Created: 2017-06-22T13:50:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-29T01:39:49.000Z (about 1 year ago)
- Last Synced: 2024-10-31T21:35:10.152Z (10 days ago)
- Topics: csharp, dotnet, dotnetanywhere, fsharp, wasm, webasm, webassembly
- Language: F#
- Homepage:
- Size: 4.69 MB
- Stars: 91
- Watchers: 15
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dna-redux
Playground for running C#/F# code in Node.js, Browsers or Native (x86/ARM).
- The CIL is running in a portable .NET runtime called DotNetAnywhere (DNA).
- For Node.js/Browser targets it's compiled to WebAssembly with Emscripten.Based on the excellent works of:
- @chrisdunelm https://github.com/chrisdunelm/DotNetAnywhere
- @SteveSanderson https://github.com/SteveSanderson/Blazor
- and contributorsFeatures:
- Supports both C# and F#.
- Runs in Node.js, Browsers or Native (x86/ARM).
- Uses .NET Core 2.0 (targeting netstandard1.3 and above).
- the BCL (corlib) implementation is somewhat minimal.Changes vs stock DNA/Blazor:
- added F# support.
- Performance updates.
- JIT updates and fixes.
- corlib updates and fixes.
- JavaScript interop updates.
- Razor/SPA removed for clarity.Disclaimer:
- This is just an experiment to see how far can this be taken without too much effort and what the performance looks like. Obviously it would be nice to have faster GC or highly optimized JIT like RyuJIT to target WebAssembly, but you can still have fun with this now and see what the future of web development may look like.Building:
- `dotnet build && npm install && npm run build`
- or just use `build.cmd` to build, VS Code to edit/run.Running:
- Running in Node.js: `npm start`
- Running in Browser: `npm run server` to start a web server, then go to localhost:5000 (hint: look in the Console output)
- Running as Native: see src/DNA/native- You can run it in VS Code, just select a debug config and hit F5.
- The C#, C/C++, Ionide-fsharp, Debugger for Chrome and TSLint extensions for VS Code are highly recommended, but optional.Further reading:
- [DotNetAnywhere: An Alternative .NET Runtime](http://mattwarren.org/2017/10/19/DotNetAnywhere-an-Alternative-.NET-Runtime/).