Hacker News new | past | comments | ask | show | jobs | submit login

But noting types is not the same as the specifics of a type system. Merely marking what types a function accepts can be accomplished just as easily with a comment like "# function foo : (int, int) -> int".

But anyway, in many cases, structural typing can make more sense than name-based typing.




And the point is, with a static type system you get automatic verification that the "comment" is accurate


Indeed, that is the definition of a static type system. And that's a useful thing to have. But it's not infinitely useful. In some cases, the burden of pleasing the type system can be bigger than the burden of checking types yourself where necessary. Static typing can actually get in the way of useful algorithms if (for example) your type system doesn't support generics.

Due to these tradeoffs, in some cases, people can be more productive in a language without the help of a typechecker than they can in certain languages' static type systems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: