• A pipe operator for Lua

    I have recently been getting into Elixir, and one nice feature it has is the pipe operator. It allows us to express a pipeline of function through which an object will be dragged. This got me thinking: with how flexible Lua is, would it be possible to add something similar to Lua as well?

    Continue reading…

  • Spreading tables in Lua

    Javascript has a spreading operator which lets us splice the contents of an object or array into another object or array. This makes it very easy to create an object based on another object and override or add entries. Since Lua and Javascript are quite similar, wouldn't it be nice to have this operator in Lua as well? Lua is a minimal language, so adding a new operator seems unlikely, but Lua is also very flexible, and we can add a spreading function instead.

    Continue reading…

  • Macho, the man command on steroids

    The Unix man command can open a manual page if you know its name, and the apropos command can search through the manuals if you are looking for a specific word. Let's put the two to work together into a command I like to call macho: the man command on steroids.

    Continue reading…

  • How I manage SSH connections

    I have a number of machines I need to connect to via the secure shell (SSH), and typing in the IP address or host name by hand every time get tedious very quickly. I could use an application for that, but that's bloat. Let's instead see how we can leverage small universal tools to build an elegant solution of our own instead.

    Continue reading…

  • Implementing MsgPack.rkt, part 2

    In this part of the series I want to go into how to pack data to bytes in MessagePack. We will see how to dynamically dispatch on type and how to pack a selection of particular types.

    Continue reading…