Saturday 12th August, 2023 - Browser Runs All the Things (Issue #127)
The browser, the final frontier. Seems like the only thing not running in the browser these days is another browser. What’s up with this craziness?
Hello and welcome to my newsletter!
Another season 2 instalment…
Over the years the browser environment has changed a lot. From just being able to load HTTP pages to running small bits of javascript, to entire clientside javascript applications, and now there’s even a trend to bring compiled languages to the browser via WASM. Just look at how the browser dev tools have evolved, it’s kind of mindblowing.
Last week Wordpress announced a project that runs an entire Wordpress instance in your browser. Think about how bizarre that is for a second. I’m still waiting for my brain to relax on this concept. I mean what even is a browser these days?
https://markjgsmith.com/links/2023/08/02/060100-techcrunch.com
The reason it caught my attention was because from a user perspective it makes a lot of sense to be able to run a static site generator in the browser. That way you could build your site and deploy it, relying only on having a local copy of the source files, and a browser. No need even for an Internet connection. That’s independence, self sufficiency, autonomy right there.
And so why not have more things be runnable in the browser? My idea from last week was why not have a full developer stack that runs in the browser? Be able to build for the browser from inside the browser. That would be awesome. Anyway with that in mind, this week there was some talk of being able to run LLMs entirely in the browser. Checkout the Latent Space Podcast this week for more on that.
Personally I’d like to be able to run an entire dev stack in the browser. But I’d also like to be able to build a hybrid of a static and a dynamic website. I’d like to be able to choose at deploy time whether the routes are static, or dynamic, whether they are running in a serverless function or in a full blown VPC server. I haven’t figured out how to do that completely yet, though I’m a huge fan of both Netlify’s functions folder for it’s easy serverless function deploys and serverless-http library which gives you the ability to run express apps inside serverless functions. Both could be used effectively together to make apps more flexible in how they are deployed.
That’s the sort of thing I’ve been thinking about recently. That’s why the Back Ends For Front Ends (BFF) episode by Software Engineering Radio was very interesting. I’ve been using a domain driven design architecture for most of my recent serverless development. I’ve found it really helps with code organisation, nicely separating concerns, with adapters to access external resources. Fits in really well with the BFF paradigm.
This week in my static site generator development I reached a rare moment of serenity. I refactored all the plugins to use a common layer that neatly encapsulates a major static site feature choice and makes it available as a component. In some ways I’ve been trying to solve this problem for over 10 years. It felt like I got much closer. All feature branches merged to the main site with no errors, the site so far is rebuilding without any issues. Everything is the same on the surface, but the foundations are much stronger. It should make building future features much easier. Given the circumstances it was a hell of a hill to climb.
“This morning I’m merging in quite a big rewrite of all my major plugins for my static site generator. There’s a new common layer that they all use now that simplifies things tremendously. In some ways it’s 10 years of work that has led to this simplification. Feels quite nice.”
https://twitter.com/markjgsmith/status/1689422452017815555
“It’s one of the strangest things about writing software is that when you are creating something for the first time, it’s totally not obvious how it needs to be. Then when you finally get it working the way it should be, you just can’t even remember how it wasn’t totally obvious.”
On with the show…
Podcasts
Samsung fans and video apps: they’re everywhere (Vergecast Podcast) - The usual high quality and humorous tech scene review with a high speed Elon Musk segment so as not to get bogged down in it, but also stay up to date on it. The stand out part for me was all about OpenUSD, the open 3D standard that Apple/Nvidia/Pixar are working on. Kind of nerdy, but lots of interesting angles about the tech but also the wider industry effects. Some boring gaming stuff and then an interesting bit about influencers burger franchises. https://podcasts.google.com/feed/aHR0cHM6Ly9mZWVkcy5tZWdhcGhvbmUuZm0vdmVyZ2VjYXN0/episode/NzZiMWI5ZGMtMzUwZS0xMWVkLWFjNmUtMzNjODJlODVhNGVj?sa=X&ved=0CAYQkfYCahcKEwj4-s-hrNSAAxUAAAAAHQAAAAAQNg
LK-99, Sclerotic establishments, Fitch downgrades US debt, Trump indicted again (All-in Podcast) - Hourah for Materials Science lifting science out of the All-in show corner with the latest lk99 superconductivity drama, some sobering and real talk about US sovereign bond crisis, and a kind of interesting discussion about Trump. https://podcasts.google.com/feed/aHR0cHM6Ly9hbGxpbmNoYW1hdGhqYXNvbi5saWJzeW4uY29tL3Jzcw/episode/ODg5ZDQ1MGQtMGM0Yy00OTYxLTk2MzAtZWNmOTg5YWQ4ODM3?sa=X&ved=0CAUQkfYCahgKEwj4-s-hrNSAAxUAAAAAHQAAAAAQ2AQ
Extra: Modern Whaler Speaks Up (Freakonomics Radio Podcast) - I enjoyed this more than I thought I would. Controversial topic of course, but it’s enlightening to hear the other side of the story that often gets forgotten. In life, as in software, ecosystems are complicated. I’m still not liking whale murdering though, even if the whaler bloke has a calm norwegian accent. https://freakonomics.com/podcast/extra-a-modern-whaler-speaks-up
Jens Neuse on Back Ends For Front Ends (Software Engineering Radio) - Discussion around architecting larger systems that have multiple different front ends. The idea is to move much of the fetching logic from the front end to front end specific back end layers that sit on top of your back end. Lots of emphasis on software layering, and the various trade offs, and the over-arching message that APIs should be treated as dependencies, just like npm packages are. Got me thinking a lot about how I could improve my use of serverless functions. https://www.se-radio.net/2023/08/se-radio-576-jens-neuse-on-back-ends-for-front-ends
LLMs Everywhere: Running 70B models in browsers and iPhones using MLC with Tianqui Chen of CMU / OctoML (Latent Space Podcast) - A lot of this was over my head to be honest, but there’s a bit towards the end discussing the interesting possibilities arising that enable the running of quite large models directly in the browser. Running serverside programs in the browser is trending :)
Last minute addition: The Bitcoin Mutiny with Tony Giorgio (What Bitcoin Did Podcast) - Just listened to this episode, and it fits with this week’s theme so I’m adding it. It’s all about bitcoin and lightening privacy in general, but with a focus on Mutiny, which is a wallet that runs entirely in the browser. Built using rust, compiled to WASM. It’s changing the way people view wallets. Gets very technical in places, but that’s what you want when it comes to privacy, so you can learn what’s really happening in the background during things like mixers, coin joins and coin swaps. All the explanations are pretty good. Awesome and very interesting project. Such synchronicity. https://www.whatbitcoindid.com/podcast/the-bitcoin-mutiny
Links
Bram Moolenaar has died - Bram created the vim text editor. It was one of the reasons I decided to get more into programing 20 years ago. As a young sysadmin in a VFX shop, I would watch the tools guys effortlessly do things with vim that were pure magic, and at some point I just thought, "that's what I want to be able to do". I got pretty good at vim over the years but never reached vim wizard status. Maybe that will happen some day if the world ever decides to allow me to have another laptop. Strange timing given the latest newsletter, kind of adds to the far out notion that the entire tech industry is fake imo. I mean seriously, what are the chances? Anyway RIP Bram, thanks for vim, Mark. https://markjgsmith.com/links/2023/08/06/060000-news.ycombinator.com
Lots and lots more great links this week on the daily linkblog, please check them out:
That’s all from me…
Best regards,
Mark
Consider becoming a patreon, any support would be very much appreciated
Thanks for reading!
If you liked this newsletter you might like my blog, daily linkblog or experimental podcast :)
I’m a freelance web developer, consultant and automation engineer, consider hiring me!
Have a great weekend and a fantastic next week!