Ben Patton

Building a blog with Go, Enhance WASM, Extism & Fly.io

enhance

One thing in software that is constantly intriguing to me is where software paradigms mix. Add to that some level of fringe software that offers some possibility and I cannot stop thinking about it.

Time passes both too quickly and too slowly for me to be sure how long ago I heard of Enhance WASM. Enhance WASM is a way for you to write Enhance SSR Web Components but then use them in any language, particulary through a tool called Extism.

Extism is essentially a way to compile WASM modules into a shared library that I can use wherever I want. In other words, Extism allows me to write plugins for different languages.

Originally I did this with Elixir, Phoenix LiveView, and Extism. Doing this blew my mind. Being able to write code in two languages for one project in the same file that wasn't seperated into client and server projects was so fun. There is no real definitely to being a "real software engineer" but this felt like a personal definition I didn't know I had that was being defined as I built.

Web and Performance

My primary language when coding is JavaScript. More than that it is using React and Typescript. Mentors and those who have been doing this for a long time have been cautioning me more and more about React's performance issues.

A key moment for me that really made me wrestle and think about what I know as a web developer was when I first started trying to use Enhance. Enhance is just web standards. You write server rendered html as custom elements and then you progressively enhance them with JavaScript where needed.

In a weird way, even writing that last sentence and understanding what I said is a win. Why? The easiest way to say it is that when I started writing code with enhance, I really struggled and felt like I was taking a step backwards.

Fast Sites

Recently I have been paying a lot of attention to blog posts and things coming out of Frontend Masters. Frontend Masters is built with Vanilla JS for the client and Go for the backend. I don't know what their code looks like, I would like to, but know that is enough.

Combined this with the excellent timing that I was learning a little bit of Go while learning Datastar, it occurred to me that I could combine what I knew while working/learning Datastar with what I knew about writing Enhance SSR Web Components and Extism.

Again, I know this does't exactly feel fast at the moment but I am starting with the belief and end goal in mind that the platform will win. So I want to be all in on the platform and build for it to the best of my ability.

Enhance, Extism, and Go

To be honest, at this point I don't know exactly what to share other than tech I used and some of how this works. My site is not as fast as I would like but the great part about this is that I think it will be overtime. This is a build in public adventure for me to build a very performant/fast site.

So, here are the things that I used: