News for hackers. Stuff that matters.
Re:Type inference has usability problems by dwohnitmok on Thursday June 27, 2019 @10:49PM (#20301075)
One huge benefit of (robust) type inference is type holes. That is the ability to leave parts of your code unwritten and have the compiler infer what the type of those unwritten parts should be, and in more advanced cases, fill in the gap with candidate code.

The latter is something that isn't in any languages I would consider production-ready (although it seems tantalizingly close), but the former is already quite useful depending on how much type inference your language is capable of. If paired with the ability to search for code by type, it makes exploring APIs extremely friendly. Even without that ability, I've found the ability for the compiler to tell me what type belongs in a given empty chunk of code to be extraordinarily helpful for those times that I'm programming in a top-down fashion (scaffolding first, then fill in the concrete implementation).

Re:Type inference has usability problems by Sean1708 on Friday June 28, 2019 @09:47AM (#20304225)
> The latter is something that isn't in any languages I would consider production-ready

What languages have you seen it in?

Re:Type inference has usability problems by mrgriffin on Friday June 28, 2019 @10:23AM (#20304559)
Not OP, but my understanding is that it's a common approach in Idris. Here's the creator of the language deriving the implementation of zipWith without writing any code: https://www.youtube.com/watch?v=X36ye-1x_HQ&t=1274

Some other examples include:

- Haskell: https://hackage.haskell.org/package/ghc-justdoit

- Scala: https://github.com/TypeChecked/alphabet-soup

- Agda: https://youtu.be/3U3lV5VPmOU?t=3159

I was under the impression that justDoIt comes from Scala, but I can't find a reference for that.