Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!sbcs!libserv1.ic.sunysb.edu!jallen From: jallen@libserv1.ic.sunysb.edu (Joseph Allen) Newsgroups: comp.lang.misc Subject: Lisp/C Wars Message-ID: <1991Apr4.075558.19873@sbcs.sunysb.edu> Date: 4 Apr 91 07:55:58 GMT Sender: usenet@sbcs.sunysb.edu (Usenet poster) Organization: State University of New York at Stony Brook Lines: 51 Originator: jallen@libserv1.ic.sunysb.edu Several points: EMACS: The easy parts are written in LISP, the hard parts are written in C. Actually I like the argument about EMACS being written in TECO. EMACS stands for Editor Macros so I guess it is written in LISP. I.E., LISP is merely a MACRO language :-) The "editor engine" part of EMACS is, however, written in C. (I happen to hate using EMACS although I think the editor engine in it is pretty amazing) LISP: Just try to write a terminal screen optimizer in it which is fast enough to be used in a real editor. C: This isn't really a high level language, it's portable assembly language. And it really does have dynamic typing and all that: /* Graph function user types in... */ top: printf("Type function in terms of variable x: "); gets(buf); sprintf(buf1,"main(argc,argv)char *argv[];{int x=atof(argv[1]);" "printf(\"%%f\n\",%s);}",buf); sprintf(buf2,"echo '%s' >tmp.c;cc tmp.c",buf1); if(system(buf2)) { printf("Try again\n"); goto top; } /* Now graph the function... */ for(x=0.0;x!=1.0;x+=.001) { sprintf(buf,"./a.out %f",x); popen() etc... } So what we really need is a "OBJ *compile(char *func)" function in the C library to compile functions in run-time and then also a "(*(dynlink(OBJ *)))()" function. Hmm... and maybe an sdb() function... -- #define h 23 /* Height */ /* jallen@ic.sunysb.edu (129.49.12.74) */ #define w 79 /* Width */ 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