home *** CD-ROM | disk | FTP | other *** search
- I sent the maryland people the flavors.usage file from mit so that they
- could compare their implementation with mit's. What follows is their
- analysis. Some of the differences between the two versions is due to
- different schemes for getting around the fact that franz didn't have a form
- of closure. RZ has indicated that now that franz has fclosures, it may be
- possible to use more of the 'official' lisp machine flavor code. fclosures
- will probably affect the maryland implementation too:
- Date: 22 Oct 82 15:39:18 EDT (Fri)
- From: Liz Allen <liz.umcp-cs@UDel-Relay>
- Subject: flavors
- To: jkf at Ucb-C70
- Via: UMCP-CS; 23 Oct 82 9:09-EDT
-
- Wow, implementing closure in one day is amazing. We had thought
- about writing some kind of closure... We've been discussing how
- having closures would affect our code. It might make it easier to
- read and modify, but it might be less efficient. Can you tell us
- how your implementation works and what it looks like to a user?
-
- About the MIT implementation. Ours is probably better in a couple
- of respects but probably loses a couple of places, too. Pros:
-
- 1. With ours, there is no need to discard instances when
- redefining a flavor. The only time this would be necessary
- is if the instance variables change which rarely happens
- since methods change much more often than the instance
- variables. Without a structure editor, you tend to reload the
- file containing flavors in order to change a method.
-
- 2. We can compile files with flavors (he didn't say if you
- can compile MIT's Franz flavors) and when they are compiled
- they run *fast*. Most of the overhead occurs at combine
- time and compiled flavors shouldn't have to be recombined.
-
- 3. We use hunks to store instance variables (actually, an
- instance is a hunk whose cxr 0 is the name of the flavor and
- whose cxr n (> 0) are the values of instance variables). We
- pay a price at combine time since instance variable references
- in method code are replaced with cxr and rplacx calls (but MIT
- pays the same price in putting hash calls in the methods), but
- we win over MIT since the cxr calls are much faster than the
- hash table calls. We do have to have "ghost" methods which
- are copies of methods containing different cxr calls when the
- referenced variables of a method don't align in flavors
- which inherit the method. This, however, happens only
- rarely.
-
- 4. We handle getting and setting instance variables better
- than the MIT implementation -- we don't need to send a message
- and the syntax is much better. We recently added the
- functions << and >> which get and set instance variables, eg:
-
- (<< foo 'instance-var)
- and
- (>> foo 'instance-var 'value)
-
- where foo is a flavor instance.
-
- 5. Our describe function has a hook which (if the variable
- *debugging-flavors* is set to non-nil) allows the user to
- follow pointers to any instances referenced in the describe.
- This is done by assigning to a variable (made from its unique
- id) the value of the instance.
-
- Cons:
-
- 1. They implement more things from Lisp Machine flavors
- (like wrappers/whoppers, init-keywords), but we really haven't
- found the need for them. We implement less closely to LM
- flavors, but in a way that's better suited to Franz Lisp.
-
- 2. We didn't implement the method table as a hash table, but
- there's no reason why we couldn't.
-
- 3. Things we don't have, but could easily implement include:
- describe-method, defun-method/declare-flavor-instance-variables,
- and storing flavor information in hunks instead of on the
- property lists.
-
- 4. We don't handle method types like :and and :or. We just
- have primary/untyped methods and :before and :after daemons.
-
- We have people reading our documentation. After we get some feedback
- from them, we'll send the tape and docs to you. That should be early
- next week.
-
- -Liz Allen and Randy Trigg
-
-
-
-
-
-
-
-