On Sun, Jun 29, 2014 at 5:35 PM, Jonathan S. Shapiro <[email protected]> wrote:
> On Tue, Jun 24, 2014 at 11:28 PM, Ben Kloosterman <[email protected]>
> wrote:
>>
>> In C# that has both , programs with lots of inheritance are harder to work
>> on and FAR harder to test and maintain than those that use a lot of
>> interfaces. It is not a coincidence that there has been a significant move
>> in Java and C# from inheritance to interfaces over the years. There will
>> always be someone who will put crap into a base class.
>
> If you had a language with interface inheritance but no implementation
> inheritance, would you expect the same kinds of issues to arise? How much of
> this comes about because the convolution of implementation and interface in
> C++, C#, and Java causes classes to get mucked up with helper functions and
> various other kinds of implementation support that may not want to get
> inherited?

Can I ask a bitc history question to get some of this discussion
straight in my head?

Several of the helper function horrors you mention in C++ disappear
with Haskell-style type classes, since issues such as construction are
well separated from definitions.  Type classes introduce other
problems, such as ambiguity, overlap, etc., but that's a separate
issue.

I believe the original bitc plan was to include both type classes and
existentials, and use existentials to simulate heterogeneity in the
standard way, boiling down at the implementation level to passing
around tuples of type class dictionaries and object pointers.

At some point the decision was made that some sort of class support
was a more practical route.  I do not remember these reasons clearly:
could someone summarize them for me?

The reason I ask is that (modulo issues of checked upcasts) interfaces
and type class existentials seem isomorphic.  I may be wrong here, so
please correct if they differ fundamentally.  Since I have more
experience with type classes than with interfaces, I'm hoping to map
across my type class intuition to the world of interfaces.  Any
fundamental differences between the two might also map to problems
type classes solves but interfaces do not.

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

Reply via email to