ashmind / SharpLab

.NET language playground
https://sharplab.io
BSD 2-Clause "Simplified" License
2.72k stars 199 forks source link

Suggestion: Blazor wasm support #520

Open YairHalberstadt opened 4 years ago

YairHalberstadt commented 4 years ago

Currently sharplab runs on the server (Thanks so much @ashmind - sharplab is amazing, and I'm guessing the hosting isn't free!).

As a result it suffers from a number of limitations:

  1. Doesn't work well with a bad internet connection.
  2. Slow intellisense.
  3. Whitelist of allowed types and methods when running.
  4. Maximum number of allowed operation when running.

If it were to run in the client browser directly via blazor wasm that would hopefully solve these issues. I have managed to get Roslyn running in blazor so this is doable (see also this blogpost: https://www.strathweb.com/2019/06/building-a-c-interactive-shell-in-a-browser-with-blazor-webassembly-and-roslyn/).

YairHalberstadt commented 4 years ago

One relevant limitation is there's currently no way to unload an assembly in blazor wasm, since it only runs in .Net standard. Hopefully that limitation will be solved once blazor wasm has .Net 5.0 support.

ashmind commented 4 years ago

Thanks for the suggestion! That does make sense and is something I am planning to do (see also #341 + ashmind/mirrorsharp#100).

I'll prioritize it higher. I am currently doing a big change to mirrorsharp already (CodeMirror 6), so practical priority will depend on whether I can prototype both at once without expecting much merge conflicts.

ashmind commented 4 years ago

(not too worried about unload, worst case I can kick the whole thing into an iframe and recycle that)

ChayimFriedman2 commented 4 years ago

Blazor is currently out of preview (version 3!) and soon we'll have .NET 5. I'm guessing the issues Blazor still have (mainly huge assembly due to .NET embedded) will be resolved then.

NickAcPT commented 3 years ago

Has there been any progress towards this?

ashmind commented 3 years ago

No progress yet -- I would say it's unlikely to happen before CM6 upgrade, and CM6 upgrade is moving quite slowly given it's open source timelines. At the moment I don't have any dates to promise.