Friday, 26 July 2019

A Dream of #Deployless

I recently read that Dark language post about incredibly quick deployments and got really excited. I likes me a good pipeline, but I’d rather not have one at all if I could possibly help it. I want to have the same experience of editing a file on a server and seeing the changes, but with modern controls and safety.

Now, Dark is still vapor-ware in the sense that it hasn’t been published, so unless I luck out and get an invite I’m not going to get to play with it for a while. But it inspired a hunger in me for a better experience.

I’m tired of deploy pipelines. I’m also tired of having to spend hours to get going with a language. Install a few binaries, add packages, realise you need to have multiple versions of the same language installed so add some kind of run-time switcher. Then configure a complex build process. I get exhausted thinking about it.

I wanted to work through the Elm in Action book but I definitely didn’t want to do anything beyond start programming. I decided to use Glitch, a collaborative online coding environment that sprung from Fog Creek.
Screen shot of the Glitch online editor
I found someone had created a baseline Elm app in Glitch so I “remixed” it i.e. used it as the base for my own work. Now, I could have used the browser-based editor but I’d much rather use VS Code, my current fave editor. Turns out, Glitch has a new Code extension for this exact purpose. So I installed that and started typing.
Screen shot of the Glitch extension in VS Code, writing Elm.
The extension is still very early. It crashed every 10–15 minutes, which was annoying. On the other hand, it never once lost any of my code and it is quick to reload VS Code, so I can live with that.
One of Elm’s big features is that it allows no run-time exceptions. The compiler is very helpful and uses the Maybe and Result types to handle the sorts of things that end up in run-time failures. So I could have the elm compiler logs scrolling as I typed, and when I got it right and the project compiled, I knew it was going to work.

Meanwhile, Glitch has integrated Git in a feature they call Rewind. It’s pretty crude — it effectively takes snapshots every few minutes and turns them into Git commits. It’s supposed to be collaborator friendly but I personally need more documentation from my source control. That said, it was free and took zero setup. And source control is due a re-evaluation in terms of usability.

As I made changes in VS Code, I’d pop over to the running version at https://photogroove.glitch.me/ in another tab and refresh the page to see the changes.
Screen shot of the web app that was produced.
It ain’t pretty, but it’s live
To recap, with the installation of a single extension, I was writing code in a language I hadn’t installed, in my preferred editor, watching it compile on the server, have its container restart, and refresh the page to see my changes.

Dark is planning to offer the killer feature that would make this work for a serious team project: integrated feature toggles. By my understanding, they automatically version new functions and types that you write and provide progressive deployment tooling similar to LaunchDarkly, directly from their editor.

I don’t think this future is going to be for every situation. Game development, AI, systems programming, native mobile development are all going to continue to do things status quo. But #deployless absolutely is the future for web apps and services. I can’t wait for it to happen.

No comments: