PEP 3107 and stronger typing (note: probably a newbie question)
Wed Jul 4 23:32:21 CEST 2007
Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> writes:
> Haskell - as other languages using type-inference like OCaml - are in
> a different category. Yes, I know, don't say it, they are statically
> typed - but it's mostly structural typing, not declarative
> typing. Which makes them much more usable IMHO.
Some users in fact recommend writing an explicit type signature for
every Haskell function, which functions sort of like a unit test.
That doesn't bloat the code up noticibly. The conciseness of those
languages comes more from polymorphism and convenient ways of writing
and using higher-order functions, than from type inference.
> Still, static typechecking is not a garantee against runtime
> errors. Nor against logical errors.
Right, however the reality is it does seem to prevent a lot of
surprises. There's even an intermediate language (a language
generated by a compiler as an intermediate step towards emitting
machine code) called Henk, in which EVERY value is type-annotated (and
in a very fancy type system too). The author reports that the
annotations have been very helpful for noticing compiler bugs.
> I'd have to see a concrete use case. And I'd need much more real-world
> experience with some ML variant, but this is not something I can
> expect to happen in a near future - it's difficult enough to convince
> PHBs that Python is fine.
Monad Reader #7 has an article about some Wall street company using ML:
see the article by Yaron Minsky.
More information about the Python-list