[Back to the Floodgap main page] Return to Floodgap Retrotech

Plua Revisited


Plua was (in version 2.0, its final release) an implementation of Lua 5.0.3 for the classic Palm OS (3.5 and up, including PalmOS 5 Garnet) written by Marcio Migueletto de Andrade. Besides implementing a small onboard IDE and the language itself, it could generate executable PRCs that would run using a standalone runtime, or be "cross-compiled" using a modified version of luac called plua2c. It has disappeared from most of its former locations, including Marcio's old site and the Yahoo! Groups site that used to host it.

Screenshot of actual Plua application. Plua was freeware, but was never open source during its supported existence. However, by historical happenstance as the maintainer of the plua2c port to Mac OS X, I retained the source code to that specific component and made 64-bit fixes to it to allow development on my Raptor Talos II workstation. With Marcio's permission, this revised version of plua2c is now open-source under the same MIT license terms as Lua.

Additionally, Marcio himself released Plua under the GNU Public License v3, making it available for further improvements. Now that Garnet is becoming more popular for retrocomputing, I'm hopeful that Plua can experience its own renaissance; we are reviewing options for how to update it for more devices and a modern audience.

About Plua 2.0

Plua offers a nearly full range of GUI controls, graphics (including turtle graphics and a sprite engine), sound, networking, resource and file operations as shown in the screenshot at right of a 100% Plua Gopher client running in Palm OS Emulator 3.5. Notice the use of native controls, including pull-down menus. The runtime can also be expanded with your own C-based libraries to add additional custom functions. Programs can be developed right on the Palm device itself.

A detailed language reference is included with the Plua distribution, or you can read the Plua documentation here. You can also read the FAQ.

Download Plua 2.0 for PalmOS

Download Plua (258K). This includes local copies of the documentation as well as online help, the IDE and the runtime. The PRCs can be installed with Palm Desktop or pilot-xfer. You will also need to install MathLib (50K).

Here is an example of what Plua source code looks like. This example draws an animated fishtank using bitmap resources.

You can download that script (with resources) and other example scripts (547K) to play with. These demonstrate Plua's graphics, UI, sound and networking capabilities. For some of the examples you will need PilRC to compile the resources; here is source code for 64-bit fixed PilRC (263K) suitable for most modern platforms.

Marcio has generously uploaded the sourcecode for Plua 2, which I maintain a fork of. Building it is somewhat difficult on 64-bit hosts, so you should have a 32-bit system or one capable of running 32-bit binaries. I currently build and develop Plua 2.x on a Power Mac G5; build tools for Mac OS X on PowerPC are available from the Floodgap gopher server.

Download plua2c

plua2c is the "cross-compiler" for Plua. It allows you to write Lua code on your desktop machine and build the executable PRC on the same system; you can then hotsync the binary over to a test device or run it in emulation. The target device needs Plua2RT and MathLib installed.

Generated applications may be distributed under any license you want, along with the unmodified runtime and any of your own libraries you may have created.

By Marcio's generous permission, the cross-compiler source code is available on Github, which I maintain separately due to the differing license. I provide some pre-built binaries below. These binaries (except for the original Mac OS X Jaguar port) are for modern 64-bit systems. The choice of platforms purely represents what I use or have access to, and I may add others in the future. I do not have the original plua2c binaries as I never used them personally.

Here are the usage instructions, which are the same for all the ports. These zip archives contain bare binaries.

Plua 1.x

Plua 1.1 and Plua 1.0 were the previous implementations of Lua for Palm OS, based on 4.0. I do not have the source code for 1.x or its pluac, and it has several bugs which were on purpose never fixed. It can be found on the Wayback Machine for Plua 1.1 or Plua 1.0. They are primarily of most use where you are developing for a device that is limited to Palm OS 3.1.

Comments

E-mail me.


Cameron Kaiser