[plt-scheme] The problem with Scala (OT, sorry)

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Thu Mar 4 16:47:05 EST 2010

On Thu, Mar 4, 2010 at 4:41 PM, Raoul Duke <raould at gmail.com> wrote:
> On Thu, Mar 4, 2010 at 1:11 PM, John Clements <clements at brinckerhoff.org> wrote:
>> That is: the type checker couldn't figure out what kind of thing (List()) was, so it conservatively decided that it was List[Nothing].  Then, you get an error at some arbitrarily distant location. You can solve this by adding a type annotation to List(). Bflegg.
>
> it is my rough anecdotal hear-say understanding that this happens in
> other languages that have type inference. iiuc, the wisdom for
> programming in ocaml is to actually put in type annotations anyway so
> that errors show up closer to the real human error, rather than miles
> away due to a type checker that manged to keep on trucking.

The more time goes on, the more skeptical I am of type inference as a
primary method of assigning types to programs.  I like having some
inference, so that for instance I don't have to instantiate
polymorphic types at most applications, but by and large I want the
type checker to use what I wrote and not try to guess anything
complicated... because then, if it fails, the error messages are
complicated.

The task of a type checker is to double-check my thinking, not to do it for me.

--Carl


Posted on the users mailing list.