WebAssembly in Action

Author of the book "WebAssembly in Action"
Save 40% with the code: ggallantbl
The book's original source code can be downloaded from the Manning website and GitHub. The GitHub repository includes an updated-code branch that has been adjusted to work with the latest version of Emscripten (currently version 3.1.44).
Showing posts with label Uno Platform. Show all posts
Showing posts with label Uno Platform. Show all posts

Monday, January 27, 2025

The State of WebAssembly - 2024 and 2025

The State of WebAssembly – 2024 and 2025. For the fifth year in a row, I've had the privilege of writing an article on the state of WebAssembly. In this article, I start off by reviewing the WebAssembly developments during 2024 like Safari rounding out browser support for a number of features including Garbage Collection, newly available features like JavaScript String Builtins and Memory64, WASI 0.2 (formerly called Preview 2) being released, Uno Platform performance improvements, Hyperlight being open-sourced, and even a NIST report on how wasm can help improve security. Then I try to predict where I think things will go in 2025.
For the fifth year in a row, I've had the privilege of writing an article on the state of WebAssembly.

In this article, I start off by reviewing the WebAssembly developments during 2024 like Safari rounding out browser support for a number of features including Garbage Collection, newly available features like JavaScript String Builtins and Memory64, WASI 0.2 (formerly called Preview 2) being released, Uno Platform performance improvements, Hyperlight being open-sourced, and even a NIST report on how wasm can help improve security. Then I try to predict where I think things will go in 2025.

Every year we see many WebAssembly-related improvements and 2024 was no exception. It's easy to get caught up waiting on the next amazing feature but the reality is that wasm and WASI are already very capable as we can see from the increased adoption.

The article can be found here: The State of WebAssembly - 2024 and 2025

Wednesday, March 29, 2023

Safari 16.4 and WebAssembly Fixed-Width SIMD from C#

This week, Safari 16.4 was released and with it came support for WebAssembly's fixed-width SIMD feature! With this update, all modern browsers now support this feature.

As shown in the following image, WebAssembly fixed-width SIMD allows code to take advantage of hardware instructions on the device to speed up certain computations by running them in parallel.

A visual representation comparing data being processed
one element at a time with normal arithmetic (Single
Instruction, Single Data)
versus four at a time, in
this case, with SIMD


The Uno Platform allows you to write an application that works on multiple systems including in the browser thanks to WebAssembly. The Uno Platform uses .NET and the ability to target WebAssembly fixed-width SIMD was added in .NET 7.0.

I wrote the following article that walks you through creating an Uno Platform application and how to work with vectors to leverage SIMD. The article also explains how to compile your application ahead-of-time (AOT) with SIMD support: https://platform.uno/blog/safari-16-4-support-for-webassembly-fixed-width-simd-how-to-use-it-with-c/


Leveraging WebAssembly fixed-width SIMD in Blazor WebAssembly

Because the Uno Platform is using .NET, with a few slight modifications the same code can also be used in Blazor WebAssembly as well.

With both platforms, to take advantage of WebAssembly's fixed-width SIMD support, you need to AOT compile the application but there are a couple differences between how it's done with the Uno Platform versus Blazor.

For Blazor, you'll need to edit your project file and include the following tags in a PropertyGroup tag:
  • <RunAOTCompilation>true</RunAOTCompilation>
  • <WasmEnableSIMD>true</WasmEnableSIMD>

With the Uno Platform, simply adding Uno's version of the previous tags is enough to trigger the AOT process depending on if your build configuration matches that of the PropertyGroup you added them to (Release mode for example). However, with Blazor, AOT is only triggered when you publish the project.

Also with Blazor, the AOT option on the Publish dialog is on and you can't uncheck it. With Uno you need to make sure you don't check it by accident because doing so will cause an error to be thrown that can only be fixed by deleting a tag from the publish profile file.

A Blazor WebAssembly version of the code can be found here: https://github.com/cggallant/blog_post_code/tree/master/2023-March-BlazorSIMD


