Newsgroups: comp.lang.misc
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cmcl2!sbcs!csserv1.ic.sunysb.edu!jallen
From: jallen@csserv1.ic.sunysb.edu (Joseph Allen)
Subject: Re: Lisp/C Wars
Message-ID: <1991Apr5.203141.8032@sbcs.sunysb.edu>
Sender: usenet@sbcs.sunysb.edu (Usenet poster)
Organization: State University of New York at Stony Brook
References: <1991Apr4.075558.19873@sbcs.sunysb.edu> <MARKF.91Apr4104859@montreux.ai.mit.edu>
Date: Fri, 5 Apr 91 20:31:41 GMT

In article <MARKF.91Apr4104859@montreux.ai.mit.edu> markf@zurich.ai.mit.edu writes:
>In article <1991Apr4.075558.19873@sbcs.sunysb.edu> jallen@libserv1.ic.sunysb.edu (Joseph Allen) writes:

>   LISP: Just try to write a terminal screen optimizer in it which is
>	 fast enough to be used in a real editor.

>We have done that. The Edwin editor that comes with MIT Scheme is an
>EMACS clone written, naturally enough, in Scheme (a.k.a. the uncommon
>Lisp).

!! I'm very surprised.  Scheme's optimizer must be really good.  Or does scheme
have simpler arrays (statically typed ones) than common lisp?

I suppose lisp compilers are much more global than those of other languages.
They must detect that an object will only ever be assigned one data type and
then make that object static instead of dynamic.

Oh that reminds me, when the above optimization is done, how are bignums
handled?  I can see how the compiler might detect that only integers
are involved, but how does it know that the integers will be small?  Or is
there always runtime code for checking integer sizes?

--
#define h 23 /* Height */         /* jallen@ic.sunysb.edu (129.49.12.74) */
#define w 79 /* Width */                       /* Amazing */
int i,r,b[]={-w,w,1,-1},d,a[w*h];m(p){a[p]=1;while(d=(p>2*w?!a[p-w-w]?1:0:0)|(
p<w*(h-2)?!a[p+w+w]?2:0:0)|(p%w!=w-2?!a[p+2]?4:0:0)|(p%w!=1?!a[p-2]?8:0:0)){do
i=3&(r=(r*57+1))/d;while(!(d&(1<<i)));a[p+b[i]]=1;m(p+2*b[i]);}}main(){r=time(
0L);m(w+1);for(i=0;i%w?0:printf("\n"),i!=w*h;i++)printf(a[i]?" ":"#");}
