Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!rutgers!bellcore!tness7!tness1!sugar!ficc!karl From: karl@ficc.uu.net (karl lehenbauer#) Newsgroups: comp.lang.forth Subject: type checking Message-ID: <1389@ficc.uu.net> Date: 1 Sep 88 16:26:40 GMT References: <8808121826.AA23206@jade.berkeley.edu> <1575@crete.cs.glasgow.ac.uk> <535@hudson.acc.virginia.edu> Organization: Ferranti International Controls Lines: 33 In article <535@hudson.acc.virginia.edu>, pmy@vivaldi.acc.virginia.edu (Pete Yadlowsky) writes: > Baggage, baggage and more baggage. Type checking?! *gag* I don't want > some uppity compiler protecting me from myself and telling me how I > may and may not use my computer. That stuff's fine for beginners, but > when it's time to cut loose and actually put the machine to work... Oh, please! I once spent days finding a bug in a Forth program where a guy had done a store (rather than a c-store) into a CVARIABLE, clobbering an adjacent data byte (1802 polyForth with separate symbol table) Most of my C bugs seem to be type conflicts in function calls, incorrect number of arguments and such, which ANSI X3J11 addresses at last. I expect that the ANSI C compiler is going to catch 90% of my bugs. Don't get me wrong, I like Forth a lot, but in Forth when one gets the number of arguments wrong, like in a loop, one typically blows the stack and crashes the machine. Eliminating type checking from the language leaves it to the programmer, in FORTH a word for every operation for every data type, and Forth (and FORTRAN where one has to kludge pointers as array indexes and such to get around not having data types) will merrily compile bogus code that a type-checking compiler would gritch at, leaving it to the programmer to debug. Again, I am not constrained by type checking; type checking catches bugs; type checking finds and notifies the programmer of *impossible* usages of data. Although it is "telling me how I may and may not use my computer," it is never appropriate to do word writes into byte fields, use floating point numbers as pointers, pass ints to routines that want pointers to floats &c &c &c (I just have to keep harping. Consider the DO..LOOP, IF..THEN, BEGIN..REPEAT security in Forth that insure control structures are properly nested. Hey, that's the machine telling me what to do!? If I want to write a routine with a LOOP that doesn't have a DO, that's my business. :-) -- -- +1 713 274 5184, uunet!ficc!karl -- Ferranti International Controls, 12808 W. Airport Blvd., Sugar Land, TX 77478