On Sat, Dec 27, 2014 at 7:53 PM, David Jeske <[email protected]> wrote:

> On Dec 27, 2014 3:31 PM, "Matt Oliveri" <[email protected]> wrote:
> > Yes, that makes perfect sense. I am only objecting to the sense I got
> > from David that there's something wrong with closed variant types for
> > modular compilation.
>
> Nope, nothing is wrong with closed variant types, but systems with
> late-binding often lack closed types. Even a type without subtyping is only
> closed inside a sealed atomic compilation module that defines them. (Or via
> some static compile time binding construct)
>
David, Matt:

I don't have a dog in this fight. If there is something here that I am
failing to understand, I would truly appreciate an opportunity to learn.
But it seems to me that this is an argument with no winners.

First, I suggest that the issue is entirely reduced to open vs. closed
union types. For all other types, either (a) a pattern decomposes the type,
in which case it was lexically in scope, or (b) a pattern *fails* to
decompose, in which case we don't care whether the type definition is in
scope. In either case, this reduces to lexical scoping, and any failure of
match completeness in the presence of a lexically visible type is a
consequence of poor language design, plain and simple.

The notable exceptions to that statement are open unions.

I dispute David's assertion that systems with late binding eschew closed
unions. It is true that Java and C# do this. It is true that there is an
argument (from the standpoint of economy of mechanism) that (stipulating
the presence of open unions) closed unions should not be added to a
language providing [single] inheritance without compelling reason. But this
decision is a matter of *taste* rather than any fundamental consequence of
separate compilation. BitCs adoption of unboxed unions containing
references brings this into sharp relief. The issue is not the presence or
absence of closed unions. The issue is *open* unions in the presence of
late bindings. I think we can safely agree that partial matching of open
unions is better than no matching. I think we can further agree that
complete matching of (non-frozen) open unions is not (in principle)
possible. Given a complete match, one can always introduce a new open union
member.

shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to