Static typing

Pascal Costanza costanza at web.de
Fri Oct 24 10:44:18 EDT 2003


Dirk Thierbach wrote:
> Pascal Costanza <costanza at web.de> wrote:
> 
>>Dirk Thierbach wrote:
>>
>>>You cannot take an arbitrary language and attach a good static type
>>>system to it. Type inference will be much to difficult, for example.
>>>There's a fine balance between language design and a good type system
>>>that works well with it.
> 
> 
>>Right. As I said before, you need to reduce the expressive power of the 
>>language.
> 
> 
> Maybe that's where the problem is. One doesn't need to reduce the
> "expressive power". I don't know your particular application, but what
> you seem to need is the ability to dynamically change the program
> execution. There's more than one way to do that. 

Of course there is more than one way to do anything. You can do 
everything in assembler. The important point is: what are the convenient 
ways to do these things? (And convenience is a subjective matter.)

Expressive power is not Turing equivalence.

> I may be wrong, but I somehow have the impression that it is difficult
> to see other ways to solve a problem if you haven't done it in that
> way at least once.

No, you need several attempts to get used to a certain programming 
style. These things don't fall from the sky. When you write your first 
program in a new language, it is very likely that you a) try to imitate 
what you have done in other languages you knew before and b) that you 
don't know the standard idioms of the new language.

Mastering a programming language is a very long process.

> So you see that with different tools, you cannot do
> it in exactly the same way as with the old tools, and immediately you
> start complaining that the new tools have "less expressive power",
> just because you don't see that you have to use them in a different
> way.  The "I can do lot of things with macros in Lisp that are
> impossible to do in other languages" claim seems to have a similar
> background.

No, you definitely can do a lot of things with macros in Lisp that are 
impossible to do in other languages. There are papers that show this 
convincingly. Try 
ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-453.pdf for a 
start. Then continue, for example, with some articles on Paul Graham's 
website, or download and read his book "On Lisp".

> I could complain that Lisp or Smalltalk have "less expressive power"
> because I cannot declare algebraic datatypes properly, 

I don't see why this shouldn't be possible, but I don't know.

> I don't have
> pattern matching to use them efficiently, 

http://www.cliki.net/fare-matcher

> and there is no automatic
> test generation (i.e., type checking) for my datatypes.

http://www.plt-scheme.org/software/mrflow/

> The only way out is IMHO to learn as many languages as possible, and
> to learn as many alternative styles of solving problems as possible.

Right.


Pascal

-- 
Pascal Costanza               University of Bonn
mailto:costanza at web.de        Institute of Computer Science III
http://www.pascalcostanza.de  Römerstr. 164, D-53117 Bonn (Germany)





More information about the Python-list mailing list