[plt-scheme] Why do folks implement *dynamically* typed languages?
Usually I don't. I give up the guarantees of automatic static
checking so I can use the system of my choice, and rely on dynamic
checking, test cases, cautious coding practices, and my own competence
instead. Of course there are advantages to static checking, and I'm
not saying no one should use it. I'm just pointing out the trade-offs
I perceive in using a dynamically typed language.
There are more PLT Scheme features that defy traditional type systems
than one might think. For example, the class library treats classes
as runtime values; type systems usually treat classes as static
things, and don't let you pass them around. Nevertheless, the entire
"language level" system in DrScheme is based on passing classes
around. Writing a type checker for that system would be very
difficult, I predict, yet it's worked for years.
PLT Scheme users get advantages from dynamically typed programming
that they don't even know about, on a daily basis. There's a lot to
be gained from throwing off the shackles of static type systems.
(See, of course, Typed Scheme: we try to get those shackles back when
we can.)
--Carl
On 5/30/07, Michael Vanier <mvanier at cs.caltech.edu> wrote:
> That sounds great, in principle. How do you check your types statically?
>
> Mike
>
> Carl Eastlund wrote:
> > Which way are you asking? Your subject line asks one question, but
> > your content asks another. I guess you are trying to ask "why dynamic
> > languages?"
> >
> > Here's why I like dynamically typed languages: because types are far
> > too important too me. I'm not going to let some tyrannical type
> > checker decide in advance what type system I'm going to use for all
> > programs. I'm going to use whatever notion of types is appropriate
> > for my current task, and check as much of that statically as I can.
> > If ML's type checker, or Haskell's type checker, or Java's type
> > checker can't verify my invariants, or worse reject my program as an
> > error - all static type checkers are guaranteed to reject some 100%
> > correct programs as errors - I'd be out of luck in those languages.
> > I'm always in luck with Scheme.
> >
> > It puts a lot of responsibility on me to get the system right, but I
> > can live with that.