lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


pLua and pas2lua are both projects that I wrote specifically for Lua when we were working on the Lua Gems book.  pas2lua never quite got finished as there are many aspects of the integration that are developer dependent and wrapping them up in a nice little auto-generating package worked out to be a greater challenge then I've had time to complete.  pLua is quite stable in Lazarus and with a few minor tweaks does well in Delphi as well.  I have the changes necessary for the Delphi version (community contributed changes), but currently lack the copy of Delphi to actually test them.  I'll happily send them to anyone interested, but until I can test them, I'm weary of publishing them on the site.

As far as working with Lua and Lazarus in a production environment, there are several games already on the market that have done this.  It works very well until you start looking at Mac, then everything goes down the tubes.  For some reason getting Lazarus (FPC, Vector, or whatever) working with Lua on a Mac has been the bane of many of our existents.

On the same site there are also some simple examples (SDL, Lua, and Lazarus Simple Game Engine) showing how to integrate the packages.  The chapter in the Lua Gems book also tries to address using Lua in Lazarus as completely as possible.  With the latest versions this is a bit easier and of course the options have moved around a bit, but still the information should be easy enough to understand.

The one thing I've noticed working with Lua in C/C++ and Pascal is that Lua actually integrates with the object model of Pascal very well.  Using typinfo its very easy to make any persistent class available to/in Lua.  Of course, in Lazarus/FPC, this works even better since most (if not all) base classes automatically surface RTTI information, even TObject supports this behavior as built in (unless you specify Delphi compat, then you have to use +M and -M around your class interface).

Any other questions I'll do my best to answer,
 - Jeremy

On Mon, Jan 31, 2011 at 4:59 AM, Steve Litt <slitt@troubleshooters.com> wrote:
Hi all,

For want of a better description, Lazarus is kinda sorta like a free-software
Delphi -- drag and drop development on top, free-pascal underneath.

http://www.lazarus.freepascal.org/

Lazarus is nice for quickly building Gui stuff, but Pascal isn't as good as
Lua. While searching for Lua files on my computer I noticed that Lazarus came
with some Lua files, so I looked up Lua and Lazarus on Google. Here are some
things I found:

pLua: A Lua wrapper for FPC, Lazarus, and Delphi,
http://www.eonclash.com/ViewProduct.php?ProductID=26

pas2lua and lua for Delphi/FPC: A collection of source files to use Lua
scripting inside of Delphi/FPC/Lazarus,
http://www.eonclash.com/ViewProduct.php?ProductID=21

Have any of you used Lua with Lazarus or even Delphi? I'm thinking it could be
a powerful combination.

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt