First, a little bit of background. When I first joined the Radiofy project 18 months ago, we were using a java variant of libspotify named Jotify. Jotify worked quite well for us, but after six months it suddenly stopped working.
So, what gives? From what we gathered, Spotify had updated their protocol, right at the same time the Jotify project was abandoned by its’ author, and all other alternative projects either didn’t have required functionality or plain out didn’t work for us. Having a service relying very much on having a Spotify API we had to find a solution.
And so, Hallon was born. During the weekend I revisited my C knowledge, studied up on Ruby C extensions and quickly wrote the most minimal thing that could possibly work. By Monday we had our service up and running, using Hallon as back-end. And that’s how Hallon was born.
Hallon is Swedish for raspberry, and is really just one side of a coin.
On one side we have libspotify for Ruby. This gem, Spotify, is a ruby wrapper for the libspotify API. What this means is that anything you can do in C with libspotify, you can now do with Ruby.
However, as the Spotify gem is written using Ruby FFI, you still need to manage memory by yourself, freeing pointers where necessary and all other kinds of stuff that we should be spared from doing when coding Ruby.
Hallon is meant to remedy this. Hallon is is a layer written on top of the Spotify gem. The goal of Hallon is to provide a simple-to-use API, allowing you to worry about things you enjoy worring about, rather than thinking about memory or pesky pointers.
Hallon is not complete, and is much harder to implement than the Spotify gem. Luckily, when Hallon’s functionality is not enough, one can use the Spotify gem to fill in the gaps, providing an all-around solution until Hallon reaches v1.0.0.
However, do note that when Hallon reaches v1.0.0, there will be no reason to use the Spotify gem directly, and Hallon’s API will easy and fun to use. That is my goal.
Finally, this post would not be complete without a code sample.
Thank you for reading! If there’s any questions, feel free to contact me. My details can be found on the About Me page.