Skip to Content
Creating Solid APIs with Lua
book

Creating Solid APIs with Lua

by Tyler Neylon
February 2017
Intermediate to advanced
133 pages
2h 43m
English
O'Reilly Media, Inc.
Content preview from Creating Solid APIs with Lua

Preface

This book covers integration between the Lua and C languages with emphasis on building a user-facing API. Your API might be used to speed up development within your company; it might be released to customers as a way to customize your app or game; and it could be used as the foundation of a domain-specific language within a platform you’re developing.

I’m going to assume that you know Lua. But if you don’t, you’re in luck: it’s easy to pick up. If you happen to know JavaScript, a great place to learn Lua is my short article series Learn Lua from JavaScript (O’Reilly). Even if the language is new to you, Lua is so readable that you could probably read this entire book without having to look at a reference. My focus will be on the fundamentals of creating an API written in a combination of C and Lua, and exposed to users as a pure-Lua interface.

Note

Although in some contexts the term API implies web-based interaction, such as a RESTful HTTP-based interface, this book is not about this type of API; rather, it’s about creating a set of Lua classes and functions used to programmatically work with a local application.

This book is split into two parts: Part I, Making a Lua API, describes how C and Lua can interface with each other, whereas Part II, Script Safety, explains how to safely run scripts written by users who might make mistakes or might even purposefully attempt to break your system. Not very nice! But this book will help to prepare you for issues like this.

Chapter 1 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Create a Vim Plugin

Create a Vim Plugin

Alfredo Deza, Noah Gift
Hands-On Enterprise Java Microservices with Eclipse MicroProfile

Hands-On Enterprise Java Microservices with Eclipse MicroProfile

Cesar Saavedra, Heiko W. Rupp, Jeff Mesnil, Pavol Loffay, Antoine Sabot-Durand, Scott Stark

Publisher Resources

ISBN: 9781491986301