Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!usenet.eel.ufl.edu!spool.mu.edu!torn!nott!cunews!tina.mrco.carleton.ca!knight
From: knight@mrco.carleton.ca (Alan Knight)
Subject: Re: Real-time Smalltalk (was: Smalltalk is no good for shrink/wrap)
X-Nntp-Posting-Host: tina.mrco.carleton.ca
Message-ID: <knight.797919883@tina.mrco.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Reply-To: knight@mrco.carleton.ca (Alan Knight)
Organization: The Object People
References: <3lr0p5$fld@news.cs.tu-berlin.de> <3me3te$16a@isnews.is.s.u-tokyo.ac.jp> <D6x98B.Drq@hplb.hpl.hp.com> <denatale-1204950858070001@grail705.nando.net> <D6yvxC.JG4@hplb.hpl.hp.com>
Date: Sat, 15 Apr 1995 04:24:43 GMT
Lines: 35

In <D6yvxC.JG4@hplb.hpl.hp.com> gw@hplb.hpl.hp.com (Gunther Walther) writes:

>(1.0+2.0)==(1.0+2.0) results in false, so as soon as you do
>floating point math, you create quite a number of new objects.
>Unless you avoid floating point (and there are a number of real-time
>problems that require floating point) you are stuffed.

Quite a number is 2, but it's true that floating point arithmetic does
memory allocation. You'd have to do your own floating point wrapper if
you want allocation-free floating point math.

>Even if you just do integer math, you might create new instances
>of SmallInteger. Whether this is the case depends on whether there
>is a instance of that particular integer already around.

No, SmallInteger math never does allocations (unless it overflows into
large integer math, but in that case your C/Pascal/whatever else
program would just crash).

>And now another point (and maybe the killer). Unless you avoid
>calling methods that have their own context, you are stuffed.
>Smalltalk does not have a stack, therefore invocation of any
>message (with local variables?) can potentially call the garbage
>collector.

Smalltalk has a stack. In ParcPlace stack overflows are dealt with by
spilling contexts into the heap. Other implementations just report a
stack overflow error. In Digitalk the stack is fixed-size. In IBM and
SmalltalkAgents it can be set.

-- 
 Alan Knight                | The Object People
 knight@acm.org             | Smalltalk and OO Training and Consulting
 alan_knight@mindlink.bc.ca | 509-885 Meadowlands Dr.
 +1 613 225 8812            | Ottawa, Canada, K2C 3N2
