On 19 March 2010 23:12, Jonathan S. Shapiro <[email protected]> wrote: > I now think I can more or less see how to get single inheritance into BitC. > We won't infer it, because that wouldn't give a most general typing, but I > think we can handle it when it is user-specified. If we introduce > inheritance into the language, I believe that we should continue to separate > the definition of type from the definition of implementation. In this view, > a class definition is mainly seen as a type class definition. > > Questions for the group: > > 1. How important is inheritance in the eyes of people here?
I personally like some sort of inheritance in terms of 1) having some sort of objects 2) having the ability to extend the objects This feature makes expressing some ideas in code easier and less repetitive by packing some functions together with the data they operate on and by writing general code which handles multiple types of objects as their common ancestor where appropriate. > 2. Can anybody identify an "acceptable cost" strategy for transcoding C++ to > BitC without it? It depends heavily on the codebase you work with. Some people use templating and inheritance to make C++ look like a sane language and such code is easy to convert to languages that can do objects. Sometimes you get some MS C++ which is just methods randomly stuffed into classes by some MS VS code generator and it does not make any sense however you look at it. > 3. Can anybody identify a sensible way to interoperate effectively with the > Common Type System without single inheritance? There is alternate approach to "inheritance" - querying the interface of the object. You can either associate objects and interfaces in some way or you can just check that the method(s) you want to call exist at the appropriate arity. > 4. Given that this can be deferred, how much impact does its presence or > absence likely to have on the early evolution of the BitC standard library? > Is that good or bad? Not having any decent object-like construct is generally bad for the language because it makes writing code in it somewhat more verbose and harder. Thanks Michal _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