Demos

If you'd like to see it in action, the following links are demos built form the code in the article. Note that because these are AOT compiled, they are bigger so they may take a few seconds to download and display especially if you're on an older device or on a slower network.

Tuesday, February 28, 2023

ConFoo 2023 in Review

My experience at ConFoo 2023
On Tuesday, February 21st, I started my journey to Montreal to speak at the ConFoo developer conference for my third time.

Usually, when I travel to the big cities, I try to use public transportation to get to and from the airport. The city I live in isn't very big but I decided to give our transportation system a try anyway.

Unfortunately, for me to get to the airport using this approach, I needed to take two city buses and then a coach bus. It's doable but it takes time and the coach bus only goes to the airport twice a day so the timing didn't allow me to use this approach when I returned.

One highlight of my trip to the airport, however, was a pheasant that graced me with his presence.
The conference was held at the Hotel Bonaventure where we were greeted by over 700 attendees and over 150 sessions in 3 days! Being in Montreal, it was fitting that some of the sessions were also available in French.


The past two times that I spoke at this conference, I only spoke for one session each time. This year, I gave two presentations.

My first presentation was given on the second day of the conference. For this session, I talked about how we're using Docker at Dovico to prototype views, try out different UI frameworks, and help speed up the development of Timesheet.
The second presentation that I gave was on the final day of the conference. This time, I walked the audience though creating a Slack bot from start to finish by building a simple hot desk booking system!
My slides, notes, and links to the code from my talks can be found in the following GitHub repository: https://github.com/cggallant/confoo-2023

As my new friend, Andres Pineda, so correctly articulated in one of his sessions, there's more to a developer conference than just taking in the talks. There's also a networking component to these conferences. When I saw him at the opening party for the speakers, I recognized him but couldn't figure out where from. Later I realized that I had seen him talk online as part of UnoConf and he's one of the contributors to the open-source Uno Platform. We have something in common because I've been privileged to work with Uno and write them several articles for their blog. We were able to connect during the conference.

Speaking of the Uno Platform, while I was in Montreal, I had the opportunity to meet Matthew Mattei in person for lunch. I work with him when writing articles for their blog. I wasn't expecting it but I do appreciate that the Uno Platform sent me home with some swag: Over the course of the conference, I was fortunate to meet some great people and to take in a number of really good sessions. My only regret is not being able to take in all of the sessions because there are usually 8 other sessions happening at the same time as the session that you're in.

On Saturday, February 25th, I made the journey from the hotel back to the Montreal airport. I thought this was a neat idea as I was walking through the airport to my gate: It was a great conference and I already miss it. I hope to be able to attend next year's conference and I recommend ConFoo to everyone.

A huge shout out to Yann Larrivée for putting on another amazing event!


As a side note, if you happen to be putting on a developer conference, or know of one that's looking for speakers, let me know because I'd like to speak more. I've started setting up a Sessionize profile but you can also reach me on Twitter or on LinkedIn.

Sunday, May 16, 2021

Uno Platform WebAssembly applications and Azure Static Web Apps

This week, the Azure Static Web Apps service came out of preview. I was honored with the opportunity to create an article that shows you how to create an Azure Static Web App and link it to a GitHub repository containing an Uno Platform WebAssembly application.
This week there was an announcement that the Azure Static Web Apps service came out of preview.

As the name implies, Azure Static Web Apps give you a way to host static web apps and it comes with many features including global distribution of your content and free SSL certificates to name a couple.

Static web apps are applications where all the work happens in the browser and the app is decoupled from server-side code. Because an Uno Platform WebAssembly application is all client-side, it's a static web app and can take advantage of the Azure Static Web Apps service.

I was honored with the opportunity to create an article that expands on some documentation that the Uno Platform already had on Azure Static Web Apps. In the article, I walk you through creating a GitHub repository, creating an Azure Static Web App, and then linking the two together. Then you create an Uno Platform WebAssembly application, check it into your repository, and see the Azure Static Web App automatically detect the change and deploy your new code.

