You are here

Rolling with Lua

Submitted by devblog on Thu, 25/06/2015 - 22:43

For some time I have been looking for an interpreted language with a good GUI toolkit which would allow me to have the ease of use of an interpreter wit the ability to drop down to a compiled language when speed is necessary. FreePascal and Lazarus with the LCL are my preferred tools for performance computing, but I also need something which avoids the compiling overhead and good for rapid iteration.

I learned about Lua and discovered pLua and some other libraries which enable Lua to be embedded in Lazarus. pLua includes an example component and how to use it, and also another version with uses LuaJit. But what I found best of all is VCLua. It compiles a lot of the visual LCL components into a dynamic library which can be called directory from a Lua script, meaning it doesn't have to be embedded in a compiled application. Once support is added for a component it becomes immediately available to any Lua script.

I tried to compile it and got it working on 32 bit and 64 bit Linux.

Although it compiles cleanly, the project contains hard coded library paths which cause compilation to fail. Successful compilation requires the removal of those paths. Synedit and RTTI Controls related code can be added by creating a dummy form, adding some components to it to get the necessary paths added and removing them after.

dummyObjects/dummyForm01.pas is a form with SynEdit and RTTIGrid added to add the required paths. It can be removed from the project, but the necessary paths should not be removed.

The messy component path is removed. I am not sure if adding the LCL adds extra bloat, instead of just retaining the paths. A forum query should sort that out.

Vertical Tabs

Add new comment