Path: utzoo!attcan!uunet!midway!ncar!asuvax!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!a.gp.cs.cmu.edu!koopman From: koopman@a.gp.cs.cmu.edu (Philip Koopman) Newsgroups: comp.lang.forth Subject: Data determines correct operation? Keywords: / NOT scariness Message-ID: <9811@pt.cs.cmu.edu> Date: 5 Jul 90 11:05:16 GMT Organization: Carnegie-Mellon University, CS/RI Lines: 34 Now that we all seem to be talking about /, NOT, and compromises again, here is a point to consider: When I was looking for a minimal kernel to port to a new stack CPU design, I got a copy of cmForth to evaluate. I liked the fact that it was small and (probably) easy to port. Then I noticed the following definition: : < - 0< ; This definition only works when the input data are closer than $8000 apart! (I speculate that Chuck did this because the Novix doesn't have an overflow flag, and a "correct" implementation of < is complex). The circumstances of finding the same bug in another Forth cost me a day or so of debugging. Consequently, I rejected out-of-hand cmForth because it had at least one case of correctness determined by input data values (and I didn't want to spend the time to try and find all the others that might be there). My current gut reaction is to reject without further examination any language, system, or implementation that does not work correctly when fed reasonable data sets (especially if not documented to do so for extremely important reasons). I find definitions of the form "works with positive numbers only" scary. How many outsiders share my fears? Remember, even if C does not specify division at a very detailed level, common practice is to use hardware-supplied division, and most (if not all) machines do it the same way. Phil Koopman koopman@greyhound.ece.cmu.edu Arpanet 2525A Wexford Run Rd. Wexford, PA 15090 Senior scientist at Harris Semiconductor, and adjunct professor at CMU. I don't speak for them, and they don't speak for me.