Interfacing Lua and Ruby with C
summary
Claims that a professional C/C++ programmer can embed and script with Lua after these basics, noting Lua is ~60,000 lines and LuaJIT exists for speed. Explains bridging via the lua_State stack (push/pop, type checks, userdata, length‑prefixed strings, tables starting at one), and shows a working raw socket C wrapper used to drive network tests in manufacturing. Covers Ruby C API (VALUE, conversion macros, building .so extensions loaded with require) and practical pitfalls of memory and type marshaling.
AI-written summary · about
chapters (22)
- 0:00Start
- 1:19Why??
- 3:22Why Lua?
- 4:01Introduction to Lua
- 4:50Specialties of Lua
- 6:17Superpowers of Lua
- 7:17Hello world
- 7:40Lua Control Structures
- 8:21Lua Examples
- 9:52Lua Function Examples
- 10:50More on Lua Functions
- 12:36Closures
- 13:42Lua Tables
- 14:56Useful Lua Idioms
- 15:34Lua Packages
- 16:49Lua Internals
- 17:51Lua & C-Introduction
- 18:50Stack between Lua & C
- 24:00Related technologies
- 27:11Quick Introduction to Ruby
- 27:27Ruby: Details
- 30:03VALUE
related talks
33mHowling at the Moon: Lua for C++ Programmers
01h 33mC++20 + Lua = Flexibility
47mRapid Development of Software Solutions with C++ and Lua
20mScripting with Luerl
44mThe Ruby Guide to *nix Plumbing
01h 01mScripting at the Speed of Thought: Lua and C++ with sol3
39mWhat lies beneath the beautiful code?
24mThe State of C Extensions: Alive and Well, so Learn to Deal
