Ramblings of an old-school software developer, father, and woodworker.

Recent Posts

Contract Negotiations
As a software freelancer, how should contract negotiations look?

Freelance Contract Legal Clauses
Some clauses that I use in my contract as a freelancer.

Frontend and Backend: What's so different?
Thoughts on Development Domains

We Are All 10x Developers
What a 10x developer really is, and why sometimes we’re all 10x.

New And Improved Lua Bindings

· by Tim Mensch · Read in about 2 min · (409 Words)
languages lua

A while ago I wrote about the troubles I was having with Lua bindings. Some were too heavy, some were too flaky.

And after spending all that time reviewing them, I ran out of time and had to pick one – and I made the mistake of picking a flaky one, with the result being that I have wasted a LOT of time over the past year fixing corner cases and issues with it.

Over the past few weeks, though, I’ve been encouraging and working with Gaspard Bucher on his Dub binding generator. I liked the design at the start – it uses templates to specify what the binding code should look like, and it parses C++ headers using the well-tested documentation tool Doxygen.

What I didn’t like was that it was written in Ruby. Note the past tense. Partly at my prodding he decided to start a port from Ruby to Lua.

Don’t get me wrong; Ruby is a nice language for writing tools. The problem is that Ruby is heavy and comes in many versions – using Ruby in a tool requires that you end up with an entire Ruby ecosystem on your computer, and using it in more than one tool pretty much requires that you also have a Ruby ecosystem manager. No, Dub 2.0 is written in Lua, and I have a set of bindings for my library that are lighter than the lightest emitted by any of the tools I reviewed, and (probably?) faster than the fastest code output from those tools as well. (No benchmarks yet, but the code is tight!)

Working with Gaspard has been great, too – he’s been very helpful in showing me how to use the tool, and in fixing issues as I’ve come across them. I’m hoping to help put together some documentation for Dub, since that’s the only thing that it’s really lacking at the moment, and I tend to like to write documentation.

So my new conclusion is that Dub is the coolest Lua Binding Generator for games and other applications where you need speed and lightweight code!

Comments