OJ’s rants What would OJ do?

1Sep/100

Webmachine, ErlyDTL and Riak – Part 1

riak-logo

It has been a long time coming, but the first post is finally here! This is the first in a series of post, as promised a while ago, covering off web development using Erlang. This post is the ubiquitous "get up and running" post, which aims to get your environment set up so that you can dive in to development. The next post will detail how to handle a basic end-to-end web request.

First up, a few things we need to be aware of before we begin:

  1. The information in this post has only been verified on Linux (Mint to be exact). It should work just fine on Mac OSX. I'm almost certain that it won't work on a Windows machine. So if you're a Windows developer, you'll have to wait for another post down the track which covers off how to get your environment ready to rock.
  2. We'll be downloading, building and installing Erlang, ErlyDTL, Riak and Webmachine.
  3. Even though it's not yet recommended, I'll be using the latest version of Erlang to power Webmachine and Riak (R14A). If I were to build a production application I would follow the guidelines of the Basho guys and use R13B04. Since this application isn't a production application happy to take the risk :)
  4. Rebar is the tool we'll be using to handle builds, but I won't be covering it in any depth.
  5. You will need the latest versions of both Mercurial and Git so make sure they're downloaded and installed before you follow this article.
  6. We'll be doing some interaction with Riak via curl, so make sure you have it downloaded and installed as well.
  7. This is intended to be a step-by-step guide targeted at those who are very new to web development in Erlang. This may not be the most ideal set up, nor the best way of doing certain things. I am hoping that those people who are more experienced than I will be able to provide feedback and guidance in areas where I am lacking.
  8. Over the course of this series I'll be attempting to build an Erlang version of the Code Smackdown site that I've been working on here and there with a mate of mine. You'll see that the sample application we're working on is called "csd" for obvious reasons.

OK, let's get into it. First up, Erlang.

2Mar/1033

I’m so impressed I want to pay you less

Slave driverThe title of this post is a statement that I've heard a few times in the past while at work. The people who said it might not have used those exact words, but the intent is the same. Usually I hear it in the following form:

"We're very happy with the work you've done for us as a contractor. We want to keep you on, but would like you to take a job as a permanent employee and continue to work on the project."

Once they've made this point, they then feel the need to harp on about the good points of becoming a permanent employee. Things such as job security, sick/annual leave and better hours tend to get mentioned. All of them are complete bullshit of course.

There is no such thing as job security. Sick and/or annual isn't enough to make up for the difference in pay. Hours tend to always be worse when you're working for the man, because you're expected to do whatever needs to be done regardless of the hours. This is worse if you're working on mission-critical stuff.

4Jan/102

Katacast: Shopping Checkout in Erlang

I've recently discovered the joys of CodeKatas. If you're a geek looking for a way to sharpen your saw then I highly recommend taking a look at these and trying a few out. They're great fun and they're a good way of getting your feet wet with new languages (especially if you're tired of Project Euler).

31Oct/0925

The Future is Erlang

erlangFor quite a while I've been using my spare cycles to chew over a problem. This problem is not one that hasn't been solved before, but one that I feel can be solved in a much better way. From the bit of research that I've done, I can see at least three areas which can be improved on dramatically. So I've decided, after a long period of deliberation, to go ahead and build my solution and release it to the world as a service!

I know, this kind of thing happens thousands of times a day. Some arbitrary geek decided to build the next killer app and expects to make a crapload of cash out of it. While that would be nice, the ultimate goal isn't the cash. The goal for me is to build something that gets used, and for me to begin to master an area of technology that I've had a quiet passion for for a long period of time now.

My plan is simple. While learning the technologies that I will be using I'll be building another application and blogging about it so that all of you can learn with me. Meanwhile, I shall use my learnings to build this other application at the same time.

The final result should be a series of posts which help other people learn the technology stack, give better coverage and visibility to languages and technologies that a lot of the geek world doesn't know about (and really should!), and for me to carve myself a bit of a niche here on the East coast of Ozland. I am hoping to be able to consult my services out to other businesses as a result.

For those that are interested in following along, here is the full tech stack and toolset that I'll be using:

  • Erlang - A fantastic cross-platform functional programming language that has some amazing features.
  • Webmachine - A HTTP toolkit which sits on top of Mochiweb that makes it easy to build well-behaved HTTP applications.
  • Nitrogen - An Erlang-based framework that makes it easy to build websites.
  • Riak or CouchDB - Both of these amazing pieces of tech are potential candidates for the back-end storage. I'm not yet sure which one I'll go with.
  • jQuery - A great JavaScript library for the front-end.
  • VIM - My favourite text editor :)
  • Xubuntu - Ubuntu Karmic Koala with XFCE as the window manager.
  • Mercurial - My favourite version control system.
  • Trac - A project tracking tool.
  • VirtualBox - My choice for virtualisation. I tend to run Windows 7 as my primary OS, so most of my dev will be in a VM. When I get my desktop machine back up and running (with all three monitors!) it'll most likely multiboot Win 7 and Xubuntu.
  • Google Wave - I'll be using this for communications with some really switched on people in the Erlang community who have kindly offered to help me with questions and whatnot specific to some of the areas of tech I've mentioned above.

During the course of my blogging/learning I'll be focussing on Webmachine, Riak/CouchDB, Erlang and Nitrogen. All the other tools will probably get mentioned along the way, but the primary goal is to focus on these things.

I'm really excited! I'm currently in the process of documenting my goals and the design for the main application. Once that's done, I'll get started with the fun stuff. I've got a lot to do and it should be a fun ride. I hope you enjoy following along!