-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|514|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Showcase Home -> Functions Libraries


 
Cower
Created : 25 July 2009
 
Language : Blitz Max

LuGI

LuGI is a set of modules for providing an interop layer between BlitzMax and Lua as well as wrapping BlitzMax types for use within Lua.

LuGI Repository
LuGI Source Zip
LuGI - pronounced loogie - is a framework for building Lua glue code for BlitzMax, and provides much of the ground-work needed to get BlitzMax object support working quickly and painlessly in BlitzMax. The way LuGI does this is by firstly generating glue code for your project, and secondly by using its core API to expose that glue code in a manner that best mimics the way one would use the wrapped code in BlitzMax, thereby providing an almost seamless combination of BlitzMax and Lua.

The code is composed of a module for generating the required glue code to make use of LuGI and a very small core API: two functions to push objects and arrays, two functions to get objects and arrays, and an initialization function. The remainder of the API is hidden away by monks who cannot speak, for they have cut out their tongues. Incidentally, the API is also inside of a header file (lgcore.h) - however, the rest of the LuGI core code is strictly for those interested in writing their own code generators.

Alright, that roughly explains what LuGI is for and what it does. LuGI is free and open-source under the MIT license. You can use, modify, sell, etc. this code, and essentially do whatever you like with it, provided you follow the very simple terms of the license.

If you're not already familiar with Lua, I'll quote their about page for you, which should explain it fairly simply:
Lua is a powerful, fast, lightweight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.
(Emphasis mine)

There is already some documentation in the wiki, and I'll be working on improving that as I go along based on questions anyone might have about how to do something, how LuGI works, or what general rules there are for writing your own code generator. The goal here is that by releasing it, I'll be able to get some feedback on what areas need improving, try to locate bugs, and all that general stuff you get when people use your code.

The entirety of the core is written in platform-independent (or it is as far as I can see) C++. None of the 'complex' aspects of C++ are used, such as templates, metaprogramming, operator overloading, etc. just to keep things simple on the inside. If you know C++ and something about Lua, chances are you can tweak it to your liking. I may have also profusely commented the source, but I don't know how much that would help you. The generator doesn't rely on knowing how the core works internally, so you can change almost anything you want in either the core or the generator and it should not how the other module works. There are exceptions to this (e.g., the initialization routine), but pretty much anything in the core C++ is modifiable without hurting anything.

If you have any questions or comments, feel free to post them here. Should you encounter any bugs, I would encourage you to post an issue on the GitHub page (just click the 'Issues' tab at the top and click 'Create Issue') so that I'm notified about it more easily, but you can post about any issues you encounter here as well. Finally, if you have any questions that you cannot ask here or need to remain private, you're always free to e-mail me.

I apologize that this has no screenshots, but this doesn't do anything visual on its own, so you'll have to forgive me.

Latest Update

For revisions, commits, changes, etc. please view the commit log on GitHub. You can make comments on any commit, file, or even hunk (a piece of a commit) to request further information about a change if need be.

 

Comments