I’ve been trying to move some of the Soniq application logic into WebAssembly using wasm-pack. I’m not sure whether it makes total sense at the moment, but I figure, the best way to find out is to do it and analyse the results.
I have been building an invoicing section which will take a set of lessons and create the corresponding invoices. It’s a relatively clean operation, I can feed in a load of lessons and contacts and it should respond with a list of invoices and invoice lines.
I have recently added wasm-pack builds into my Soniq project but found that it is a nightmare trying to get rustup and cargo installed in the Vercel build alongside my yarn monorepo.
I have been planning to migrate my deployments to pure Github actions and this was the push to strap myself in and get my hands dirty.
So here is part 1 in a series where I will explain the steps I have taken to get my monorepo building and deploying efficiently with Github Actions using Turborepo and a few, key, architecture decisions.
2022 has been a full year. This is the second year of giving myself a dedicated 20% time, it continues to be one of the best changes I could have made. I have explored new areas and given my brain space to think over them. I have been able to support my family better and be more present in their lives.
I have continued my work with Uniform. Uniform is working hard to make it easy for developers and editors to build websites from many different sources. This is being referred to as Composable or more precisely Digital Experience Composition 🧐 - it can be a bit of a mouthful but making this simple is the dream, and if it can be simple then there are lots of exciting possibilities.
What if you are using Next.js for your website but want to make use of Golang functionality written to support your backend APIs? This is a quick look at the Tinygo WebAssembly guide and how I integrated the output with NextJs.
The Tinygo Guide
Here is the Tinygo guide I used. It gives you a very basic first step to building a wasm binary from Go. Getting Golang set up correctly on my system was the hardest part for me, but even that didn’t take too long.
I have used the likes of Figma and often wondered how they used Wasm (or WebAssembly) to power the GUI. I also wondered if there were any existing C++ libraries out there that would provide a good foundation on which to build similar kinds of UIs on the web.
After a bit of research, I have found Dear ImGui which is a well maintained GUI library that can be used on the Web with Wasm but also used for Embedded devices like ESP32.
There is no doubt in my mind that WASM will become a large part of my future toolkit. The performance benefits for serverless functions will directly equate to cost savings. Then the performance benefits for user interfaces will directly equate to increased revenue.
The problem is, there are a few languages to choose from when programming for a WASM environment. I won’t be able to stay proficient in many so do I choose to invest my time in C++, Rust, Go or even F#?
Over the last year we have seen the rise of Languages like Rust running in the browser through the use of Web Assembly (or WASM). It’s also creeping into the Frontend Developer’s Toolkit’s through tools like the Speedy Web Compiler (SWC) which has been said to provide NextJs version 12 with “~3x faster Fast Refresh and ~5x faster builds”.
With the significant advantages of using languages which compile to WASM, providing the benefits of speed and more efficient compute it feels necessary to ask myself the question: