Newsgroups: comp.lang.clos
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!news.moneng.mei.com!uwm.edu!fnnews.fnal.gov!gw1.att.com!nntpa!ssbunews!ssbunews.ih.att.com!lgm
From: lgm@polaris.ih.att.com (Lawrence G. Mayka)
Subject: Re: CMU-CL CLOS efficiency?
In-Reply-To: martyb@ix.netcom.com's message of 31 May 1995 07:30:46 GMT
Message-ID: <LGM.95Jun8083842@polaris.ih.att.com>
Sender: news@ssbunews.ih.att.com (Netnews Administration)
Nntp-Posting-Host: polaris.ih.att.com
Organization: AT&T Bell Laboratories, Naperville, Illinois, USA
References: <mmcconn.801347647@klein.math.okstate.edu> <D9EC6p.9Cy@ssbunews.ih.att.com>
	<D9EFxy.B2L@ssbunews.ih.att.com> <3qh5v6$1vj@ixnews3.ix.netcom.com>
Date: Thu, 8 Jun 1995 13:38:42 GMT
Lines: 96

In article <3qh5v6$1vj@ixnews3.ix.netcom.com> martyb@ix.netcom.com (Martin Brundage) writes:

   In <D9EFxy.B2L@ssbunews.ih.att.com> clarisse@iexist.flw.att.com 
   (55437-olivier clarisse(haim)463) writes: 

   [much omitted...]

   >We have also gained experience using CLOS in real-time applications.

   I am new to the lisp-type languages. I work in a small shop that 
   designs small embedded communications systems, and I have been 
   wondering about the applicability of lisp and similar languages for 
   embedded, real-time applications, with some mathematical algorithms 
   thrown in (developed first through Matlab, then ported to C or 
   assembler). Writing this type of code is extremely time consuming in C 
   or assembler, and often we find ourselves rewriting the same functions 
   for different applcations.

   I am wondering about the following issues:

   What is the learning curve switching from C to CL (or CLOS)?

I've seen people come up to a reasonable level of project productivity
within a month.  Three months is probably more typical.  Of course, a
fair portion of that is training in project-specific libraries,
practices, etc.

   How hard would it be to implement a CLOS real time application on a 
   typical real time OS like pSOS?

See Harlequin's press release of August 1994, on the Web at
"http://www.harlequin.com/full/press/940818-att.html".

   Industrial programmers (at least ones like me) tend to associate 
   object oriented programming with C++, hence BIG applications. How much 
   does CLOS (as opposed to CL) buy for the added expense and complexity, 
   for real time applications?

CLOS =particularly shines= for large, complex, evolving applications.
Almost by definition, a large application has to spend most of its
time in a small proportion (e.g., 10%) of its code, typically found by
profiling.  Optimizing that portion may require the detail work more
characteristic of statically typed languages; but the rest (e.g., 90%)
of the application can continue to make full use of dynamicity.

Also, CLOS' extensive libraries constitute a fairly small proportion
of a large application's total size, whereas those same libraries may
bloat a "Hello world" example (unless CLOS is already loaded for the
sake of some other application).

   What are the advantages of CL or CLOS over alternatives like Scheme, 
   Dylan, Eiffel, Forth, Smalltalk, etc.

People have made their living comparing programming languages.  I can
only suggest some criteria:

- Object-oriented programming

- Highly usable multiple inheritance, with automatic and user-defined
method combination

- Multimethods (specialization of behavior based on the dynamic type
of more than one argument)

- Metaprogramming capability

- Ubiquitous dynamic typing

- Optional static typing (for truly performance-critical code legs)

- Integrated syntax extension

- Industrial-strength implementations with commercial support

- ANSI standardization

   Any pointers regarding texts or magazine articles describing real time 
   systems using CLOS?

See the Harlequin Web page mentioned above.

   One thing I've found devilishly hard to do in C: implementing a 
   complex state-machine. Is there any easy way to do this in CL or CLOS?

One suggestion is to use multimethods that specialize on both the
receiving object and its state.  For maximum flexibility and
expressiveness, each state should actually be a (solitary) instance of
its own class.  The states of the FSM can then form an inheritance
lattice.  So, for example, the Active and Standby states may each
inherit from the In-Service superstate.
--
        Lawrence G. Mayka
        AT&T Bell Laboratories
        lgm@ieain.att.com

Standard disclaimer.
