Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!news.alpha.net!news.mathworks.com!news.duke.edu!godot.cc.duq.edu!newsfeed.pitt.edu!uunet!in1.uu.net!sytex!smcl
From: smcl@sytex.com (Scott McLoughlin)
Subject: Re: On-the-fly code generation
Message-ID: <55aT3c1w165w@sytex.com>
Sender: bbs@sytex.com
Organization: Sytex Access Ltd.
References: <bakulD69s9w.44D@netcom.com>
Date: Fri, 31 Mar 1995 05:15:51 GMT
Lines: 50

bakul@netcom.com (Bakul Shah) writes:

> Has any Scheme implementor considered on-the-fly translation
> of Scheme virtual machine byte-code to processor specific
> code?  It seems to me this is a fairly straight-forward
> task that will provide a considerable performance
> improvement.  If someone has considered this idea and
> rejected it, I'd like to know the reasons for it.  If
> not, I'd like to plant the idea....

Howdy,

1. That's the spirit, IMHO. Lean but fairly mean implementations
via byte code/vm with an out when it matters via translation to
machine code. I think some other language implementations do just
this for various reasons, such as portability of compiled code
(ScriptX and OpenBoot come to mind, but correct me if I'm wrong).

2. People grumble about losing too much information in the source
to byte code translation, but frankly I'm not convinced. Yeah, it
might be a drag if one is writing one's thesis on how to get Scheme
or Lisp to compile to code just as good as that produced by a 
Fortran compiler, but so what?  This says nothing about the viability
of the method for producing a practical tool, many of which don't
produce anything like optized Fortran code.  VB and various databse
4GL's come to mind of inferior languages practically implemented
for various markets. Tradeoffs were made and viable products 
produced (space vs. speed, interactivity, compilation speed,
development and maintenance costs, time/$ put into the compiler
vs. put into the "feature set" doodads that the market seems to
demand these days, etc.)

3. Yes, I've thought about it.  I think the viability of the
strategy will depend somewhat on what one's bytecode instruction
set looks like. Some might be so dumbed down that there's little
point, given other deficiencies of the runtime system, etc. Damned
hard, I find, to get any good information on other folks VM
designs, not counting reams of undocumented C source files. For
our Win32 port of our LinkLisp, we'd like to do something like
this. Of all things, we've been spending alot of time thinking
about how to design the run time and calling convention given
the 80386's limited set of registers and our desire to interface
with C routines in a fairly painless way. What I'd give for a 
few more registers ;-)


=============================================
Scott McLoughlin
Conscious Computing
=============================================
