Re: More static type fun.
From: Mark Carroll (markc_at_chiark.greenend.org.uk)
Date: 11/18/03
- Next message: Ray Blaak: "Re: Why I don't believe in static typing"
- Previous message: Matthias Blume: "Re: More static type fun."
- In reply to: Joe Marshall: "Re: More static type fun."
- Next in thread: Joe Marshall: "Re: More static type fun."
- Reply: Joe Marshall: "Re: More static type fun."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Nov 2003 20:30:36 +0000 (GMT)
In article <znettu52.fsf@ccs.neu.edu>, Joe Marshall <jrm@ccs.neu.edu> wrote:
>Andreas Rossberg <rossberg@ps.uni-sb.de> writes:
(snip)
>> No, that's the whole point. Everything in the program remains statically
>> typesafe. The only operation that can fail is the typecase, if it is
>> allowed to be non-exhaustive (which, of course, is statically detectable).
>
>Um, yeah. A non-exhaustive typecase *could* throw an error at
>runtime. Exactly how is this `static'? Exactly how is this
>`typesafe'? Exactly how does this differ from Lisp throwing a runtime
>error?
Well, it's at least statically detectable: it differs from Lisp
throwing a runtime error because the compiler can guarantee to warn
you of the eventuality, and you don't have to happen to hit exactly
that case in your unit tests or whatever to get that warning. Of
course, you can still wrongly convince yourself that that omitted case
may never be exercised, but at least you had your attention drawn to
the issue.
Still, that's only one class of error. There's all manner of runtime
errors that can crop up in a Haskell program, of course, that you may
not have been warned by the compiler about. "f = head []" will compile
yet throw a runtime exception, for example. Static typing only goes so
far.
-- Mark
- Next message: Ray Blaak: "Re: Why I don't believe in static typing"
- Previous message: Matthias Blume: "Re: More static type fun."
- In reply to: Joe Marshall: "Re: More static type fun."
- Next in thread: Joe Marshall: "Re: More static type fun."
- Reply: Joe Marshall: "Re: More static type fun."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|