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
Desktop Repton Plus review
It hurt my brain
10 comments, latest by AW on 12/2/05 8:06PM. Published: 10 Feb 2005
Video converter port FFmpeg updated
Bug fixes and new formats supported for application that converts videos into a format playable on RISC OS computers. Also don't forget Murnong by the same author, which allows users to watch YouTube videos from their ROS desktop.
6 comments, latest by gvrace on 30/11/08 9:41AM. Published: 23 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 •