Go Plugin Framework, Part III

The story so far:

In Part I we defined the goal – to try and figure out how to implement a plug-in framework in Go – and learned how to launch & monitor a child process.

In Part II we learned how a child process can register itself with a parent process using Go’s built-in RPC channels.

In this episode we will look at defining the plugin API in more detail, and
invoking code in the child process.

Continue reading “Go Plugin Framework, Part III”

Go Plugin Framework, Part II

In the last episode I started trying to write an image-processing plugin framework in Go using RPC & shared memory. In this part I will be showing how I organised the code, and got the various moving parts talking to each other.

Note: the code that follows is edited for exposition, rather than for being a ready-to-run system. If you want to see code that I know works, have a look at this repo up on github.

Continue reading “Go Plugin Framework, Part II”

Go Plugin Framework, Part I

I wanted to see if was possible to build a dynamically-loadable plugin system in Go, for a photo processing tool that I have in mind (which will probably never get off the ground, but I can dream…). Now, Go is brilliant at a lot of things, but dynamically loading code is not one of them – which makes a “traditional” DLL/Shared Object approach to plugins a bit tricky.

Continue reading “Go Plugin Framework, Part I”

Revisiting “Revisiting Go”

It’s been a long time between drinks on this blog – nearly 3 years since the last post. A lot has happened in that time. I became a dad (hence the absence of activity here). My day job has moved from C++ on Windows to Python on Linux. I’ve also learned a few more programming languages (Rust, D, Elixir), and spent some more time with a few old favourites (Common Lisp, Racket, F# and Go).

Continue reading “Revisiting “Revisiting Go””

Revisiting Go

A little over 6 months ago I wrote a post about Go’s idiosyncratic error handling, but abandoned Go soon afterwards. I’ve always had a lingering feeling that I hadn’t given it a fair shake, and so I decided that the release of Go 1.0 was as good a reason as any to give it another try. After hacking away at a simple server for a week or so I’ve found a few things to like, but a lot that leaves me profoundly unsatisfied.
Continue reading “Revisiting Go”

Error Handling in Go

I started looking at Go after a google-fan at my current work suggested trying it. I was unsatisfied by my experiments with Scala, so I thought I’d give it a go and see what happened. The short answer is that I rather like it, but I’m not sure why.

One of the big things that mystified me at first was the decision to not use exceptions for error handling. My first reaction was “but that’s insane – error codes are a pain to work with and you can ignore them. You can’t ignore exceptions!”. My second reaction, given that some the people designing Go have been building programming languages for longer than I’ve been alive, was that I should probably give them the benefit of the doubt and try the language out a bit before I pass judgment.
Continue reading “Error Handling in Go”