dcn (03/21/83)
The recent submission from Mark Horton forced me to enter the discussion of interpreted versus compiled languages. Both methods have their place, but some of the claims are clearly wrong or derive from personal preferences. My specific points follow the relevant passages from Horton's article. "The reason you buy a home computer is to teach your kid how to program..." This is a good reason, but not the only one. How many "real" computers are equipped with memory-mapped displays, high resolution color graphics, languages from Logo to Ada, visicalc and a hundred assorted business programs, fit on a desktop and cost under $2000? Can you play Zork on your "real" computer at midnight dressed in a bathrobe with a refrigerator full of (substitute your favorite beverage here) only a few steps away? "... while interpretive systems may be easier to learn, they teach bad habits that will have to be unlearned later." What bad habits? How about coding before the design is complete ? (prototyping) Off-the-cuff programming ? (the computer finds the errors faster than the programmer) Trying something until it works ? (interactive debugging) The interactive system has the advantage over the compiler during design, coding and testing phases while the compiler is relegated to the final step of producing a fast executable object file. "Ever try to write a REAL program (more than 1000 lines) in a language like APL or BASIC ? It gets unmanageable very quickly. This is why external compilation was invented." I believe compilers preceeded interpreters. Anyway, BASIC should not be included in this list. Most BASIC interpreters are toys or learning vehicles ONLY! Getting back to the subject, any program over a 1000 lines is beginning to get unmanageable no matter what the language. The techniques of modularity, information hiding, levels of abstraction and simplicity can be applied with an interpreted language as well, if not better, than a compiled one. "... you can't write big programs in Pascal ..." Bull! I have written a small (5000 line) compiler in Pascal in less than a semester at Purdue, and a 2000 line screen editor in Apple Pascal. There are even some self-compiling Pascal compilers around. A final comment: most interpreted languages trade speed for size. A well written LISP program is smaller than a comparable PL/I program, and much smaller than the compiled object file. Forth is an exception to the speed rule, but it's not quite interpreted either. Pascal p-code is intermediate in speed and size, but loses the advantage of interactive programming. A compiled LISP program is faster, but may still require a large amount of stack space depending on the algorithm. P. S. I'm looking forward to a lecture on Smalltalk-80 later this week. Does anyone have any experiences to share concerning Smalltalk? Dave Newkirk ihnp4!ixn5h!dcn pur-ee!ihnss!ixn5h!dcn