Newsgroups: comp.lang.clos
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!gatech!swrinde!cs.utexas.edu!uwm.edu!uwvax!uchinews!gw2.att.com!nntpa!ssbunews!iexist!not-for-mail
From: clarisse@iexist.flw.att.com (55437-olivier clarisse(haim)463)
Subject: Re: CMU-CL CLOS efficiency?
Message-ID: <D9GArv.5rF@ssbunews.ih.att.com>
Originator: clarisse@tenet
Sender: clarisse@iexist (55437-olivier clarisse(haim)463)
Nntp-Posting-Host: tenet.flw.att.com
Organization: AT&T
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: Wed, 31 May 1995 16:21:31 GMT
Lines: 83


In article <3qh5v6$1vj@ixnews3.ix.netcom.com>, martyb@ix.netcom.com (Martin Brundage) writes:
|> 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)?

Good news is: in CL you can also program in C style to get
started. The syntax makes it more verbose, like english with
parens, you end-up typing more characters initially. However you
are using about 20% of the language. As you incorporate some
of the remaining 80%, you begin to save rapidly. CL and CLOS
provide a bit of everything, functions, structures, OO,
meta level OO, code as first class object, true macros, garbage
collection...
|> 
|> How hard would it be to implement a CLOS real time application on a 
|> typical real time OS like pSOS?

You have two routes: 1) ask the main vendors (franz.com, harlequin.com,
digitool.com) what they have to offer there [Note: I bail-out here],
2) get a good C implementation of CL from the internet and do it yourself
(math.utexas.edu:/pub/gcl/ GNU CL, ftp.informatik.uni-kiel.de:/pub/kiel/
CLiCC, CLISP...)
|> 
|> 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?
|> 
I am affraid I was thinking BIG applications as well. However
CLOS gives you conceptual simplicity, evolvability at the potential expense
of size [that you can control by going down to C constructs
for hungry algorithms].

|> What are the advantages of CL or CLOS over alternatives like Scheme, 
|> Dylan, Eiffel, Forth, Smalltalk, etc.
|> 
Can't compare all these in a few lines... Only basics:
CLOS is bigger than Scheme, but gives you access to
type declarations and ways to optimize your code down deep.
I view CLOS as industrial strength Scheme with access to C like
constructs when you know you need them [you can also link in
existing C as foreign functions]. I view Dylan as many "concepts"
from CL and CLOS served in a less original syntax and hopefully
with a better integration with C and C++ (we're waiting). I view Eiffel,
and Forth as less abstract OO languages albeit smaller (Forth even smaller).
I view Smalltalk as CLOS in single inheritance mode with objects down to
bottom layer and great class libraries (I prefer source code object
libraries - tells me the language designers had nothing to hide!).

|> Any pointers regarding texts or magazine articles describing real time 
|> systems using CLOS?
|> 
The vendors have their pet articles, contact them (see 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?
|> 
There's no magic if you write flat large FSM for pure speed they
will look and perform identically in C or CL. However if you think
more in terms of self organizing FSMs... The inside of each FSM
will look the same in C or CL, perform the same, but the complex
organization of FSM objects might turn into a real good time using
something like CLOS.

|> Thanks for any pointers,
|> 
CL and CLOS are pointers free languages, you use
foreign functions to get to these... [Sorry, I couldn't resist].
-- 
----------------
Olivier Clarisse
Member of Technicall Staff
AT&T Bell Laboratories
