home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 549b.lha / Kamin / README < prev    next >
Text File  |  1991-09-08  |  4KB  |  101 lines

  1. C versions of the language interpreters from "Programming Languages,
  2. An Interpreter-based Approach," by Sam Kamin
  3. ====================================================================
  4.  
  5. This directory contains C versions of the interpreters, produced
  6. by the p2c translator from Cal Tech.  These versions were created, and
  7. the makefile written, by Dirk Grunwald of Univ. of Colorado at
  8. Boulder (thanks, Dirk!).  To compile and test the interpreters,
  9. just say "make" in this directory.
  10.  
  11. The C versions of the interpreters were produced automatically
  12. from the Pascal versions in the distr directory, using p2c, a Pascal-to-C
  13. translator written by Dave Gillespie of Cal Tech.  (p2c can be
  14. obtained by anonymous ftp from csvax.caltech.edu.)  The test
  15. cases included here are identical to those in the distr directory,
  16. and produce identical results.
  17.  
  18. Though p2c does a remarkably good job, these interpreters are not
  19. hand-written, and are somewhat obscure in spots.  So they are
  20. probably not appropriate for the "interpreter modification"
  21. exercises.  For programming in the interpreted languages, on the
  22. other hand, they are perfectly good.
  23.  
  24. The files in this directory are essentially the same as those in
  25. the distr directory.  The interpreters have names xxx.c instead
  26. of xxx.p, the file TEST.INTERPS is omitted (the Makefile takes its
  27. place), and the README file is different.  Also, this directory
  28. includes a subdirectory p2c containing files needed to compile the
  29. C interpreters.  The biggest difference is the omission of the
  30. files related to memory management (lisp.stack.p, lisp.ms-gc.p,
  31. lisp.ss-gc.p, and lisp.refcnt.p, and their associated test files);
  32. since these exist only for expository purposes (the language they
  33. interpret is the same as that interpreted by lisp.c), and the C
  34. versions of the code are not really readable (and are not explained
  35. in the book), there seems no point in including them here.
  36.  
  37. Here is an explanation of the files containing the interpreters and
  38. test cases:
  39.  
  40. 1. Interpreters (C source files):
  41.  
  42.      chap1.c - Chapter 1
  43.      lisp.c - Lisp
  44.      apl.c - APL
  45.      scheme.c - Scheme
  46.      sasl.c - SASL
  47.      clu.c - CLU
  48.      smalltalk.c - Smalltalk
  49.      prolog.c - Prolog
  50.  
  51.    "make" will compile these files, leaving binaries called chap1,
  52.    lisp, etc.
  53.  
  54. 2. Code files, including all code from chapters (plus some test cases
  55.    not appearing in text).  Note that you may be unable to run these
  56.    files as is due to memory limitations.  In that case, just split them
  57.    up and run the pieces separately.  (The Prolog code is given in two
  58.    pieces to avoid the problem of redefining predicates.)
  59.  
  60.      code.ch1 - Chapter 1
  61.      code.lsp - Lisp
  62.      code.apl - APL
  63.      code.sch - Scheme
  64.      code.ssl - SASL
  65.      code.clu - CLU
  66.      code.smt - Smalltalk
  67.      code1.pro - Prolog, part 1
  68.      code2.pro - Prolog, part 2
  69.         
  70. 3. Output of code files.  Use these to check that the interpreters
  71.    are running correctly.
  72.  
  73.      code.ch1.out - output from running chap1.p on code.ch1
  74.      code.lsp.out - output from running lisp.p on code.lsp
  75.      code.apl.out - output from running apl.p on code.apl
  76.      code.sch.out - output from running scheme.p on code.sch
  77.      code.ssl.out - output from running sasl.p on code.ssl
  78.      code.clu.out - output from running clu.p on code.clu
  79.      code.smt.out - output from running smalltalk.p on code.smt
  80.      code1.pro.out - output from running prolog.p on code1.pro
  81.      code2.pro.out - output from running prolog.p on code2.pro
  82.  
  83.    "make" will use these files to test whether the interpreters are
  84.    running correctly.  Aside from that, they have no particular use,
  85.    as the book says what the correct value is for each expression.
  86.  
  87. PROBLEMS
  88.  
  89. The most likely source of problems when testing the interpreters is running
  90. out of memory.  To alleviate the problem, I have made the following
  91. adjustments:
  92.  
  93.     code.lsp: The "quit" has been inserted before
  94.                 line 414: "(r-e-p-loop '(", the first line of
  95.         an 86-line expression whose evaluation uses enormous
  96.         amounts of memory.
  97.  
  98.     code.sch: Line 305: "(differentiate '(Dx (+ x c)))" has
  99.                 been commented out.
  100.  
  101.