Hacker News new | ask | show | jobs
by nicoburns 2161 days ago
I hated statix typing until I used Rust. Rust has Sum types (super powered enums), which provide what I was missing from dynamically typed langauges in languages like Java, C#, etc: namely the ability to have an "or" type (e.g. this is an integer or a string, and I want to be able to branch on that at runtime).

That, plus type inference makes the static typing pretty painless.

2 comments

Agreed. Do note that many other languages before Rust do provide good static typing with the niceties you'd expect (and that are often missing from Java), such as type inference, sum types, etc. Some examples include, but are not limited to, Scala, Haskell, the ML family of languages, etc.
Could not agree more. That's why I'm going to Rust next once done with my current F# project - I want to have experience with both JIT and AOT languages that support sum types and Option / Discriminated Unions.

These data types are much more powerful than the fancy arrays that wowed me back in the day :)