Leo Lipelis
Posts: 111
Nickname: aeoo
Registered: Apr, 2006
|
|
Re: A Type System is a Set of Tests
|
Posted: Apr 19, 2006 3:15 PM
|
|
> >In that case, it doesn't make any difference if the > language was statically type checked or dynamically type > checked. > > >(Initially, it seemed as though you were saying that > there was a difference.) > > My point is static type usually buys you something, but > sometimes that something isn't worth as much as it costs. > Which is why I think static type information is something > g that should be incrementally added to a program as it is > increasingly well understood.
That's now how I think when I program though. When I use statically typed languages, I always understand the types, but I also understand that my current understanding of types is of provisional nature.
In my opinion static types buy a lot less than people think. In particular, many arguments regarding reducing bug counts and reliability I think are unsubstantiated anecdotes. In my experience programs written in good dynamic languages tend to be pretty solid. Likewise, people do circumvent static typing by using the root object class when they feel lazy. So I understand static typing, as a tool at best, but not as any kind of guarantee at all. It still takes some discipline and maybe even wisdom to use it to full effect. But if you have such discipline and wisdom then you can use a dynamically typed language to an even greater effect.
Supposedly LISP doesn't have static typing. Is it true that there are refactoring LISP IDE's? If so, how do they do it?
If I can get whatever little benefits of static typing without actually thinking about types intentionally, and without paying any price, that's great. Otherwise, I'd rather take 1 extra run time bug per year (and 10,000 less bugs due to highly interactive nature of development and fewer files/KLOCs) and go with a dynamically typed language.
From this point of view, the only language I've heard of that seems to approach this, is OCaml. Other than OCaml or some other language like it, I don't prefer statically typed languages. OCaml has a really ugly syntax and is an eye sore. It's far from being elegant and minimalistic in its design, in my opinion. I like languages that have 3 features and 1 reserved keyword, and are extremely well understood at their core, and where 99% of functionality comes from a library. One such language is Scheme. If I could have Scheme with type inference a la OCaml, that might be an ideal language to my mind.
In real world though, I have to settle for less than ideal languages because of the batteries. Java has batteries and so does Python. If I pick OCaml or some really weird Scheme implementation, then I get no batteries to play with. I don't want to hunt all over the net for .01 version libraries just so I can make a GUI or read/write database.
|
|