The Lua module supplied with the Free Pascal compiler is very old (Lua 5.1.1), that is maybe about 12 years ago. In the meantime, Lua 5.2 and Lua 5.3 have appeared. For Lazarus a module 'lua53.pas' by Malcome@Japan has appeared, which does not compile on vanilla Free Pascal 5.3. I needed to make the following tweaks:
1. Remove 'inline' from three function declarations that have open array arguments.
2. For Linux, add {$linklib dl}.
It would be better if the official Lua module for FPC could be modernized.