Email list hosting service & mailing list manager


Re: Problem with type inference William D Clinger 16 Sep 2005 07:12 UTC

Andre van Tonder asked:
> In other words, is the basic interface compatible
> with static typing a la HM?

No, but Scheme itself is not compatible with static typing
as performed by the Hindley-Milner algorithm.  It seems to
me that the kinds of type inference that do work for Scheme
can easily be extended to infer types for Scheme plus SRFI-76.

> It seems that whatever format the static inferencer expects,
> the programmer can easily shoot himself in the foot and break
> all inferencing in implementing a custom syntactic layer that
> perhaps translates to a slightly different format.

That is true.  When it comes to efficiency, neither SRFI-76
nor Scheme prevent programmers from shooting themselves in
their metaphorical feet.

By disarming the programmers, we could eliminate one specific
risk to their metaphorical feet.  Alternatively, we could
encourage programmers not to aim at their feet.

> I concede that this will not matter if the programmer uses
> the standard syntactic layer.

So removing the procedural layer would improve type inference
only for programmers who need to use the procedural layer?

Will