This website uses cookies on its adverts and sponsored links. By clicking the "Accept" button you are consenting to their use.

Read more

Accept


Mobile Tech Tracker
≡ sections
Home

Tech Advice

Tech Thoughts

Apps

Tech News

About

Welcome to Mobile Tech Tracker. Our mission is to help technically-minded people to become better versions of themselves and to help ordinary people to use modern smart technologies to their own advantage. If you want to support us, please consider visiting the pages of our advertisers.


You can run .NET code directly in the browser

JavaScript on the server is not a new concept. Node.js, the technology that enables developers to do so, became exceptionally popular over the last few years. However, what was almost unimaginable until now is the ability to do the reverse of it and run compiled languages, such as C# or Java, in browsers without any specialised plugins. This now became fully achievable, courtesy of the new technology developed by Microsoft based on its .NET platform -- Blazor.

Why would you need any compiled code in your browser in the first place, when JavaScript does its job? Well, one disadvantage of JavaScript is that it's interpreted. This means that, when it executes in the browser, it is read statement by statement and is converted into a set of CPU instructions on the go. Compiled code, on the other hand, already consist purely of low-level instructions. This makes the compiled code much quicker to execute. A massive advantage for any performance-intensive applications. The other advantage of binaries over JavaScript is that the latter is always stored in textual form that is relatively easy to read by a human. If you really want to build a closed-source app or include some logic into your code that is considered to be a trade secret, you cannot achieve it with JavaScript. Anyone using the browser can take a peek at your code. The binaries, on the other hand, are not human readable. All you have to expose in your HTML markup is inputs and outputs, but any logic in-between is done in complete secret.

So, how does it all work? Blazor takes advantage of WebAssembly technology that allows serving binaries directly to the browser. The base technology itself is standardised and has been made available on Chrome, Edge, Firefox, and WebKit browser engines. So, it covers all the major browsers with the exception of the ones that aren't very widely used. The only problem with this is that it's not fully compatible with Internet Explorer, which some stubborn enterprises insist on using until it fully goes out of support. Employees of such organisations are the only users that will not be able to use WebAssembly, which implies that they will not be able to take full advantage of Blazor. Although Blazor can be run on older browsers that don't have access to WebAssembly, it can only do so by relying on asm.js, which is significantly slower than WebAssembly and only works if additional polyfill is applied.

Blazor apps are built in the same way as any other ASP.NET app is built. Developers experienced with MVC will find it particularly easy to adjust. The latest preview of Visual Studio, 15.7, already has project templates for this types of project. However, as it is only available in a preview version, it currently has some limitations. For example, you have to keep stopping and starting the entire solution for any of your changes to take effect. But the framework is being actively worked on, so we should be seeing the full production-ready version of it at some point in the near future.



For more information, follow this link:

https://goo.gl/YiKDqi


Published by

Posted on 18 Apr 2018


Comments (1)

Author's Name *

Email *

4 + 8 *

Comment

*



FBlondel 14 May 2018

Concerning compatibilty, It will be supported on Internet Explorer 11, see for example this topic: https://github.com/aspnet/Blazor/issues/789

Reply

Author's Name *

Email *

6 + 9 *

Comment

*


Fiodar Sazanavets (Admin) 15 May 2018

Thank you for pointing this out. The article has been corrected accordingly


Tech News


Q#, an emerging language for quantum computing

Q#, an emerging language for quantum computing


Edge browser gets improved WebAssembly support

Edge browser gets improved WebAssembly support


Kubernetes gets fully integrated with Visual Studio

Kubernetes gets fully integrated with Visual Studio


Microsoft deploys an underwater data centre

Microsoft deploys an underwater data centre


Microsoft grants organisations an easy access to blockchain

Microsoft grants organisations an easy access to blockchain


Share this:

Facebook Google LinkedIn Twitter Become a Patron!


More from Tech News


Q#, an emerging language for quantum computing [VIDEO]


Edge browser gets improved WebAssembly support [VIDEO]


Kubernetes gets fully integrated with Visual Studio [VIDEO]


Microsoft deploys an underwater data centre [VIDEO]


Microsoft grants organisations an easy access to blockchain [VIDEO]


Saving your mobile apps from the danger of rooted devices [VIDEO]


Microsoft is focusing on artificial intelligence [VIDEO]


F# is given a boost in the latest Visual Studio update [VIDEO]


"The S@!t Bank" is in a big trouble due to IT glitch [VIDEO]


Microsoft makes its own Linux and its own chip [VIDEO]

Privacy Policy

© Mobile Tech Tracker. All rights reserved. Unauthorised copying of any of this website's content is prohibited under international law.

For any queries, comments or suggestions, please write to info@mobiletechtracker.co.uk.