New RiscLua book onlineBy Gavin Wraith. Published: 16th Jul 2006, 13:14:20 | Permalink | Printable
BASIC is stuck in the 1960s, is it time for a change?Fresh from describing Lua scripting with StrongED, Gavin Wraith is in the process of writing an online beginner's guide to Lua, a flexible scripting language. More material may be added over time, and below is an edited extract from the opening chapters of the book. Lua is a straight forward, lightweight programming language used in games such as World of Warcraft and Baldur's Gate, as well as many other applications.
The aim of this booklet is to teach the elements of programming in RiscLua, a dialect of the scripting language, lua, which is especially tuned for RISC OS.
It has been traditional to use BASIC to demonstrate programming ideas, because it is already built into the RISC OS ROMs. In the early days of Acorn this made good sense, because memory constraints prevented the implementation of more modern programming languages.
The chief drawback nowadays of BASIC as a vehicle for learning about programming is that it misses out on ideas that have been accepted as central to programming many decades ago, simply because those ideas were developed long after BASIC was born in 1964. Computer science has simply moved forward, and BASIC is missing out.
About twenty years ago, so-called scripting languages started to become popular. These languages were originally intended as a sort of glue for binding applications together. They let you accomplish a lot of work for very little effort. The languages Lua, Perl, Python, Ruby and Tcl are leading examples today.
Lua is probably the fastest among them - a contentious matter which depends on which mix of benchmarks you take - but what is more important for our purposes is that it is the smallest, and has the simplest syntax. Different languages are designed for different purposes, so comparisons must always be taken with a pinch of salt.
Lua has its origins in a need for a simple data description format for surveyors working for Petrobras, the Brazilian state oil company. They were not expected to have any programming skills. What has been unique about the evolution of Lua has been its founders' determination to keep it simple. That has made it an appropriate language for beginners.
It is also one of the most popular languages in the commercial games programming community; knowing Lua has become a marketable skill. RiscLua differs from standard Lua in certain minor particulars.
You sometimes read that programs are like cooking recipes - that they consist of a list of instructions which the computer carries out one after the other. Unfortunately this is not really correct in general. However, as you will see, in Lua's case, this is a useful analogy.
Click on the link below to begin learning Lua.
Lua programming book
Previous: 3D dog fight game first release
Next: Interview with a ROS Open shareholder
DiscussionViewing threaded comments | View comments unthreaded, listed by date | Skip to the end
Please login before posting a comment. Use the form on the right to do so or create a free account.
Search the archives
Today's featured article
An introduction to IP networks
Part one of masking the 'net
10 comments, latest by Umair on 9/9/04 10:11PM. Published: 4 Sep 2004
Iyonix emulator mulled by developer
The open source machine emulator GXEmul could be used to create an Iyonix emulator for RISC OS users and testers of ROOL ROM images, says one prominent coder. GXEmul already includes emulation of Intel's 80321 chip, the processor used in the Iyonix, and can run NetBSD on hardware similar to Castle's computer. Anyone interested in taking a closer look can apply John-Mark Bell's initial patch to the source code.
13 comments, latest by diomus on 23/11/08 2:29PM. Published: 20 Nov 2008
News and media:
RISCOS Ltd •
RISC OS Open •
MW Software •
Advantage Six •
CJE Micros •
Liquid Silicon •
Chris Why's Acorn/RISC OS collection •
The Register •
The Inquirer •
Apple Insider •
BBC News •
Sky News •
Google News •