Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Static/Dynamic typing, lessons from the field
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pascal Costanza  
View profile  
 More options Feb 1 2006, 7:22 pm
Newsgroups: comp.lang.lisp
From: Pascal Costanza <p...@p-cos.net>
Date: Thu, 02 Feb 2006 01:22:36 +0100
Local: Wed, Feb 1 2006 7:22 pm
Subject: Re: Static/Dynamic typing, lessons from the field

dominikus wrote:
> Pascal, you mentioned that you have only seen one example so far, where
> static typing provides something that looks impossible to do in a
> dynamically typed language.

> Could you elaborate on that since I didn't get the point in your brief
> description.

The example I was referring to was posted to the ll-discuss mailing list
a while ago. See
http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg04650.html

To quote from that posting:

"Static typing can make programs more concise: I can write

     getLine >>= print . (/2) . read

or

     getLine >>= print . not . read

rather than

     getLine >>= print . (/2) . readDouble

or

     getLine >>= print . not . readBool

What happens here is that the correct read function is selected by the
static type system based on the return value of the expression that is
executed beforehand. In a statically typed language, the return type can
be guaranteed to be of a single deterministic type. In a dynamically
typed language, you can never know what the return value of a function
will be (unless you use a type inferencer for optizimation purposes, but
that _is_ static typing).

It's interesting to read the discussion that follows the posting above.

This was the first time I have seen a real example of increased
expressive power of static type systems, which is far more interesting
than the usual hogwash about early detection of so-called "errors",
better documentation and better efficiency.

Pascal

--
My website: http://p-cos.net
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google