home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / archives / 3776 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  6.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!think.com!yale.edu!spool.mu.edu!agate!agate!usenet
  2. From: gregor@parc.xerox.com (Gregor Kiczales)
  3. Newsgroups: comp.archives
  4. Subject: [comp.lang.scheme] A Tiny MOP, in Scheme
  5. Followup-To: comp.lang.scheme,comp.object,comp.lang.lisp,comp.lang.clos
  6. Date: 14 Dec 1992 10:19:03 GMT
  7. Organization: Xerox Palo Alto Research Center
  8. Lines: 111
  9. Sender: adam@soda
  10. Approved: adam@soda
  11. Distribution: world
  12. Message-ID: <1ghn2nINNml8@agate.berkeley.edu>
  13. References: <GREGOR.92Dec1112140@tracer-bullet.parc.xerox.com>
  14. NNTP-Posting-Host: soda.berkeley.edu
  15. X-Original-Newsgroups: comp.lang.scheme,comp.object,comp.lang.lisp,comp.lang.clos
  16. X-Original-Date: 1 Dec 92 19:21:40 GMT
  17.  
  18. Archive-name: auto/comp.lang.scheme/A-Tiny-MOP-in-Scheme
  19.  
  20.  
  21. This message will be of interest to: (i) People who are interested in
  22. metaobject protocols, particularly metaobject protocols for Lisp-based
  23. object-oriented languages; and (ii) people who are interested in Lisp-
  24. based object-oriented languages like CLOS and Dylan.  In this message,
  25. we announce the public availability of the Scheme implementation of a
  26. `kernelized' CLOS, with a metaobject protocol.  (If you are interested
  27. only in OO languages, and not metaobject protocols, you can skip the
  28. third, fourth and fifth paragraphs of this message.)
  29.  
  30. One stumbling block for people interested in playing with the metaobject
  31. protocol (MOP) ideas has been the relative complexity of working in
  32. Common Lisp.  This has been a particular obstacle for undergraduates and
  33. others who normally work in Scheme (or a very reduced Common Lisp).  To
  34. try and address this, we have designed and implemented a Scheme
  35. embedding of a core subset of CLOS, with a corresponding core MOP.
  36.  
  37. Since our primary goal is pedagogical in nature, we have been able to
  38. produce an extremely lean language, MOP and implementation.  The
  39. implementation is even simpler than the simple CLOS found in `The Art of
  40. the Metaobject Protocol,' weighing in at around 850 lines of code,
  41. including (some) comments and documentation.
  42.  
  43. By making the new language and MOP be the core of CLOS and the CLOS MOP,
  44. rather than some completely new language, our goal was to make possible
  45. for people to work with existing written materials -- primarily `The Art
  46. of the Metaobject Protocol' (AMOP) -- when playing with this system.
  47. (It should also be possible for people working with Tiny CLOS to get
  48. value from reading papers about others MOPs, such as ABLC/R, 3KRS and
  49. others.)  A side benefit of this approach is that Tiny CLOS is close to
  50. a core of Dylan, so people interested in that language may find value in
  51. playing with Tiny CLOS as well.)
  52.  
  53. The MOP in Tiny CLOS is very simple -- 8 introspective procedures and 9
  54. intercessory generics -- but it retains much of the power of both of the
  55. MOPs found in AMOP.  Even though the Tiny CLOS implementation itself
  56. isn't optimized, this MOP is amenable to optimization, using techniques
  57. like those mentioned in AMOP.  In fact, the slot access protocol used in
  58. this MOP is such that it should be possible to get better performance
  59. than is possible with the CLOS MOP.
  60.  
  61. While it isn't our primary goal, Tiny CLOS can also be used by those who
  62. are simply intereted in CLOS/Dylan style OO languages.  That is, you can
  63. play with the base language without even thinking about the MOP.  A
  64. great deal has already been said and written about how to learn, think
  65. about and teach OOP and CLOS-like languages, so we won't say any more
  66. about that.  But, it is important to point out a significant difference
  67. between Tiny CLOS and CLOS/Dylan.  In Tiny CLOS, slot names are not
  68. required to be symbols, they can be any Scheme datum (object).  (They
  69. are compared using eq?.)  This means that one can use the lexical
  70. scoping mechanisms of Scheme to achieve a greater degree of
  71. encapsulation than is possible in CLOS.  For more on this, see the
  72. second and third examples in the examples file.
  73.  
  74. Accompanying Tiny CLOS is a file of examples, that show how the base
  75. language works, and how to use the MOP to do several common extensions.
  76. Other things people might want to write are: before and after methods,
  77. slot filling initargs, beta-like languages, singleton methods etc.
  78.  
  79. To make distribution simple, Tiny CLOS is available by anonymous ftp
  80. from parcftp.xerox.com:/pub/mops.  There are five files of interest:
  81.  
  82.   
  83.  tiny-annouce.text  This message.
  84.  
  85.  support.scm        Just a bunch of useful stuff.
  86.                     (All implementation specific mods (are supposed
  87.                     to) go in here.)
  88.  tiny-clos.scm      The main program.
  89.  tiny-examples.scm  A few little examples of using this language
  90.                     and this MOP.
  91.  tiny-rpp.text      The reflective processor program for this
  92.                     MOP.  This file was generated, by hand, from
  93.                     tiny-clos.scm by removing all the code that
  94.                     deals with bootstrapping or grounding out
  95.                     the tower.  That is, this is the code/protocol
  96.                     that you should `think of' as running at the
  97.                     next level, when ignoring issues of circularity.
  98.  
  99.  
  100. MIT Scheme 11.74 is the only Scheme we have access to, so that is the
  101. only Scheme in which we have run this stuff.  But, it should run with
  102. only minor mods in other Schemes as well.  (Please send us those mods
  103. so they can be included in the sources!)
  104.  
  105.  
  106. This language, this MOP, and this implementation should not be treated
  107. as any sort of finished product.  This whole thing was cranked out
  108. relatively quickly, in response to an immediate need for simplified
  109. Scheme embeddings of this stuff.  We are very interested in any
  110. suggestions or improvements you might have or make.  So, please send
  111. them in!
  112.  
  113. (It is also worth knowing that this is the first Scheme program I have
  114. written in 10 years, so I'm willing to believe I have a lot to learn
  115. about good Scheme style.  Rather than just snickering, please let me
  116. know about stupid things this code does in that regard.)
  117.  
  118. One other note.  You will notice that these files have a copyright
  119. notice on them, as is the fashion these days.  It isn't copyleft, it is
  120. somewhat more liberal than that.  If you have any questions about it,
  121. send us mail.
  122.  
  123. Finally, please let us know if you decide to play with this stuff, and
  124. if you want to be on the mops@parc.xerox.com mailing list.  (Note,
  125. please don't use this mailing list for adminstrative stuff.  It is for
  126. technical questions and discussions.  For administrative stuff, send
  127. mail to Gregor@parc.xerox.com.)
  128.  
  129.