Newsgroups: comp.lang.beta,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!news.umbc.edu!haven.umd.edu!ames!kronos.arc.nasa.gov!usenet
From: bobo@avogadro.arc.nasa.gov (Mark Friedman)
Subject: Re: Comparison: Beta - Lisp
In-Reply-To: carroll@hercules.cis.udel.edu's message of 8 Sep 1994 21:02:55 GMT
Message-ID: <BOBO.94Sep8172734@avogadro.arc.nasa.gov>
Lines: 69
Sender: usenet@ptolemy-ethernet.arc.nasa.gov (usenet@ptolemy.arc.nasa.gov)
Nntp-Posting-Host: avogadro.arc.nasa.gov
Reply-To: bobo@ptolemy.arc.nasa.gov
Organization: NASA/Ames Information Sciences
References: <34n2qe$d74@nz12.rz.uni-karlsruhe.de> <RV.94Sep8102514@tahoe.cs.brown.edu>
	<34nu5v$oou@louie.udel.edu>
Date: Fri, 9 Sep 1994 00:27:34 GMT
Xref: glinda.oz.cs.cmu.edu comp.lang.beta:11 comp.lang.lisp:14541

In article <34nu5v$oou@louie.udel.edu> carroll@hercules.cis.udel.edu
(Mark C. Chu-Carroll) writes:

   You're basically pretty much correct. A pattern is essentially the
   same thing as a closure, the primary difference being that a pattern
   is static. Essentially, a pattern is a uniform code construct which
   will be instantiated into a closure at runtime. 

OK, so let's equate a pattern with a lambda expression which is
instantiated into a closure at runtime.

   To make a jump backwards to the initial comparison idea, the key
   conceptual difference between Beta and Lisp is that Beta is very
   static: patterns are static entities which are compiled into
   programs.

And lambda expressions are static entities which are compiled into
functions.

   The important differences come about because of three things:

   <1> Static typing - in Beta, the types of variables are always declared
       statically. Programs in Beta is very static, which makes it very
       different from the dynamic nature of lisp programming.

Agreed, although it wouldn't take much of a stretch to imagine a lisp
which required type declarations. Admittedly, most lisp users would
hate that.

   <2> Single inheritance- the Beta object model uses only single inheritance.
      The designers decided that rather than try to work out a system for
      resolving the confusion caused by MI (namespace collisions, repeated
      inheritance, etc.), it was better to do without it. I don't necessarily
      agree with them, but it did result in keeping Beta simple.

But it looked to me like the object system that Beta uses is one based
on closures. That sort of object system has been used in lisp and has
the same sort of single inheritance. For the same matter, I assume
that one could build a CLOS type multiple inheritance object system
in Beta which did not use closures in such a direct way.

   <3> Virtual patterns - the object model is rather different. Instead of
      the CLOS model where a child method overrides a parent method, Beta
      uses the Simula model, where the child extends the parent method. The
      parent implementation of a method contains calls to inner, which are
      dynamically bound to the correct extension for the actual child type.

See my last comment.

      Going further, since everything (functions, procedures, methods, values)
      is just a pattern, the virtual pattern idea can be applied to *any*
      method at all. This results in a *very* interesting program model,
      where you can write any procedure to be dynamically extensible. This can
      actually be used to write lambda expressions! It's quite elegant...

Could you give an example here which doesn't look like a closure. I
guess I'm looking for something which would not have a straightforward
translation into lisp. If there's something new here I'd really like
to know.

-Mark
-- 
Mark Friedman
NASA-Ames Research Center
MS 269-2
Moffett Field, CA 94035-1000

vmail: (415) 604-0573
email: bobo@ptolemy.arc.nasa.gov
