Samples, references, tutorials and how-to on rustwasm, Blazor and WebAssembly.

Man page for rust-wasm, Blazor & WebAssembly

What is WebAssembly?

WebAssembly is a web standard, developed by the World Wide Web Consortium, that defines an assembly-like binary code format for execution in web pages. The executing code runs nearly as fast as native machine code and is meant to speed up performance of web applications significantly.

As WebAssembly is a low level binary bytecode, it supports compilation from different programming languages including languages that have been around for many years such as C and C++. This enables many existing and commonly used libraries or applications to be compiled into WebAssembly easily. Besides being a compilation target for the different programming languages, WebAssembly also offers an alternative to web development in languages other than the JavaScript.

Since 2007, WebAssembly has been natively supported by all major browsers including Firefox, Chrome, Safari and Edge.

What is Blazor?

Blazor is a WebAssembly based front end web application framework that uses .NET, C# and HTML. It is open source and maintained by Microsoft and the community to address the many challenges encountered in developing single page applications.

Note - Blazor is currently experimental and should not be used in production. This website is still under construction.

How does Blazor works?

A Blazor app consists of compiled .NET assemblies that are downloaded and run in a web browser using a WebAssembly-based .NET runtime. The app can also call into JavaScript or access the DOM through Javascript interop APIs. As Blazor is a component-based framework that supports features such as bindings, direct access to the DOM is minimized.

"Hello World" application in Blazor

Requirements

  • Install .NET Core SDK 2.1 (or later)

Install latest Blazor Templates with command-line (Windows Command Prompt or MAC Terminal)


dotnet new -i Microsoft.AspNetCore.Blazor.Templates

Create the Blazor app


dotnet new blazor -o BlazorHelloWorld

Start the Blazor app


cd BlazorHelloWorld

dotnet run

You should see the following output:


Hosting environment: Production
Content root path: ......BlazorHelloWorld
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
            

Launch your browser and point it to http://localhost:5000