Day 3: Lua and the World

You’ve started down the path to adventure, treading lightly at first through Lua’s gates. You’ve found the simplicity and power in its data structures and concurrency routines. Now, it’s time to apply that knowledge and use Lua to build a real project.

Today, we’re going to make music with Lua. Lua doesn’t come with a sound library, but there are plenty around that are written in other languages. We’ll use one of Lua’s strongest features, its C interface, to control an open source music library.

A few stalwart adventurers have blazed this trail before us. They’ve used Lua’s expressiveness for their program’s logic, C for the performance-critical code, and the techniques in this chapter to glue the two together. For instance, ...

Get Seven More Languages in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.