Path: utzoo!mnetor!uunet!mcvax!ukc!its63b!aiva!richard From: richard@aiva.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.lisp Subject: Re: GC and time critical code? (use of numbers) Message-ID: <354@aiva.ed.ac.uk> Date: 19 Apr 88 13:51:18 GMT References: <452@cvaxa.sussex.ac.uk> Reply-To: richard@uk.ac.ed.aiva (Richard Tobin) Organization: Bannerman's Bar, Cowgate, Edinburgh Lines: 31 Keywords: GC, time-critical, number representation, Poplog In article <452@cvaxa.sussex.ac.uk> aarons@cvaxa.sussex.ac.uk (Aaron Sloman) writes: >Jeff Dalton (jeff@aiva.ed.ac.uk) writes: >>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. It is recommended (CLtL page 19) that the type short-float provide such non-heap floats, so programs concerned to avoid garbage collection should use this type for floats where possible. POPLOG appears to provide two floating point formats: single (which also serves as short) and double (which also serves as long). Since the precision of singles is only 22 bits, which is less than that recommended (24 bits - see page 17), perhaps it would be more appropriate to adopt the alternative divison, and have the types short and single, with single serving as double and long. On the other hand, "more appropriate" (the term used in CLtL) isn't very precise, so I don't think one could say POPLOG is wrong here. -- Richard -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin