[plt-scheme] Why do folks implement statically typed languages?

From: hendrik at topoi.pooq.com (hendrik at topoi.pooq.com)
Date: Wed May 30 20:13:09 EDT 2007

On Wed, May 30, 2007 at 01:59:49PM -0400, Chris Uzdavinis wrote:
> Matthias Felleisen <matthias at ccs.neu.edu> writes:
> 
> > 3.
> >
> >> And, just to make it clear, C and C++ appear to have static typing,
> >> but
> >> it doesn't accomplish the task it ought to, so the effort expended on
> >> it is somewhat wasted.
> >
> > Amen. This is what I alluded to in my message using the phrase
> > "unsound." What this means concretely is that
> >
> >   int x
> >
> > in a C++ program is completely totally misleading. Depending on your
> > program, the bits in x may come from a string, a function, combine a
> > bunch of booleans, or what-have-you. It doesn't serve as
> > documentation for maintenance and it certainly doesn't serve as clue
> > during debugging.
> 
> While I'm probably the biggest Scheme proponent in my company, I still
> consider myself a C++ programmer first and foremost, and would like to
> comment your characterization.  Though what you say is true, and it's
> *possible* to do all sorts of evil things with your memory and objects
> in C++, it's also entirely possible to make well-behaved, easy to
> understand C++ code too.  That is, well-written C++ code not
> misleading at all.  

The problem is not that you can't write readable correct code.  It's 
that it is extremely easy to write incorrect code by mistake.  Just free 
something that you thought was no longer needed, and it's a dissaster.

-- hendrik


Posted on the users mailing list.