There are serious proposals for adding type inference `var x = new List();` to Java! https://openjdk.java.net/jeps/286
miniblog.
Related Posts
I'm having fun writing a simple type checker, but I'm learning firsthand why syntax-directed checking doesn't work. It prevents inference.
My checker catches real bugs, but it can't handle cases like this:
[1, 2].map(fun(x) { x + 1; })
I think I need bidirectional checking.
I'm designing a programming language and trying to decide the type of `let x = 1;`. Should it be Unit or Int?
Advantage of Int: really convenient when evaluating snippets in a REPL.
Advantage of Unit: It's much less confusing when type inference runs on an incomplete function.
Today I learnt about Solargraph, an LSP for Ruby which includes an impressive amount of type inference and type checking! https://solargraph.org/guides/type-checking
Type signatures are parsed from doc comments, similar to JSDoc with TypeScript.