lua-users home
lua-l archive

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


The pack you sent me is undoubtedly wonderful. I have the classes, the procedures and functions, some examples and, but I ask : considering I am not a C programer, considering I've never embeded Lua with Pascal or without Pascal, considering Lua has a stake, but I don't know what is added to it or popped, considering I don't know the concepts behind the idea to embed Lua, considering all this factors, it is probable I will be successful? Perhaps, this is the natural path everyone have followed. Perhaps, testing and making experiences, I will be able to do everything. However, I confess that after uunpacking the files, I became I little bit frightful.

In the documentation, I found a list of functions, however I hoped to find some progressive examples. Firstly, opeining Lua, executing a script without any interaction and closing Lua interface. Secondly, registering a function to use in Lua or teaching how to deal with variables dynamicly alocated in Lua, staticly in Pascal.

In other words, at my first contact, it seemed to be a very good material for a C programer, acquainted with Lua embedding, but interessed in knowing how to translate one's C knowledge to Pascal.

Your e-mail was present for me, because I could verify I will do what I want. Perhaps, the examples seemed to me more complex because I don't use Lazarus. I am blind and program by means of a screen reader. The visual interface of Lazarus in stead of helping disturbs me. Therefore, I prefer to use FPC in console mode. No, thinking better, it is not the problem. I am able to separate the Lazarus code and to capture the FPC code. The trouble, the trully trouble is: or the documentation is complete, but I didn't pay sufficient atention, or it lacks and I need some conceptual reading to understand the mechanism to embed Lua in Pascal, not exactly only the code, but some introductory explanations. After understand the basics, I think it will not difficult to track code lines!

So I ask: do you know some reading about the conceptual pillars of Lua embedding in Pascal or in any language? Is it necessary to learn at least something of C in other before deeping in Lua and Pascal integration?

thank you very much for the atention.


----- Original Message -----
Sent: Thursday, December 17, 2009 3:38 PM
Subject: Re: Embeding Lua in Pascal

PS: In "Lua Programming Gems" on pages 301 to 311 I try to cover this as much as could be covered in the space.  Your local B&N may have a copy you can browse or look at  I'd highly recommend the book either way as there are lots of nice tips, tricks, and information presented in the book that you will have to dig for elsewhere :)

 - Jeremy

On Thu, Dec 17, 2009 at 11:26 AM, Jeremy Darling <> wrote:
Warning, shameless plug ahead.  The Lua unit that comes with FPC falls short in almost every way.  I've got one of my own (comes with source and examples and is also what I used in the Lua Gems book) at

There are problems with it in Delphi, but FPC, GNU Pascal, and the rest seem to be happy with it.  There is also a simple (and I mean simple) SDL + Lua + Lazarus game engine on the same site.

You might also be interested in as there are several discussions on it about Lua and Pascal.

 - Jeremy

2009/12/17 Michal Kolodziejczyk <>

On 17.12.2009 09:34, Luciano de Souza wrote:

> In the official pack, Freepascal come with the unit Lua. It's wonderful
> because I can use Lua without further components. Bu how to do that.
> Even if trying, I could not understand the mechanism to call the
> interpretor, register functions Pascal in Lua, register functions Lua in
> Pascal, convert the types of variables, etc.

I don't program in Pascal (since TurboPascal days ;) but you can check
some source codes:

There is also but it seems unmaintained

If the Lua unit comes in the official pack, you should ask Freepascal
maintainer for help.