Path: utzoo!mnetor!uunet!mcvax!ukc!warwick!cvaxa!aarons From: aarons@cvaxa.sussex.ac.uk (Aaron Sloman) Newsgroups: comp.lang.lisp Subject: Re: GC and time critical code? (use of numbers) Message-ID: <452@cvaxa.sussex.ac.uk> Date: 16 Apr 88 16:58:42 GMT Organization: School of Cognitive Sciences, Univ of Sussex, Brighton, UK Lines: 50 Keywords: GC, time-critical, number representation, Poplog In response to article <22550@bbn.COM> mesard@bbn.com Jeff Dalton (jeff@aiva.ed.ac.uk) writes: >From: jeff@aiva.ed.ac.uk (Jeff Dalton) >Message-ID: <305@aiva.ed.ac.uk> >Organization: Dept. of AI, Univ. of Edinburgh, UK >Unfortunately, your program will be using numbers to represent >reaction times, and creating a number tends to allocate storage in >most Lisps even though you haven't done an explicit MAKE-NUMBER. ----------------- Just for the record. In POPLOG Common Lisp (and also in the other Poplog languages, namely POP-11, Prolog and ML) storage is NOT allocated for integers or single-precision floating point numbers that can fit into 30 bits of store. POPLOG divides data objects into two types: simple and compound. Compound items are represented by pointers to structures in the heap, whereas simple items (integers and single-precision decimals) are represented by themselves. Unlike some Lisp systems Poplog uses only two bits of a 32 bit machine word to indicate what sort of object it is, i.e. pointer, integer, or decimal. Hence 30 bits are available for integers and decimals and arithmetic operations using them generate no garbage collections. If very large integers (bignums), high precision floating point numbers, ratios, or complex numbers are used, then store is allocated, and some time will normally have to be spent on garbage collection. To be fair, Jeff did write >Some types/sizes of numbers may be represented directly (as part of a >pointer) rather than by an allocated object. If these are suitable >for reaction times, you win. but he made it sound as if most Lisp systems would not be able to cope. I presume that if Poplog can cope with quite a wide range of integers and floats, other lisp systems on 32 bit machines can too? After all reaction times are not going to be measured to a very high precision. Aaron Sloman, School of Cognitive Sciences, Univ of Sussex, Brighton, BN1 9QN, England ARPANET : aarons%uk.ac.sussex.cvaxa@nss.cs.ucl.ac.uk JANET aarons@cvaxa.sussex.ac.uk BITNET: aarons%uk.ac.sussex.cvaxa@uk.ac As a last resort (it costs us more...) UUCP: ...mcvax!ukc!cvaxa!aarons or aarons@cvaxa.uucp