2002.04.27 ~04 Mod development using Scheme, prospect not good My goal was Scheme in QVM mode. Unfortunately, the layers of interpretations causes Scheme to be extremely slow, even in the JIT(?)-compiled. I wrote a set of accessor routines in Scheme to modify the values of various C structs involved with gameplay. On my K7/1200 (hardware which I consider to be excessivly powerful for just a mere dedicatd Q3 server), in compiled QVM mode (vm_game 2), just *loading* this file takes 30 seconds. In interpreted QVM mode (vm_game 1), this explodes to 180. In native SO (vm_game 0), it's a relatively speedy but still slow 3 seconds ('Hitch Warning' is 0.5s). And this is just loading this particular set of procedures, not even getting to the other support functions and then actually *running* any Scheme code. Trying an entire mod in just extension form is out of the question. I feel the optimal tool would be a Lisp compiler targeted to QVM bytecode, but I doubt that exists, and doubt it'll exist until Q3A goes GPL, and even then, I doubt any Lisp maintainers would really want to bother targetting QVM. Another alternative is a Lisp->C compiler (like CLiCC), which then uses the existing toolchain to compile the generated C file to QVM. This approach may be a better one than tacking Scheme onto the mod as an extensible language. At least the speed-critical/impaired functions (like, say, struct accessors) can be made speedier. I'll need to look into this approach. Still, QuakeScheme in its current form is still useful for "build-up" stuff, implementing new features -- prototyping. The set of routines established so far is useful in poking and prodding the structs, to see values were inserted properly, or to see what values were inserted, or to force the proper values. Although the Scheme code is slow, prototyping in Scheme precludes the need for a C compiling. And despite a complete recompile taking less than six seconds, not having to quit/restart Q3A means I don't have to rebuild session states (players, bots, entities, etc.) for testing/debugging. Once the Scheme form is stabilized, the routines can then be rewritten in plain C for speed. CLiCC may help make that last part automatic, though... hrm.