[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with type inference

This page is part of the web mail archives of SRFI 76 from before July 7th, 2015. The new archives for SRFI 76 contain all messages, not just those from before July 7th, 2015.

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?