Forum > General

Lua module


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.


Some work has to be done:

1. Dynamic library access should be done via unit dynlibs, this makes it portable across *nixes.
2. has it been tested for 64-bit ?
3. check for differences between the two to avoid that you undo fixes to the old code.

then submit it to the bugtracker at or

I'm mainly a Lua programmer, and only occasionally a Free Pascal programmer (in fact, it's just one large Pascal program that started off in Turbo Pascal on DOS 3.3 twenty years ago and went through an uneasy p2c phase until Free Pascal came to the rescue). I.e. I use this module in order to write as much of the program as possible in Lua rather than in Pascal. I can attend to bringing the issue to the attention of the Lua community, but find myself out of my depth as far as the issues raised by marcov are concerned. The version I made can be found on the Lua Users Wiki [].


[0] Message Index

Go to full version