This page collects a number of my Lua projects:
libwhy, which includes a lightweight GTK+ binding for Lua 5.2
ysdl, a lightweight SDL binding for Lua 5.1
Mike Pall's advanced readline patch (which I maintain)
Here's a version of the bit32 library from Lua 5.2.0, fully back-ported to Lua 5.1.4:
(The bit32 library in Lua 5.2.1 is identical.) On my linux and Mac OS X x86 systems, it passes all the bitwise.lua tests from the Lua 5.2.0 test suite.
libwhy is a library for developing applications, using Lua to script GTK+ GUIs. It contains several custom GTK+ widgets which are useful for audio applications. The library may be easily used from C applications, or stand-alone scripts may be executed with the included ylua binary. Several example scripts are included.
libwhy is specialized for use as a platform for my audio and music applications. As a GTK+ binding, it is very incomplete, and lacks documentation. It is licensed under the GNU Lesser General Public License, version 2.1. Unless you need a very lightweight, LGPL-licensed GTK+ binding, I recommend you use lgi instead.
The most current version of libwhy can be had from github:
https://github.com/smbolton/libwhy
The latest release tarball is this:
Applications which use libwhy include:
sfxr-dssi, a DSSI port of the famous sound effect generator.
ysdl is a lightweight SDL binding for Lua 5.1.x. Depending on what you are looking for, it may or may not be of interest to you.
Advantages:
simple: only a single C file to include in your application
small: many of the most common SDL functions are bound, but not all of them, so the binding isn't larger than Lua itself
includes functions from SDL, SDL_image, SDL_mixer, and SDL_ttf
Lua function names closely match their SDL counterparts, with predictable changes
MIT-style licensing
fast: very little type and error checking is done
Disadvantages:
unforgiving: very little type and error checking is done; if you pass the wrong argument to a SDL function, you will crash
small: if you need something that isn't yet bound, you'll have to add a binding yourself
not all SDL functions are bound
documentation is minimal
In other words, if you're looking for a complete, hand-holding SDL binding, this isn't it. If you'd like a simple, lightweight SDL binding, and don't mind occasionally adding things on the C side, then ysdl might work for you.
Download:
ysdl source: ysdl-20100710.zip
Example Applications:
Sam Lantinga's aliens SDL demo ported to Lua and ysdl: aliens-lua_ysdl_port-0.3r1.zip
(GPLv2; find the original at http://www.libsdl.org/projects/aliens/ )
Trygve Vea's Awesome Tower Defense 0.3 ported to Lua and ysdl (with some additions and modifications): awesometd-lua_ysdl_port-0.3r4.zip
(GPLv2+; find the original at http://anticrap.net/awesometd/ )
Thatcher Ulrich's meteor_shower LuaSDL demo ported to ysdl: meteor_shower-ysdl_port-0.3.4r1.zip
(public domain; find the original in LuaSDL 0.3.4 at http://luaforge.net/projects/luasdl/ )
I am the maintainer of Mike Pall's advanced readline patch. This patch adds the following features to the existing readline support in Lua 5.x:
Completion of keywords and global variable names.
Recursive and metatable-aware completion of variable names.
Context sensitive delimiter completion.
Save/restore the history to/from a file (LUA_HISTORY environment variable).
Set a limit for the size of the history (LUA_HISTSIZE environment variable).
Set the app name to allow for $if lua ... $endif in ~/.inputrc.
After applying the patch start Lua and try these (replace ~ with the TAB key):
~~ fu~foo() ret~fa~end io~~~s~~~o~~~w~"foo\n")
The ~~ are just for demonstration purposes (io~s~o~w~ suffices, of course).
The patches have been verified to work with Lua 5.0, 5.0.2, 5.1, 5.2, and 5.3. Compatible readline libraries include GNU readline version from 2.2.1 through 6.2;; Mac OS X libedit 2.11; and NetBSD libedit 2.6.5 and 2.6.9.
You may download the patches here:
http://luajit.org/patches/lua-5.3.1-advanced_readline.patch (works for Lua 5.3.0 also)
Copyright © 2017 Sean Bolton. Created with Sausage Grinder.