Sources

Sources
The 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.blocklib block library
c.doublelib dbl library
c.power fast integer exponentiation
c.swilib swi 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_RNDExtend the base library with a random integer function.GCW_POWProvide a fast integer exponential function.GCW_CLOCKSuppress rescaling of clock ticks.GCW_BLOCKInclude the block library. Blocks are fixed arrays, as needed
by SWI calls.The following flag can only function if GCW_BLOCK is defined.
GCW_SWIInclude the swi 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_DIRExtend the os library with a directory iterator and a function to
return the filetype of a file.GCW_PALLApply Mike Pall's patch for unpacking-tables syntax.GCW_SUGARAllow \ for function and => for return.GCW_NEHABExtend the base library with Diego Nehab's error handling
functions. 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.
Back to RISC OS stuff