Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!think!mintaka!bloom-beacon!ZURICH.AI.MIT.EDU!cph From: cph@ZURICH.AI.MIT.EDU (Chris Hanson) Newsgroups: comp.lang.scheme Subject: in defense of C Message-ID: <9003120358.AA01479@zurich.ai.mit.edu> Date: 12 Mar 90 03:58:40 GMT References: <542@fsu.scri.fsu.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 24 Date: 8 Mar 90 15:32:50 GMT From: Eric Pepke In article <1942@skye.ed.ac.uk> jeff@aiai.ed.ac.uk (Jeff Dalton) writes: > You say this as if it were typical of better compilers on machines > other than SPARCs, such as, maybe, 68020s. Can they really have safe > CARs and CDRs, without loss of speed, on a 68020? I don't know about the internals of any LISP system other than the ones I have written. In the one I am now writing for the 680x0, one can have safe CARs and CDRs without loss of speed. One has to test to see if it is (1) a valid list, or (2) NIL, anyway. So, one just makes that a test for (1) a valid list, or (2) anything else. In my system, that's testing a single bit. In case 1, do the job. In case 2, return NIL. Many 680x0 Scheme compilers offer a mode where no type checking is performed at all; for these compilers, in that mode, CAR is a single machine instruction. (Naturally this is dangerous, but there are ways to recover from segmentation violations and the like.) It sounds like you mean "without loss of speed" relative to something that is already slower than this. I believe that type-safe compiled code will necessarily be slower than than non-type-checking compiled code on the 680x0.