Re: Scheme Efficiency (was Limitations of Inform and TADS?)


19 Nov 1995 19:51:55 GMT

greg@cosc.canterbury.ac.nz (Greg Ewing) wrote:
>
>In article <meta-1411951639270001@mcgyorgy.cam.harlequin.co.uk>, meta@harlequin.co.uk (the ideal copy) writes:
>
>|> I've tried many Scheme systems. MacGambit, SCM, Scheme48, scsh... I
>|> can't find anything that'll run on my Mac at home *and* UNIX and Windows.
>
>Maybe it's time for someone to write a really small, simple
>easily-ported Scheme interpreter for this purpose?
>[...]

IMHO, the Scheme implementation you (as well as some other posters on this
thread) are talking about--or at least something rather close to it,
already exists. Have you looked at David Betz's XScheme 0.28?

Language-wise, it is reasonably complete. Reasonably means you don't get
some optional language features right out of the box, but you do get
low-level macro facitility which is enough to use syntax extender
(Kohlbecker's hygienic macros).

According to the docs, XScheme 0.28 is supposed to be portable across DOS,
Unix, Mac, Amiga, and Atari ST. Supposed--because the standard 0.28
distribution includes only DOS makefile and OS interface primitives. I
have no idea why and where the rest got lost, but it took me just about an
hour to make it run under Linux by adapting interface code from an earlier
release. Even if the OS-specific code for other platforms is lost forever,
it is much easier to recreate it (not a lot to recreate, just some
character i/o and time functions) than to write something new from scratch.

Unix statically-linked executable produced by gcc is 102K. DOS .exe
produced by Borland C++ 3.1 is 128K. Probably for today's computers
this can be considered very small.

It is fast, too--about twice as fast as MIT Scheme, though I don't know how
does it scale. It compiles into bytecodes and executes the bytecodes,
which also gives a small resulting image.

Speaking of image, that is of distribution. It supports dumping memory
image in a file and loading a saved image on startup. That is, the image
can be distributed as the game file, and xscheme itself as the
interpreter--probably even reduced version of it, since not everything
included in the complete system is needed to execute the saved image.

Again, Dave Bagget's point was not in making as small Scheme as possible.
It was about taking a reasonably small and portable Scheme and turning it
into an IF tool of a higher level than the existing ones. Higher--not in
the sense that you don't have to program, or course, but in the sense that
your game objects and NPCs can be given more depth and intellect with about
the same amount of code.

This can and probably will sacrifice performance but it is not that
important. Infocom games ran on interpreters hosted by Apple ][ and
TRS-80. Today's average computer performance and memory must be almost
three orders of magnitude higher. Wouldn't it be nice to use it to get
some more life in the games rather than to just shorten response time?

--
Vassili

P.S. Anyone interested in Unix port of XScheme or anything else mentioned