Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ETSUACAD.BITNET!S47852EF From: S47852EF@ETSUACAD.BITNET ("Frank C. Earl") Newsgroups: comp.lang.forth Subject: Re: What's WRONG with Forth? Message-ID: <9104181341.AA06237@ucbvax.Berkeley.EDU> Date: 17 Apr 91 20:19:50 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "Frank C. Earl" Organization: The Internet Lines: 52 > This is a danger I had not previously considered, but, obviously, the risk >is so great that I dare not continue to use Forth. I am immediately >switching to Ada and suggest you do the same before it is too late. The danger is not as obvious as you mentioned- you would write in code that protects against such abuses- in the case of a spreadsheet being played over one's stereo is an extreme and VERY remote case- if you feed any computer invalid data it's gonna barf out; and ADA does help some but isn't the silver bullet that the DoD and the proponents of the language have made it out to be! (Take it from this ADA programmer- ADA's overrated and is hideously expensive! The cheapest *validated* compiler is in excess of $1000!! It can catch type violations during development but to have type violations caught during run-time pesents the dual problem of the overhead of making those explicit type checks and what you do in the case of a type violation that you hadn't planned for (Yes, this is *VERY* possible)... Usually, ADA code runs slower than comparable C, Pascal, or Modula-2 code; and in the case of the invalid data type exception that wasn't covered, you end up with the computer usually exits out to whatever OS you have and goes on from there- which as often as not is as bad has having the data error in the first place...) And in the case of that example you gave Frank- the author was not mentioning that ALL programming languages treat data off the diskette in the same manner and that any data that makes sense to the language run-time will be interpreted as that and if you have a data file that looks like it's okay to ADA and isn't the correctly typed data, then ADA *WILL NOT* protect you any better than C, Forth, BASIC, FORTRAN, Modula-2, Pascal, or any other language you care to mention to us. The example neglects to mention that the data type was binary sound info- as plain and simple as that; if the spreadsheet looks like valid sound data format information, then it's going to play it just the same as if it came from a DAT or a CD... The way information is dealt with is NOT typed- we simply impose an IDEA of types on the binary values in the machine in the Language that we use to tell the computer what we want done... Computers, in general, don't know Adam from data types- they don't care; they do EXACTLY what we tell them to do. ADA only keeps the commpon type violations from occuring for inexperienced programmers- it doesn't keep the problem of invalid data being fed to the machine that looks okay to the program- you have to code for that (Quite extensively in many cases...) in *ANY* language. Frank, do yourself and the entire Forth community a favor, please don't panic and switch over to to ADA just because it is VERY strongly typed- in reality, it doesn't help much except when you go looking for some subtle and most gross programming errors (As the DoD is now finding out- they are now letting C be done in MANY cases... They aren't shouting "you must do *EVERYTHING* in ADA if you do stuff for US!" anymore... It *WASN'T* what they thought it was...) (Getting off of soapbox... :) Frank C. Earl, Master's of Computer Science program, East Texas State Univ. Internet : s47852ef@etsuacad.etsu.edu BITNET : s47852ef@etsuacad US Mail : 409 Laurel Greenville, TX 75401