3 ms·
I'm sorry, but that's not the definition of type inference. "Type inference refers to the automatic deduction of the data type of an expression in a programmin
by ceor4 10y ago
I'm sorry, but that's not the definition of type inference.
"Type inference refers to the automatic deduction of the data type of an expression in a programming language."
https://en.wikipedia.org/wiki/Type_inference https://en.wikipedia.org/wiki/Type_inference
Which you'll notice C++ and Go, are listed as languages with type inference.
But you're right that they don't have as nearly as strong type inference as rust, which doesn't have as strong as haskell etc.
- steveklabnik 10y agoRust and Haskell have very similar type inference. The only major difference is that Rust doesn't infer type signatures, but that's a design decision, not a power issue.
- dllthomas 10y ago> "Type inference refers to the automatic deduction of the data type of an expression in a programming language." Depending on how simple "deduction" can be, that arguably includes every language that includes expressions. And if the deduction is required to include usage information, it quite arguably excludes C++/Go style "var": a variable declaration is not an expression. Generally, that Wikipedia article doesn't seem very good - check the talk page.