Blazor icon indicating copy to clipboard operation
Blazor copied to clipboard

corlib and JIT updates

Open ncave opened this issue 8 years ago • 34 comments

Here are a few fixes and updates to the corlib and JIT:

  • Better C# support (added some missing JIT features, some bug fixes and updates).
  • Added F# support (uses custom FSharp.Core, see here for a working example).
  • Tried my best to keep the corlib light, it's still around 260k (in release mode).
  • Release build assemblies now work too (after JIT bugfixes).

I see you added CLR debugging in the browser, that's awesome!

ncave avatar Aug 14 '17 22:08 ncave

This looks like a good pull request. I'm excited for this project

Terricide avatar Aug 17 '17 01:08 Terricide

C# client side ?? DO WANT !!!

Seriously this looks great.

stavroskasidis avatar Aug 24 '17 19:08 stavroskasidis

That's awesome! By the way, do we have Blazor on official Core 2.0 instead of preview version?

rvhuang avatar Aug 25 '17 01:08 rvhuang

+1 adding my support for this project. Reaaaally want to see it come to fruition!

chris-ray avatar Aug 25 '17 01:08 chris-ray

How can one help with this project? Because I seriously want to see this getting bigger :)

xiaowuchiu avatar Aug 25 '17 07:08 xiaowuchiu

+1 @Huarru I too would love to know how I can help. This project needs to get a team behind it, Microsoft !!

I really think this can be a solution for the messed up, mangled mess that we today call web development. https://twitter.com/thomasfuchs/status/708675139253174273?lang=el

stavroskasidis avatar Aug 25 '17 09:08 stavroskasidis

I tried implementing a new feature but the missing reflection features are blocking me. I tried using DNA from this PR but still there are a lot of basic reflection stuff missing.

I think the first thing to do should be extending DNA, although I am not sure if this is the way to go since Mono is also working to bring their runtime to wasm.

http://www.mono-project.com/news/2017/08/09/hello-webassembly/

Maybe switch to Mono runtime ? (when ready)

stavroskasidis avatar Aug 26 '17 12:08 stavroskasidis

Here's why reflection in this type of project is not desirable:. Reflection prevents a linker from pruning code unless done very carefully.

