home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / compiler / 2148 < prev    next >
Encoding:
Text File  |  1993-01-12  |  2.0 KB  |  50 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!world!iecc!compilers-sender
  3. From: tmb@arolla.idiap.ch (Thomas M. Breuel)
  4. Subject: Re: Compile Time vs. Run Time, Mixed Language Compiling, Fat Code
  5. Reply-To: tmb@arolla.idiap.ch (Thomas M. Breuel)
  6. Organization: IDIAP
  7. Date: Tue, 12 Jan 1993 22:59:32 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <93-01-075@comp.compilers>
  10. Keywords: debug, types
  11. References: <93-01-041@comp.compilers> <93-01-065@comp.compilers>
  12. Sender: compilers-sender@iecc.cambridge.ma.us
  13. Lines: 35
  14.  
  15. nickh@CS.CMU.EDU (Nick Haines) writes:
  16. > An SML program which successfully typechecks will not
  17. > bomb [due to type errors] at runtime.
  18.  
  19. jlg@cochiti.lanl.gov (J. Giles) writes:
  20. Then your programs are considerably different from what I'm familiar with.
  21. Most errors are not syntactic or static semantic errors (like type errors).
  22.  
  23. Actually, both of you are probably right.
  24.  
  25. For example, in FORTRAN, most programming mistakes don't show up as type
  26. errors. The reason is that the FORTRAN type system isn't very expressive,
  27. relying on arrays of numbers to represent many different kinds of data
  28. structures (this kind of programming style is often carried over by its
  29. practitioners to other languages; see, for example, "Numerical Recipes in
  30. C").
  31.  
  32. The SML type system, however, lets the programmer tell the compiler a lot
  33. about his data structures and their interrelationships.  This means that
  34. if you take advantage of the added expressiveness of the SML type system,
  35. many errors that are not type errors in most other languages will be
  36. caught by the type checker.
  37.  
  38. So, extensive static typechecking alone doesn't automatically find more
  39. errors in your programs. You also need an expressive type system, and you
  40. need to use it.
  41.  
  42. Incidentally, having reimplemented a number of FORTRAN programs in SML, my
  43. impression is that even hardcore numerical programs benefit greatly from
  44. use of a more expressive type system.
  45.  
  46.                     Thomas.
  47. -- 
  48. Send compilers articles to compilers@iecc.cambridge.ma.us or
  49. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  50.