Why I am learning Lua in 2015

Since I started programming 15 years ago I’ve had many ups and downs with programming language choice. First learning C and then C++, I eventually took a Java course at the University of Washington during my undergrad. At that point I knew I didn’t want to be a programmer because all I knew was C++/Java and some C#.

In 2008 that all changed when I started using Ruby on windows to script up a few text processing tasks I did at work. I loved the language! It was expressive, simple, didn’t involve casting everything to a specific type and just worked for me.

Over the last 7 years I’ve worked primarily in Ruby, with some work in Php, Python, Javascript, and other things mixed in. But since it’s 2015 I feel like it’s time for a change. Mike (Perham) has moved onto Go, and a lot of others have moved onto doing Rust development. The emphasis for me between these languages has been running fast code in a parallel fashion.

While I think Rust is very neat! I feel it’s still immature, and while I do like Go it just doesn’t excite me as much as Ruby did in 2008. That’s why I’m doing something a bit uncommon and switching a lot of my development to Lua. I’ll still be writing Ruby once in a while but I feel the world has changed more towards microservices, faster systems languages, and fundamentally away from languages like Ruby.

I think what Lua brings is quite impressive:

  • Fast runtime through LuaJIT
  • Prototype based language that isn’t full of quirks (javascript…)
  • Dynamic, strong, and duck typed (just like Ruby)
  • Beautiful interface with existing C libraries
  • Small footprint. Lua is amazing cause most of the time it’s embedded inside of a bigger program.

In case you’re wondering what I’ll be using Lua for. I plan on using it utilizing ZeroMQ to process a lot of template work, A/B testing, and monte carlo analysis.

Stay tuned to hear more. Would love to hear your thoughts about Lua.

ZeroMQ is the Redis of Distribution

Lately I’ve been toying around with ZeroMQ a lot more (or ØMQ). A couple of years ago I thought it was definitely interesting since it was optimized for speed, and handled a few patterns. It wasn’t until recently though it clicked for me and it all made sense.

ZeroMQ is the Redis of Distributing Work.

Redis is a great database but more especially for being something that exposes an API around common data structures. For instance, if you want a Set, Hash, List, SortedSet or much much more you just have a simple command to either create, read, update, or delete them. See http://redis.io/commands for more.

ZeroMQ on the other hand is an exceptionally simple message queueing library. It allows you to send data between endpoints with ease. But what truly intrigues me is the ability to easily set up Pub/Sub, Request / Reply, Push / Pull, or Pipelining of data using a simple Socket API.

What a joy! What this means is I can focus on sending the data and not how to send it.

Why did I write a Machine Learning Book in Ruby?

When I tell developers that I wrote a Machine Learning book in Ruby usually I get blank stares. After the initial shock they ask “why not python?” “or R?” “or even LISP??”.

There seems to be a long stigma as to what sort of language you use for what. Python is used in academia for machine learning, statistics, and general proofs of concepts. Ruby is really just a dialect of Rails and similar to javascript gets classified as only valuable in websites.

This blog post will outline the reasons why I decided to write an entire book about Machine Learning in Ruby. Not Python, R, Julia, or Matlab.

[Read more...]