Live coding an app with Gleam, Lustre, Go and Wails.
In this session I refactor the daemon running and daemon installed API calls to chain after each other via dispatched Lustre effects, with the timer start also kicked off via a new message type.
Then I add a (not working) “Start it?” button to the daemon installed notice, with some nested CSS to style it.
Live coding an app with Gleam, Lustre, Go and Wails.
First I take a quick look at the now merged pull request I did off-video for the g18n_dev package for translations in Gleam, and then start to look at getting a second notice to show whether the daemon is installed if it’s not running.
Live coding an app with Gleam, Lustre, Go and Wails.
In this session I first make sure the project properly builds after clean checkout and make clean-all. Then set up using the g18n package to add translatable strings to the Gleam app via a nested translations JSON file, hitting a couple of easy to fix up issues along the way.
Live coding an app with Gleam, Lustre, Go and Wails.
This is just a bit of a maintenance session whereby I get all the new Gleam bits committed into git with the Svelte bits being removed, and then fix up the builds.sr.ht config so that it can run the build and tests once pushed to git.sr.ht.
Live coding an app with Gleam, Lustre, Go and Wails.
In this session I start to apply some CSS styling to the Gleam & Lustre frontend for the Wails app, including setting up screen and notice utility views.
Live coding an app with Gleam, Lustre, Go and Wails.
In this session I get started on the real rewrite of the Snippet Expander UI to use Gleam.
First thing I tackle is getting the UI to ask the backend whether the Snippet Expander Daemon is running. Once that is working, I set it up as a periodic check using a timer.
I’ve just published the first video in a new series of live coding sessions where I’m developing with Gleam and Lustre to build the front end for a desktop app built with Go and Wails.
The first video is a bit of test of my recording setup where I walk through a minimal test of connecting Gleam to the Go based Wails back end via its generated JavaScript functions that always return a Promise, and are therefore a little tricky to handle in Gleam. It was quite a relief to come up with a fairly simple mechanism for calling the JavaScript functions through Gleam’s excellent “Externals” Foreign Function Interface (FFI) and end up with a usable Lustre Effect.
During the “Gleaming Wails” Always Developing series I’ll be replacing the Snippet Expander desktop app’s Svelte based UI with a Gleam based one, continuing my quest to learn Gleam, which I very much enjoy working with, but unfortunately don’t get to do full time.
As it’s a chunky piece of work that I’m signing up for, hopefully this project will help me get more familiar with the Gleam language and Lustre framework, and help hone my functional programming skills in general. Even though I’ve been programming for well over 40 years now, and getting paid for it for nearly 30, I’ve mostly been working with Object Orientated style languages, and so functional programming doesn’t come easily.
With luck, along the way some people will learn a thing or two from my fumblings, or get excited about having a go at programming with Gleam.
You can follow along while I code (mostly) in Gleam on my YouTube channel.
Live coding an app with Gleam, Lustre, Go and Wails.
In this session I’m just showing a super basic test Gleam and Lustre frontend for a Wails app that handles grabbing data from the Go back end via the JS IPC, handling the returned promise and converting it to an effect that Lustre can use.
In this session I switch up how I decode the flags passed to the Gleam & Lustre app on startup, using a Flags type and custom decoders with a single pass through the JSON decode function.