• MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    Lua is one of modern scripting languages. It is highly portable so compiling the interpreter and basic commandline tools included in the package is a matter of ./configure; make. Usefulness of such a fast port is limited however. Encounaged by the language portability, compactness and elegance I've tried to make some more integrated port. The first results are available here for a public review.

    The interpreter itself has been packed into a shared MorphOS library called lua.library. The library is small, it has less than 140 kB. The complete language "C API" is exposed, including debug one. The interpreter is barebone however, it means all the standard libraries are excluded for now. I'm going to tweak the Lua package manager to handle C packages as MorphOS shared libraries too. Then all the standard (and extra) libraries will be dynamically loaded on-demand.

    A unique feature of MorphOS Lua package is Lua Explorador. It is written from scratch, MUI-based source level debugger using Lua debug API. While not yet complete, it allows for loading a script from file, view the source, run it in a single-step mode, watching all local and global variables, Lua stack and call history. Lua Explorador uses a (private for now) MUI class LuaDebugger, which will be later made a public MUI custom class. Then every application using Lua for internal scripting and expose scripts to user, can embed a debugger and allow for easy script testing.

    A small example code accompanied with system includes and lua.library autodoc allows developers to try Lua scripting inside an application. Communication between C and Lua code is very easy.

    In the future I plan to add an "ARexx" module, enabling Lua to communicate with multiple applications via their ARexx ports. Then Lua can be used for the same purpose as ARexx, just with much nicer syntax, object oriented programming and, well, the source level debugger.

    It is also possible to add interfaces to system libraries. Having bindings to MUI Lua can become a rapid application development language. This is a bit more distant future however.
  • »06.12.10 - 17:19
    Profile Visit Website