The article can be found here: "Hosting Uno Platform WebAssembly apps on Azure Static Web Apps"

Monday, March 2, 2020

Presenting a WebAssembly Overview at ConFoo.ca

This was my first time attending a ConFoo.ca Developer conference. I also had the pleasure of being one of the speakers at this year's event so I thought I'd write about my experience.


ConFoo.ca Montreal celebrated its 18th anniversary this year with nearly 840 attendees! The following are some photos that I took while people were still arriving for the first day's keynote:


(click to view the image full size)

The conference brought speakers from around the world who presented 156 talks over three days! I was honored to be included among them by giving a WebAssembly Overview presentation.

I've written a book on WebAssembly so I know the subject matter quite well. I've also given public presentations a number of times at work and at local user groups but those audiences are smaller. This is a big conference and I was given one of the bigger rooms so I was a little nervous.

While I was traveling to the conference, and while I was there, a couple WebAssembly announcements were made about Firefox and Google Earth.

WebAssembly Announcements

The first announcement was from Mozilla. They've been working on porting their C and C++ code to Rust but there's a lot of code in Firefox so this will take time.

What they decided to do is leverage WebAssembly within Firefox itself by using RLBox. They started by sandboxing their font library and plan to sandbox other components in the future. For more details, you can visit the following site: https://www.zdnet.com/article/firefox-for-mac-and-linux-to-get-a-new-security-sandbox-system/

The announcement from Google Earth was that their WebAssembly version has come out of beta for the desktop version of Firefox, Edge, and Opera. More details on this announcement can be found here: https://9to5google.com/2020/02/26/google-earth-firefox-edge/

I updated my presentation with the latest WebAssembly news and spent every spare moment I could find going over my notes and slides. I even skipped lunch on the final day of the conference to give my presentation one more run though.

My turn

It was convenient being the first presenter in the room after lunch because it gave me time to set up my computer and adjust my slides.

The projector was pointing a bit too high and the titles on my slides were being cut off at the top so I had to bump the titles down on every slide. In hindsight, I should have just nudged the projector forward a tiny bit but my nerves got the best of me and I didn't see the simpler option.

There are a few things that I would change with my presentation but, overall, it went well. There were a decent number of attendees and some good questions afterwards.


I had been in contact with members of The Uno Platform for a while now. When I found out that I was going to be a speaker at ConFoo in Montreal, we arranged a meeting to say hello because their head office is in Montreal too.

The Uno Platform meeting


At the end of the first day's sessions, I rushed down the road to The Uno Platform's head office where I had a chance to sit down and chat with their CEO Francois Tanguay and CTO Jerome Laban where we talked about...you guessed it...WebAssembly!

They're very nice guys who are very passionate about C#, XMAL, and WebAssembly. If you want to do cross platform C# and XAML that targets iOS, Android, desktop, and the web, I recommend checking out The Uno Platform.

They're having a conference August 26-27, 2020 in Montreal called UnoConf. I copied the following from their website:

UnoConf is a gathering point for the complete Uno community – engineering team, influencers, code contributors as well as those wishing to learn more about the Platform.

UnoConf 2020 brings a full day conference followed by a full day hands on workshop lead by Uno Platform core team. By August WinUI 3.0 will be in market and you'll get a front seat in learning how to build cross-platform solutions and how to migrate your existing applications with it.

Summary

My visit to Montreal went very quick. It feels like it was just yesterday that I was getting on a plane for Montreal and now I'm writing about my experience on a plane heading home.

I want to send out a special thank you to Manning Publications for providing some free e-books for me to give way as well as a special discount code.

I also want to thank Yann Larrivée for giving me this opportunity to speak. He worked really hard and did an amazing job to put on a very professional conference.

ConFoo brought in speakers from around the world who are indeed world-class. If you can find a way to get to Montreal next February 24-26, 2021, I highly recommend attending this conference.