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