So (through gritted teeth) static typing has some uses.
But we don't always have it.
What if it were optional?
- GuidoVanRossum discusses adding it to PythonLanguage : http://www.artima.com/weblogs/viewpost.jsp?thread=85551
- It's futile : http://smalltalk.org/articles/article20050105a2.html
- We have everything we need : http://blog.ianbicking.org/already-under-our-noses.html
- Guido continues thinking : http://www.artima.com/weblogs/viewpost.jsp?thread=86641
But the real question is why is Guido thinking this way? Has he discovered or experienced something that makes StaticTyping attractive?
- what does it mean? : http://boredomandlaziness.skystorm.net/2004/12/type-checking-in-python.html
(well, before I read these.)
- The nearest thing I've experienced to optional static typing is VisualBasic. And lo and behold, in SdiDesk I pretty much did declare the types of my variables. Out of habit.
Perl 6 is going to have some optional typing too. http://www.linux-mag.com/2003-04/perl604.html
Common Lisp has it too. But in all implementations I know, it's really just for performance, not rejecting programs which fail to live up to some static standard. Rejecting these programs is perfectly allowable in the standard (as I remember), but it never caught on; not a high priority as other things so far. Maybe one day.
And there's probably some static typing library someone hacked together, floating around the net.
See also :