The latest sources are arranged for compilation
with the Norcroft C compiler. I have experimented with the Gnu C
compiler both with Unixlib and the shared C library, but by a
small margin on speed, and a large margin on size, the Norcroft
version won.
The sources consist of the standard Lua distribution, decorated
with extra #ifdef sections, together with extra files:
s.sys Objasm source for RISC OS linkage
h.sys header
h.risclua RISCOS-specific compilation flags
c.final error handling library
c.doublelib dbl library
h.power
c.power fast integer exponentiation
c.swilib riscos library
c.lpeg Roberto Ierusalimschy's parser expression grammar library
If the compilation flag RISCOS is undefined only the standard Lua
distribution code is visible. If RISCOS is defined, further flags
may be configured in
h.risclua. These are:
GCW_INTIf this is set 32-bit integers are used in the Lua virtual
machine. Otherwise 64-bit floating point numbers are used,
which would be slow on most RISCOS ARM-based machines.There follows a series of flags which only function when GCW_INT
is defined.GCW_DBLInclude the dbl libraryGCW_BITExtend the Lua virtual machine with bitwise operations.GCW_POWProvide a fast integer exponential function.GCW_CLOCKSuppress rescaling of clock ticks.GCW_SWIInclude the riscos library. This enables SWI calls from within
RiscLua programs (as SYS in Basic does).
GCW_LUACOUTRename the standard output of luac to <Wimp$Scrap>.GCW_HARDTreat hard spaces as soft. This avoids invisible typographic errors.GCW_MORECHARSAllow some extra characters in identifiers.GCW_PALLApply Mike Pall's patch for unpacking-tables syntax.GCW_SUGARAllow \ for function and => for return. If GCW_INT is not defined then the following two flags can be used:GCW_SIGFPEtrap floating point errors.GCW_MATHProtect some of the functions in the math library from silly arguments.
RiscLua is obtained by compiling with all the flags defined.