After pushing out a prototype of atomic last week in Python, I thought I’d try making a quick port in Google Go. The most interesting part of Go (for me!) is the promise of performant, memory efficient cross-platform development. Ultimately, I want to deploy atomic onto a RaspberryPI, and would prefer a runtime that will be both fast, and workable with limited memory (which more or less rules out the JVM).
So, I figured, why not give Go a go, and see how it turns out?
The answer was: surprisingly well! Well enough that I’ve since added a couple more features, and have decided to move the project to Go indefinitely. Not that that’s a particularly huge decision; this is never going to be very big, so re-developing it in something else is always going to be an option.
Briefly, my impressions of Go so far are:
- it’s fast!
- it doesn’t use much memory
- deployment was very simple (no messy virtualenvs)
- feels very similar to Python, but is statically typed (yay!)
- I’m on the fence about using it in other projects – it currently lacks some idioms I’ve come to like (
map, for instance) – but that may change over time
- it follows the Haskell/Clojure style of typeclasses/protocols – you define functions to make a class meet an interface, which is nice
Most important of all though: I was able to cross-compile for the RaspberryPI right from my desktop. All it tooks was:
GOARCH=arm go build atomic
… and it just worked. The binary it spat out is currently running without a hitch.
Haunt’s recent Go versioning debacle is a problem that can be solved by the community.
Currently, one enters a link to a repo in a header:
And Go magically figures out what it needs to do, and clones the repo.
However, Go’s FAQ states that, given the correct tag in an HTML page, Go can figure out how to clone repositories from arbitrary URLs.
There’s therefore nothing stopping the community from creating a CGAN, GoPI, Gojars – whatever! – that correctly supports versioning.
Is absolutely accomplishable.
A friend, and ex-colleague of mine, recently quit our day job and is now self-employed as a game developer. He’s decided that, in order to ensure he can get games out the door, he wants to begin by releasing a game every week. I strongly empathise with this desire; I know I’m shocking at managing myself – there are (literally) hundreds of dead projects in various states of disarray littering my
src/ directory. Years of development and playing with code has taught me one thing: I’m not at all good at getting over myself, and exposing my code to the world.
So, while I’m going to be working on one overall project, I’m going to try and follow his lead. Today, I’ve pushed the first release of atomic; my attempt at building a RESTful interface for home automation. For now, it’s absolutely an MVP: it provides a (very sparse!) interface for sending wake-on-lan packets to computers.
Over the next week, I’m going to try and develop a small Android app, in the spirit of onX or tasker, which will send a request to this server when my phone enters the local wifi network.
For a while now, I’ve wanted a self-hosted, physical version of ifttt. Being a nerd/very bad with money, I’ve amassed a silly amount of devices that I’d like to start scripting – for instance, having my home PC wake up when I’ve entered wifi range (thanks, cellphone), or having the heaters at home fire up when I’m leaving work and there’s nothing on my calendar.
This week, I’ve started towards that goal. It’s very simplistic, but I’ve implemented a RESTful service in Python that I intend to use for home automation. So far, all it does is fire WOL packets at registered computers, but it’s a start.
I’ll post it on github by the end of the week. I’m hoping to – for once – properly publicise this project, in the hope that it’ll keep me dedicated.
As a recent blog post reminded me, it’s OK to suck. Even if you’ve done something for a long time; even if you’re supposedly good at it, it’s OK.
In that spirit, I’m committing to open-sourcing everything I work on (outside of my day job!) for the rest of the year. It’ll sit on github, no matter how sucky it is.
I think it’s time to start blogging again.