Thread: iLiad Lua: scripting for Iliad
View Single Post
Old 12-13-2008, 06:22 AM   #1
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Cool Lua: scripting for Iliad

Hi All,

Lua is a scripting language. And it's running on my Iliad right now! It's easy to learn (if you are used to programing), its interpreted (you don't have to compile anything), it's fast and small (the executable is 128K). Much smaller than perl, python or ruby; much easier and fun than shell scripts, awk, sed...

Lua is even cooler than it looks at first glance: it's easy to extend it (write functions in C, and call them from lua), or embed a lua interpreter in a C-program (it's used for scripting in game engines, camera's, ...)

The attached file contains the Lua binary with extensions for network stuff (luasocket) and XML parsing (luaexpat). This is enough to fetch files from Internet (ftp, http) and parse rss feeds. Unpacked it's less than 400K.

Is this cool or is it not? I can feel the karma

If you are interested to compile this stuff yourself: I keep notes on http://wiki.hpelbers.org/Other_stuff_for_the_Iliad. It's not complete or well maintained, but it might save some time...

Lua can be installed on your Iliad as follows:
Code:
tar xvfz lua_for_iliad.tar.gz
cd lua_for_iliad
cp -r * /usr/local
The executable will be in /usr/local/bin, which is included in PATH by default.

Happy scripting
Hansel

Links:PS: No warranty what so ever
PS2: I'm just playing with this: not going to maintain or document it
Attached Files
File Type: gz lua_for_iliad.tar.gz (126.3 KB, 543 views)

Last edited by hansel; 12-13-2008 at 02:04 PM. Reason: added link to tutorials and ref manual
hansel is offline   Reply With Quote