> Overloading plus Hindley-Milner like type inference is NP-complete and Nim 
> focuses on overloading. I have never regretted this decision in my life. ;-)

very interesting

> Is there a paper/resource you can link where the relationship is explained in 
> more detail?

>From a very quick google search I was able to find this (there might be better 
>references): <http://web.cs.ucla.edu/~palsberg/paper/dedicated-to-kozen12.pdf>

They prove that overloading for an example language (some type of lambda 
calculus, that in particular has pretty extensive type inference from what I 
can tell) overloading is NPI complete. In a language like Java where you can 
infer type statically (and for this context, I think it applies also to Nim) 
they have an informal proof that overloading becomes polynomial. And they 
mention in the end that the the case of ML and Haskell (Hindley-Miller 
polymorphism whatever that is) the type system becomes undecidable.

Reply via email to