Lambda the Ultimate

inactiveTopic So what do you think of cross-language inheritance?
started 12/26/2001; 3:37:41 AM - last post 12/28/2001; 2:33:46 PM
Ehud Lamm - So what do you think of cross-language inheritance?  blueArrow
12/26/2001; 3:37:41 AM (reads: 2149, responses: 6)
So what do you think of cross-language inheritance?
I got this link from a message Dan posted to the discussion group.

(I've been thinking of cross-language contracts recently. Maybe they can help.)


Posted to OOP by Ehud Lamm on 12/26/01; 3:38:30 AM

Dan Shappir - Re: So what do you think of cross-language inheritance?  blueArrow
12/26/2001; 9:17:27 AM (reads: 1020, responses: 0)

As I have previously stated, I do not view .NET to be as language-neutral as its designers repeatedly claim. All the .NET languages I have seen so far are basically C# with a different syntax. Anything that attempts to break this mold, e.g. unmanaged C++, is incompatible with the cross-language inheritance feature.

So to me basically this becomes a question of using inheritance as an OS API. While there are advantages to this technique, as demonstrated in ASP.NET for example, I find it significantly limited by the CLR’s lack of support for multiple inheritance.

Dan Shappir - Re: So what do you think of cross-language inheritance?  blueArrow
12/26/2001; 9:42:58 AM (reads: 1057, responses: 0)

To put it more bluntly, the use of inheritance as a means to access system services has forced Microsoft to drastically change the behavior of some programming languages on .NET. For example, a quote from an article about JScript.NET:

The other major performance improvement added to JScript .NET is the introduction of Option Fast. This option tells the compiler to enforce certain rules that allow additionally optimizations, at the cost of some reduced functionality. When Option Fast is enabled, the following JScript behavior is activated:
  • You must declare all variables.
  • You cannot assign values to, or redefine, functions.
  • You cannot assign to, or delete, predefined properties of the built-in JScript objects.
  • You cannot add expando properties to the built-in objects.
  • You must supply the correct number of arguments to function calls.
  • The arguments property is not available within function calls.

It is quit obvious that with this option enabled you are not in JavaScript-land anymore. Add to that the inclusion of classes and interfaces, which you must use to access .NET functionality (a template-based JavaScript object cannot extend a system class.) It'll be interesting so see how Scheme.NET and Haskell.NET come out (if they ever do come out.)

Ehud Lamm - Re: So what do you think of cross-language inheritance?  blueArrow
12/26/2001; 10:52:52 AM (reads: 1023, responses: 0)
I am less interested in the .Net perspective, actually. I was thinking more generally about inheritance across language boundaries.

Dan Shappir - Re: So what do you think of cross-language inheritance?  blueArrow
12/26/2001; 2:17:46 PM (reads: 1014, responses: 0)
.NET is the only environment I'm familiar with that employs this technique (if there are others I'd certainly be interested in learning about them.) Given this, I take .NET as a yardstick to measure how this type of cross-language integration works. And given the .NET sample, my conclusion (at least for now) is that languages need to be very close at the semantic level for this to work.

Brian Zhou - Re: So what do you think of cross-language inheritance?  blueArrow
12/26/2001; 4:32:57 PM (reads: 1015, responses: 0)
Jython on top of JVM is another example of utilizing cross-language inheritance besides .NET. So when Microsoft announced J#, I was thinking Jython.Net? It really does an excellent job: Python semantics are preserved and you can even use jython subclass in the place of Java class/interface for method callback. It's mostly seamless one-way calling from jython to java. And I'm perfectly happy with this combination of dynamic language on top of static one. Comparatively, isn't JScript.NET or .NET a little too ambitious trying to achieve arbitrary n-way? IMHO, in the end only hi-level dynamic one subclassing low-level static one will work well.

David B. Wildgoose - Re: So what do you think of cross-language inheritance?  blueArrow
12/28/2001; 2:33:46 PM (reads: 976, responses: 0)
The lack of Multiple Inheritance is not the only problem with .NET as another consideration is the non-variance of arguments and return types. This is an issue for Eiffel, (covariant), presumably for Sather (contravariant), and no doubt other languages as well.
I think this illustrates the old adage about trying to satisfy everyone only to satisfy no-one.