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

There’s a trade off - was the mistake here or there? The type checker cannot know. But for those few cases you can add an annotation. Then the situation is, in the worst case, as good as when types are mandatory.



> But for those few cases you can add an annotation.

not in other people's code. My main concern is that gradual typing makes understanding other people's code more difficult.

Idiomatic Haskell warns against missing signatures[1], Rust makes them mandatory. Rather than global inference, local inference stopping at function boundaries is the future, if you ask me.

[1]: https://wiki.haskell.org/Type_signatures_as_good_style


Huh? If you are consuming code you can’t change from someone else, then I presume this is a published package? Then the IDE will tell you the types.


> the situation is, in the worst case, as good as when types are mandatory

The worst case is actually worse than when types are mandatory, since you can get an error in the wrong place. For example, if a function has the wrong type inferred then you get an error when you use it even though the actual location of the error is at the declaration site. Type inference is good but there should be some places (ex. function declarations) where annotations are required.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: