Re: [stack] Cat Type Inference
"William Tanksley, Jr" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
chris glur <[email protected]> wrote: > A perhaps trivial question [which also serves to test if my - via > gmail - posts get through] is: "is it obvious why one would > want to 'infer the types' ?" Maybe not. There are many languages that do very little typechecking at compile time. They include concatenative languages like Forth, Joy, and Postscript; people have worked with them for years. The problem is that many errors you can make in them are incredibly hard to narrow down and find, but very easy to make. You'd think that with just a little tiny bit of static checking you could prevent a huge, annoying class of problems from ever becoming an error. The problem then becomes that the programmer has to tell the compiler all about the types of the programs he wants to write, even though "types" are not what programming is supposed to be about. Type Inferencing makes the compiler do a bit of work to figure out what the programmer meant, assuming that the programmer wanted to write a program that behaves consistently and predictably. As a bonus, not only does the programmer NOT have to explain all the types to the compiler, the programmer also gets an error from the compiler if his program isn't going to behave consistently and predictably. > == Chris Glur. -Billy