ASP.NET Core MVC

Observations about ASP.NET MVC Core and converting YetaWF from ASP.NET MVC5 to ASP.NET Core MVC. The new MVC6 has great new features. Getting there from an existing MVC 5 app is HARD!

WebAssembly - The Holy Grail of Web Development

12/07/2017

WebAssembly, it's real, it's coming and it's going to take over web development. Well at least, once it's ready.

They call it "binary" code. Well, maybe, but not really, it's a superfast subset of JavaScript. Preparsed and ready to run. There are compilers that will translate C/C++ to a WebAssembly (really the JavaScript subset that's superfast).

There are compilers that will translate other languages into a WebAssembly too. Just imagine, whatever is downloaded is already "compiled" and ready to run. Unlike pure JavaScript. For example, any site that uses jQuery downloads jquery.min.js and has to parse it! The parsing portion takes a while. With WebAssembly, there is no parsing, because the code is already compiled into "byte code". That means you write code, compile it into a WebAssembly and it's ready to run.

This will be a massive boost to performance, and web development in general. Finally we can use "real" languages, type-checked and compiled, instead of the "free-for-all" JavaScript.

Then I ran into Steve Sanderson's Blazor. It's an experimental UI framework running .NET in a browser using WebAssembly.

At first I was really excited about it. But then I realized, there are some issues. A co-worker mentioned similarities to SilverLight. Well that wasn't it. SilverLight basically was a "native" browser plugin with some very opinionated features. WebAssembly is neither.

BUT! Blazor suffers from a fundamental flaw. Yes, its sample implementation offers a Single Page Application. That's not really the issue, as it's completely coincidental (and quite useless, as it's not real).

Blazor implements the .NET framework using Mono. That's pretty slick (seriously!). Again, not an issue.

But, Blazor compiles Razor views and the accompanying C# code into IL (Intermediate Language, well, that's how .NET works). A desktop application would use JIT (Just In Time compilation) to compile IL and then run the app with native performance). But a web application using WebAssembly will interpret the IL code using the WebAssembly, which is interpreted (subset) JavaScript. Did anyone catch the JavaScript interpreter interpreting the IL Interpreter's runtime code?

Blazor also seems to focus on the .NET framework. We don't need a framework running in a browser (that's what SilverLight was - it failed). We just need a compiled, type-safe language in a browser. Blazor does some of that with .NET, C#, IL in a WebAssembly. If I could have C# transpiled into a WebAssembly (instead of IL interpreted by WebAssembly code), I'll be a happy camper. Until then, I'll be looking into using C++ for web development. I don't need the .NET runtime! I need superfast, compiled code.

No Comments

Be the first to add a comment!

Add New Comment

Complete this simple form to add a comment to this blog entry.