It is imparitive that blazor implements a linker to shrink the size and using DNA keeps the monster size of mono out of this. (see how large the same app is for xamarin Android versus Java if you have any questions and that's with a linker)

On the web all you need is event handling, http requesting, and operations in the Dom (and cookies, storage I etc) all with strong typing. Essentially everything else is noise that should be done server side.

If a model that uses razor syntax for binding with eventing can be created that matches angular but does so with dnx and web assembly using mvc pages and mvc routing we'd have a massive win and would forever change web development, which is a disaster right now) for the better.

And as an aside, Al of this has the benefit of being natively executable for server side pre-rendered for SEO with seamless handoff and no nodejs involved which is another HUGE win.

JohnGalt1717 avatar Aug 26 '17 12:08 JohnGalt1717

@JohnGalt1717 Ok, that makes sense

stavroskasidis avatar Aug 26 '17 14:08 stavroskasidis

+1 for this project. I'm waiting with baited breath.

pineywoods avatar Aug 26 '17 14:08 pineywoods

I get that reflection is tricky when it comes to dead code elimination, but it's also an integral part of many codebases.

Perhaps an approach like .NET Native's "Runtime Directives" can be used?

https://docs.microsoft.com/en-us/dotnet/framework/net-native/reflection-and-net-native

RonPenton avatar Aug 26 '17 15:08 RonPenton

PS if anyone needs an extra hand for this, sign me up.

RonPenton avatar Aug 26 '17 15:08 RonPenton

What kind of knowledge is required to contribute to this project? Does anyone have any recommendations on which books I should read?

I think rather than wasting countless hours writing awkward JavaScript/TypeScript code, I would rather spend those hours contribute to this project.

yanglee avatar Aug 26 '17 16:08 yanglee

@SteveSanderson Separated the Blazor-Hackaton baseline to help the review.

ncave avatar Aug 26 '17 17:08 ncave

"I think rather than wasting countless hours writing awkward JavaScript/TypeScript code, I would rather spend those hours contribute to this project.” Amen to that.

csells avatar Aug 26 '17 17:08 csells

Just saw the announcement of an official .NET IL Linker at dotnet/core#915. That seems like great news for this project to reduce code size!

TylerBrinkley avatar Aug 30 '17 17:08 TylerBrinkley

@SteveSandersonMS Rebased to latest.

ncave avatar Sep 05 '17 19:09 ncave

Love the project and eager to experiment with some ideas, but there are quite few outstanding PR's that contain a lot of changes. Could some of the PR-s be merged?

arpadbarta avatar Sep 17 '17 10:09 arpadbarta

@arpadbarta I know it's taking a while to merge this, and apologies for that. But please don't expect this repo to be a typical open-source project in a normal phase of maintenance. Instead, this repo is an experiment, not intended to have any particular level of support. Future plans are still being worked out.

SteveSanderson avatar Sep 20 '17 12:09 SteveSanderson

Future plans are still being worked out.

I like the sound of that, given the Blazor-Hackathon on the official ASP.NET github org I'm hoping this may mean official Microsoft support!

TylerBrinkley avatar Sep 20 '17 12:09 TylerBrinkley

I can't wait to see what this becomes. I am getting all giddy. XD

MaverickMartyn avatar Sep 20 '17 12:09 MaverickMartyn

I'm hoping collaboration with mono-wasm can speed things along by sharing resources, and advancing both experiments to an officially supported set of tools. Each project has a different architectural approach (e.g. client-side Razor vs. browser-targeting XAML), but so much of the underlying core and foundation would be common and sharable by both teams.

ebekker avatar Sep 20 '17 13:09 ebekker

And there's also this- https://github.com/dotnet/corert/pull/4480

gulshan avatar Sep 20 '17 14:09 gulshan

Microsoft really really really needs to take command of this, make it official and pull all of these initiatives together and get a cohesive whole that has 2 paths:

  1. HTML with angular/razor style markup that generates an SPA
  2. XAML SPA

Pick which you want to use. In either case, both should automatically become a best of breed UWP application when targeted at the store with additional functionality available.

And they should direct compile to iOS and Android as well. (without a requirement for a mac, meaning MS has to put the build and test stuff in the cloud for iOS and give it away free to devs so they have no reason to ever use a mac)

JohnGalt1717 avatar Sep 20 '17 14:09 JohnGalt1717

Every single time I fire up a "React getting started" tutorial with typescript, webpack and redux, 5 minutes later I have stopped reading in frustration and I find myself back to this repo, gazing at the "what-could-be" future.

I have done the "Todo List" sample in Blazor multiple times by now, demoing it to some colleagues, and every time it reminds me how easy and natural it feels writing in it.

The timing is right. I believe that web assembly will even the playing field. It's time to seize this opportunity and make C# the go-to language for full stack web development.

Please make this happen !! T_T

stavroskasidis avatar Oct 09 '17 19:10 stavroskasidis

Thanks @ncave for continuing to contribute to this! Just so you know, our hope is to move away from the DNA runtime shortly and replace it with a more full-featured one. If this works out (no guarantees yet though) then you could absolutely still continue to develop DNA (and there might indeed be demand for that as it might always be the smallest .NET runtime there is), but it would be good to move that over to another repo under your control. Does that sound OK?

SteveSandersonMS avatar Oct 30 '17 14:10 SteveSandersonMS

@SteveSandersonMS Thanks Steve, I figured you guys are up to something, and that's awesome, can't wait to see it. I already have another DNA development repo, that's where the updates are coming from.

ncave avatar Oct 30 '17 15:10 ncave

BTW In case you haven't seen it, I wrote a post to try and let more people know about DNA, see DotNetAnywhere: An Alternative .NET Runtime.

There's also some interesting follow-up discussions, see HackerNews and /r/programming (including comments from @chrisdunelm)

mattwarren avatar Oct 30 '17 15:10 mattwarren

@mattwarren Of course I've seen it, great write-up, so much depth and detail. Thanks for the links!

ncave avatar Oct 30 '17 15:10 ncave

It is so great that this thing keeps moving! Can't wait to see it happen.

While waiting I enjoyed browsing the following three repositories:

CoreRT

WebAssembly is a new technology for running code at near-native speed in browsers. A group of folks on the .NET team worked together to see what WebAssembly might look like using CoreRT.

They also issued a call for help https://github.com/dotnet/corert/issues/4659

I have seen several pull requested merged in the last few days. So there is some action going on there.

WebSharp

This project is intended to support running .NET code as an Electron Plugin, running code using the Mono runtime, side-by-side the V8 engine and to provide both C# API bindings to Electron's plugin API as well as the Web browser API.

Last commit was 6 weeks ago. Seems like no public action going on here anymore.

MonoWasm

This project is a proof-of-concept aiming at building C# applications into WebAssembly, by using Mono and compiling/linking everything statically into one .wasm file that can be easily delivered to browsers

This repository is owned by Laurent Sansonetti who works for Microsoft in Belgium. Steve and Laurent exchanged some emails and they tried to get it running with Blazor.

Last commit was 10 days ago.

Postlagerkarte avatar Oct 30 '17 17:10 Postlagerkarte