In the news group comp.lang.dylan there is a debate going on about
static vs dynamic typing.
In the article below, Thomas Breuel explains why dynamic typing is
needed but argues that there should be as much static typing as possible
perhaps optionally.
I am quite sure that Pop-11 could do with static typing aids. (I think
Allan Ramsay developed something along these lines for the PDP11 version
of Pop-11 in the late 70s when he was working on a research project
at Sussex.)
Aaron
-----------------------------------------------------------------------
[Article by Breuel follows, from comp.lang.dylan comp.lang.scheme]
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.scheme,comp.lang.dylan
Subject: Re: Why Dynamic Typing?
Date: 26 Jun 93 03:38:03
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
Perceptive)
Message-ID: <TMB.93Jun26033803@arolla.idiap.ch>
References: <GUNTER.93Jun22172857@penzance.cs>
Reply-To: tmb@idiap.ch
In-reply-to: gunter@penzance.cs's message of 22 Jun 93 21:28:57 GMT
>>>>> On 22 Jun 93 21:28:57 GMT, gunter@penzance.cs (Michial Gunter) said:
> Why do you like dynamic typing?
Because it lets me write tools that I couldn't write in a language
that supports only static typing. Examples of such tools are
inspectors, debuggers, tracers, steppers, exception systems, generic
I/O functions, DBMS, and RPC.
But I also like static typing, because it helps me find more bugs with
less work.
Sadly, many people seem to view static typing and dynamic typing as
being mutually exclusive. Of course, they aren't. There are a number
of programming languages that have offered both in the past. While
none of those languages seem to have gained widespread acceptence
(maybe they were just too far ahead of their time), there is an
encouraging trend: some implementations of dynamically typed
programming languages are beginning to incorporate more static type
checking, and several statically typed programming languages now also
provide dynamic typing (adding dynamic typing to a statically typed
languages is easy--at least conceptually).
I think your question might perhaps better be phrased as "Why don't
some people like static typing?". Apart from misattributing the
problems arising from the lack of dynamic typing in many programming
languages to the presence of static typing in those programming
languages, I think the main reason for this attitude is that current
static type checkers are highly obtrusive in interactive programming
environments. That is, interactive statically typed languages tend to
impose constraints, for example, on the ability to redefine functions
and values interactively and on the ability to use names and objects
before declaring their types. But even for batch compiled languages,
most current statically typed languages impose inconvenient
constraints on the order of definitions, declarations, and use of
names and objects.
I hope that we will eventually see unobtrusive static type checkers
that advise rather than restrict. In an interactive environment, this
could look something like
> (check-types)
Hi, this is your friendly FooLisp system. Since you asked
about possible type errors, before you run your program, you
should know that you are calling function SIN with an argument
of type SYMBOL from function FOO on line 42 in file
YELLOW.LISP. I couldn't find any other type inconsistencies.
>
or
> (defun f () nil)
Warning: Your redefinition of F causes several type
inconsistencies; type :TI for details.
F
>
Thomas.
[end quote]
|