[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIT C Scheme design info



The following is a list of most C files used in the MIT C Scheme 
interpreter, along with a brief statement of function.  Most of the
information is gleaned from the short comment at the beginning of each
file.  This list gives a flavor of how the interpreter is organized,
and should help new readers of the code to find their way around.

Note that much (half?) of C Scheme is written in Scheme, and is not
listed here.  The microcode interpreter files below actually 
interpret many runtime functions which are written in Scheme (such
as the main read-eval-print loop).  The Scheme runtime files + the
host interpreter below offer a complete system to the user.

Of course some of the information below may be wrong, though to
the best of my knowledge it is correct.  Any mistakes are my own.

- Kevin Jameson, 28 March 88 
  ..!{ihnp4,ubc-vision}!alberta!calgary!jameson


FILE           Brief Function
=============  ==================================================
scheme.h       defs for the interpreter in interpre.c
config.h       configuration file describes stk size,heap size, etc
const.h        global named constants
fixobj.h       format (offsets) of fixed object vector
extern.h       extern machine and many other interface dcls
scode.h        describes byte code format
sdata.h        describes user data object formats
types.h        list of object type codes TC_xxx
returns.h      list of return codes used by interpreter RC_xxxx
errors.h       list of error codes
prims.h        list of ids and names (PC_xxx) for all system primitives
object.h       defs & access macros for scheme objects
primitive.h    macros for defining and handling primitives
boot.c         main boot program for scheme interpreter
interpre.h     macros for interpreter
zones.h        time zones for performance metering
hooks.c        hooks into the interp - apply,catch,throw, etc
storage.c      prim, arg count tbls, global storage allocs
interpre.c     byte code interp coded in continuation passing style
utils.c        utils used by interpreter (backout_of_primitive,etc)
lookup.c       symbol lookup and manipulation
usrdef.c       table of external primitives produced by findprim
extern.c       external primitives defined by user
findprim.c     builds table of external prims from users files
nihil.c        defines unimplemented primitives reqd by scheme
default.h      unimplemented default hooks not def'd by user in config.h
cross.doc      some doc on the cross syntaxer (byte code compiler)
readme.unx     tells where things are in unix version

MATH CODE

generic.c      mostly generic math funs for various numeric types
missing.c      math utils which wouldn't fit anywhere else
mul.c          portable fixnum multiplication
flonum.c       floating pt funs, mostly superceded by generic.c
flonum.h       defs for flonum.c
fixnum.c       fixnum (24 bit) funs, mostly superceded by generic.c
bignum.c       bignum arithmetic functions
bignum.h       bignum arithmetic declarations
bitops.c       extended bitops for infinite precision arithmetic
bitstr.c       bitstring functions

DEBUGGING CODE

step.c         support for the debugger stepper
xdebug.c       useful prims for scheme memory prim debugging
bkpt.c         debugger breakpoint functions
bkpt.h         debugger breakpoint definitions, macros
debug.c        printing and listing functions used by debugger

GARBAGE COLLECTOR

purify.c       much like gc, only purifies (whatever that is) instead
daemon.c       two gc daemons (obj hash tbl & file closer)
gc.h           macros for all gc code (and maybe others)
gccode.h       macros for code which does gc-like loops
gcloop.c       low level gc stuff
gctype.c       maps type codes into gc object type codes

PRIMITIVE FUNCTIONS

fetchpar.c     makes implementation parms available to scheme
file.c         file i/o primitive scheme functions
hunk.c         funs to handle triplet hunk3's for file blocks
io.c           scheme io primitives, channel grabbing, etc
list.c         list manipulation functions (memq, cons, car, etc)
prim.c         primitives which won't fit elsewhere
string.c       string primitives, cv strings to/from lists
vector.c       vector handling and conversion (to lists) code

FASTLOADER (FASL) FUNCTIONS

translate.h    macros for psbtobin, bintopsb (psb=portable scheme binary)
schloader.c    standalone prog to load a dumped scheme core?
load.c         common code for reading fasl files
bintopsb.c     converts fasl files to portable ascii
breakup.c      used for fasl conversion?
ppband.c       pretty prints fasl files in human format
psbtobin.c     converts portable ascii files to fasl format
dump.c         common code for dumping fasl files
dumpworld.c    core save routine, calls gnu unexec
fasdump.c      holds fasdump, fasload, and bandload functions
fasl.h         defs for fasl file format
fasload.c      reads fasl files, relocates and interns symbols

SCHEME CODE (not related to the Scheme runtime stuff)

chapter1.code  from Structure and Interpretation of Computer Programs
chapter2.code  from SICP (Abelson & Sussman)
chapter3.code  from SICP
chapter4.code  from SICP
chapter5.code  from SICP

MISCELLANEOUS

ChangeLog      only two entries
install        main installation notes
Install.unx    unix installation notes
Install.vms    vms  installation notes
Makefile       main makefile
Makefile.200   for the 200 series of some machine
Makefile.500   for the 500 series of some machine
Makefile.ind   for some other operating system
Makefile.unk   for an unknown operating system
Makefile.vax   for vax
Readme.vms     tells where things are in vms version
TO_DO          a wish list
UPGRADE        diffs between CScheme release 3 and 4
Wsize.c        tests out compiler/machine for bit & math ops
athena.c       athena graphics primitives for special terminals
bobcat.c       bobcat graphics interface for starbase package
config.dst     same as config.h
locks.h        for locking heap, etc
os.c           selects appropriate operating system file for build
process.c      utils to fork inferior processes in unix
regblock.c     defines registers used by compiler
unexec.c       from gnu-emacs. dumps core on unix systems
unix.c         unix specific prims (completed version of unknown.c)
unknown.c      os specific blank prim stubs for unknown op system
valret.c       emulates ITS valret on a unix system
vms.c          vms specific prims (completed version of unknown.c)
vmsall.com     vms batch file for compilation
               <several other vms batch files have been omitted>

SPECIAL CODE (to handle Scheme language features)

future.c       support code for futures
futures.h      macros for futures code
history.h      defines history data structures
intercom.c     single process simulation of futures stuff