18 Sep 2014
In the previous blog post, we used Core and Async to write a tiny library for talking to Memcached using the binary protocol. I wanted to write tests for the library in a readable and succint manner to ensure correctness – the type system cannot ensure binary data is parsed correctly after all. The regular go-to tool for testing OCaml code is OUnit, but this doesn’t work well with Async. As I couldn’t find a suitable library, I decided to write something myself.
17 Sep 2014
In the previous blog post, we implemented a simple OCaml library for talking to Memcached with the binary protocol using bitstring. The code uses the baked-in standard library and synchronous IO (blocking), so a lot of time will be wasted waiting for IO. The standard library replacement Core offers cooperative threading with callbacks through Async, similar to Javascript, EventMachine for Ruby or many others. In this blog post we’ll try to rewrite the code from the previous post to use asynchronous IO with Async.
22 Aug 2014
I’ve known OCaml for a while, but I never really put it to use outside of academic work back in university. After reading Real World Ocaml my excitement for Ocaml reappeared and I wanted to try out Core and Async. At the back of my mind, I also remembered bitstring, an awesome Ocaml library for creating and pattern matching on bitstrings. To cover all three, I decided to write a Memcached client using the binary protocol.