Lua Embedding Training Course

Primary tabs

Course Code


Duration Duration

14 hours (usually 2 days including breaks)

Requirements Requirements

A good understanding of the basics of the Lua programming language

Overview Overview

This Lua course teaches how to interact with Lua from C (and/or other programming languages).

We discuss integration in both directions: how to embed C code in Lua (eg. for performance gains), and how to make a C/C++/Java program extensible with Lua.

As an in-class exercise we create a small program that is extensible with Lua.

The course also tackles the Lua virtual machine and teaches how to understand the bytecode underpinning the language.

This course can serve an add-on to the Lua Fundamentals or Lua Advanced courses in which case a shorter (1 day) version can be organized.

Course Outline Course Outline


  • Compilation
  • Eval
  • Relationship with the environment
  • Binary chunks

Garbage collection

  • Weak tables
  • Finalizers, the __gc meta-method

Lua bytecode and virtual machine

  • Generating bytecode from source code
  • Reading and analyzing bytecode
  • Quick tour of the source code of the Lua VM

C modules

  • Calling C from Lua
  • Search path and loading of C modules

Calling Lua from C

  • The Stack
  • Error handling
  • Continuations

Handling Lua values and types from C

  • Arrays
  • Strings
  • Userdata
  • Metatables
  • Object oriented calls
  • Light userdata

Memory management

  • Allocators
  • GC API

Threads in Lua

  • Co-routines vs threads
  • Real multi-threading and Lua states

Guaranteed to run even with a single delegate!
Public Classroom Public Classroom
Participants from multiple organisations. Topics usually cannot be customised
From £2190
Private Classroom Private Classroom
Participants are from one organisation only. No external participants are allowed. Usually customised to a specific group, course topics are agreed between the client and the trainer.
Private Remote Private Remote
The instructor and the participants are in two different physical locations and communicate via the Internet
From £1350
Request quote

The more delegates, the greater the savings per delegate. Table reflects price per delegate and is used for illustration purposes only, actual prices may differ.

Number of Delegates Public Classroom Private Remote
1 £2190 £1350
2 £1405 £970
3 £1143 £843
4 £1013 £780
Cannot find a suitable date? Choose Your Course Date >>
Too expensive? Suggest your price

Related Categories

Course Discounts

Course Venue Course Date Course Price [Remote / Classroom]
RabbitMQ London, Barbican Mon, 2016-11-07 09:30 £1832 / £2432
MariaDB Database Administration Bristol, Temple Gate Wed, 2016-11-09 09:30 £1733 / £2333
MongoDB for Administrators London, Barbican Mon, 2016-11-14 09:30 N/A / £2432
MongoDB for Advanced Users Birmingham Wed, 2016-11-16 09:30 £1733 / £2358
Big Data Architect London, Barbican Mon, 2016-11-21 09:30 £4406 / £5756

Upcoming Courses

VenueCourse DateCourse Price [Remote / Classroom]
Bristol, Temple GateWed, 2016-11-16 09:30£1350 / £2490
Manchester, King StreetThu, 2016-11-24 09:30£1350 / £2640
Bradford - Carlisle Business CentreThu, 2016-11-24 09:30£1350 / £2390
Swansea- Princess HouseMon, 2016-11-28 09:30£1350 / £2190
Aberdeen - Berry StreetThu, 2016-12-01 09:30£1350 / £2550

Some of our clients