> This is not an entirely bizarre proposal. It would probably be
> fairly easy to do -- at least for a generic interpreter. (Your
> Z-to-C translator would output a bunch of C files. You would then
> throw away all the emulator source code from ZIP and plop down those
> in their place; they would use the existing interface source code in
> ZIP. Compile and run.) People who wanted to run translated games on
> fancy ewmulators would be in trouble.
You could simply translate some of the more interesting operations
into function calls, and supply a library of "standard"
implementations which did straightforward things, allowing particular
ports to add their own.
I don't much like this idea for my own preferred platform (the Psion
Series 3a) for a number of reasons:
1. Although speed is a bit of an issue, for the Infocom games it's OK:
sometimes a second or two between prompts. For some Inform games it
can be a number of seconds, but I'm willing to put up with that.
2. Most people who have a Series 3a don't have a C compiler for it;
gcc won't work. There's a shareware C-subset compiler (which actually
runs on the Series 3a) but I suspect it's not up to this.
3. The main reason is space. I suspect the C code produced is just
going to be too big. Executables are pretty much limited to 64K (the
best of the interpreters, Bryan Scattergood's, is about 30K); there
are ways of going over this, but it gets complicated. How big is an
executable formed from Curses (256K) going to be? I can store 15 or
so of the Infocom games on my 2M Flash SSD, together with an
interpreter; I'll pay time/space trade-offs only to an extent!
> By the way, I object to your emphasis of "compiler". Inform is a
> compiler; it outputs object code, even if nobody's ever built the
> hardware to run it. Your idea outputs source code. (If anyone wants
> to argue that it's possible to build a chip that runs C source
> natively, I will have a good laugh.)
It *is* a compiler; it's merely using C as an intermediate
representation! A number of compilers for various languages do this.
For that matter, if you regard assembly language as a source language,
so do many C compilers, including gcc.
-- Bruce Institute of Advanced Scientific Computation bruce@liv.ac.uk University of Liverpool http://supr.scm.liv.ac.uk/~bruce/