[plt-scheme] type of language

From: John Clements (clements at brinckerhoff.org)
Date: Wed Dec 9 19:09:15 EST 2009

On Dec 9, 2009, at 3:17 PM, Marek Kubica wrote:

> On Wed, 9 Dec 2009 18:14:11 +0200
> emre berat nebioğlu <beratn at gmail.com> wrote:
> 
>> i guess become a Computer programmer or Computer Scientist  is not
>> only about writing code but also it is about some specific stuff like
>> type of language.
> 
> Well, the nice thing about such things is, that you can learn it and
> classify a language yourself.
> 
> Weak/Strong typing: If a language is weakly typed, it tries to convert
> the types automatically and guess what you want to do. For example,
> consider "1" + 1. If a language is weakly typed, the answer is usually
> 2 (or "11"), because it guessed what you wanted to do. If it is
> strongly typed, you get an error/exception that this is not valid, one
> cannot add a string and an integer together.
> 
> Popular example of weak typing: PHP
> Popular example of strong typing: Scheme :)

Ack! I totally reject this definition of "weak" vs. "strong" typing. Generally, the difference you're describing has nothing to do with the language's type system per se, but rather with the definition of its primitives, and how flexible or restrictive they are.

> Dynamic/Static typing: is the type information enforced? Can a
> "variable" change its type? Is it possible to call a function with
> types that weren't considered by the implemnentor of the function?
> Do you need to declare the types of function arguments and return
> values?
> 
> Popular example of dynamic typing: Scheme :)
> Popular example of static typing: Java
> Popular example of static typing with type inference: ML
> (type inference = you don't need to specify the types, the language
> finds out about them by itself)

Ack! I totally disagree with this as well.

A statically-typed language is one with a built-in proof system that demonstrates the impossibility of certain runtime errors.  These languages refuse to run any programs for which their proof system cannot construct such a proof.

The choice of *which* errors are fenced out by the proof system is up to the designer of the type system, which makes clear distinctions between statically-typed languages and non-statically-typed languages impossible.



Sorry to be such a disagreeable chap,

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20091209/ff768377/attachment.p7s>

Posted on the users mailing list.