[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strong Typing, Dynamic Languages, What to do?

[Also off-topic...]

On Mar 20, Michael Vanier wrote:
> My observations are that different programmers react differently to
> this situation.  The strongest proponents of so-called dynamic
> languages typically claim that
> a) they don't make many type errors anyway
> b) type systems are not powerful enough to do anything really
>    interesting
> The strongest proponents of static languages say the opposite.

In my experience, using dynamic typing means more responsibility on
the programmer since the language allows doing more.  This can be
considered as a point in favor of static typing, but people who are
comfortable in the dynamic world tend to feel like they constantly
have to fight against the system of a static world.

Also, static programmers rely on the typing so much that you can see
whole sections in the OCaml documentation (which is supposed to be the
ML with the best documentation AFAIK) where there is nothing more than
just type specifications -- in a language like Scheme you need to be
more disciplined.

Another point - since you spend so much time on types (in a static
world), you're getting used to that help and you would not feel bad
"spreading" code -- for example, in an OCaml system we have here I
once tried tracing the code that does something (very specific:
printing terms) -- pretty soon I had around 25 open files in Emacs,
each had something involved.  When I talked to the guy who wrote it
about this problem, he didn't see any problem since the type system
protected him by letting him know how to propagate changes around, but
my personal opinion is that this dangerous -- I don't believe that all
changes that need to be propagated will manifest themselves as type

Of course there is another factor which is the fact that dynamic
languages tend to *be* dynamic which allows you to keep yourself in
the environment, where in static language the REPL is usually an ugly
hack that might give you a dynamic illusion until you try redefining
stuff.  You can do the define-test-debug-redefine-test... cycle only
for tiny standalone functions but you can't have the freedom you have
in Scheme.  (There is a project called "Efuns" that makes an
Emacs-like editor and a window manager using OCaml -- if you read what
they did, the dynamic redefinition was one of the first problems they
had, IIRC, they hacked OCaml to be able to do things.)

The last point that the static world raise is that for big projects
with many people, a static world is better at handling things, which
might be true.

I think that the best would be to get the advantages of both, which is
why I like the fact that the PLT people respect types (instead of
blind flamewars).  (I had infinite discussions with the local static
representative and I think that the static world would benefit too
from being a bit more dynamic.)  I think would be nice if ML would
somehow substitute C as the foundation things are built upon.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!