Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`Any` seems to be more akin to C# `dynamic`

The key is that we're talking about _Gradual_ Typing: it's not that "you never want to type things as Any" (if you always used a dynamically typed language like Python you probably never cared too much), or "subclassing is too limiting" (if anything, imho is not limiting enough).

The point is offering a tool to people who might benefit from some static checks, to avoid stumbling into problems at runtime. Those people have a HUGE codebase with dynamic types (basically, everything is already Any) and you need to _Gradual_ly specify and move over parts of the code to be correctly typed.

as keosak writes, if you want a proper explanation of theory behind it, just read Jsiek's blog posts



It reminds me of TypeScript, where everything defaults to type `any`, so it can interoperate with normal JS. This essentially makes static type checking an "opt-in" feature of the language.


Thanks - this is exactly what I was missing. I was trying to figure out the benefit of allowing it in the language, when of course the answer is supporting existing programs.




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

Search: