l...@csg.uwaterloo.ca (Luiz Henrique de Figueiredo) writes:
>try Lua
Lua is a splendid piece of software, imho -- very clean language design, powerful through its reflexivity, nice API. The documentation is a pleasure to read. Would that all software were as neat as Lua!
It also appears to be quite portable. I don't know if it was ever intended to be used in the MS-DOS environment, but I got it running more or less "out of the box". Borland C 3.1 compiled all the files fine. There was a warning for some files: "Undefined structure 'hash'" which I corrected by including hash.h in the pertinent files. The test program executed all but one of the sample scripts correctly. Frankly, I was amazed and delighted.
However, the script long.lua failed spectacularly crashing the DOS session I was running under Windoze. This script creates an array of 5000 descending integers by adding them one at a time, selection sorts them into ascending order and prints the 512th element. Using Bounds Checker to screen memory accesses I discovered that the fault occurred when a vector node occupying more than 64k bytes memory was created and initialised (in hashnodecreate). Of course, this was the old segmented memory problem: pointers in the large memory model wrap round at 64k. Recompiling using the huge memory model didn't work -- I think pointers have to be declared as 'huge' too.
I'd love to be able to use Lua in my DOS programs, so if anyone can think of a simple solution to this I would be extremely grateful.
Francis
[maybe followups should be set out of comp.compilers, to comp.os.msdos.programmer?] -- Send compilers articles to compil...@iecc.com, meta-mail to compilers-requ...@iecc.com.