From: martin@... (Martin v. Loewis) Date: 2001-12-31T22:42:07+09:00 Subject: [ruby-talk:29850] Re: Python and Ruby: a comparison "James Britt (rubydev)" writes: > > What happens when a language has good ideas which are more advanced than > > what CLR supports. It is left out of CLR, or included into it with those > > ideas stripped from the language to accomodate CLR. Sometimes the Holy > > Grail of language interoperability has serious flaws to it. > > It may not be as bad as that. It is that bad. The only language that is provided completely and correctly in .net will be C#. All other language implementations will need to compromise, giving you an implementation that doesn't run any but the most trivial applications. Here are some of the compromises that language authors had to make when porting the languages to the CLR: 1. Give up many libraries. There are many things that simply cannot be built on top of the libraries provided in .NET. That will certainly harm Python.NET and J#, perhaps even C++.NET. 2. In C++, delete has no effect. Objects stay alive as long as they are referred-to, possibly breaking cleanup semantics of existing applications in subtle ways, since C++ programs often don't clear all pointers to an object after they have deleted it. 3. In Java (i.e. J#), I think there will be funny interactions between Object (the root of the CLR class hierarchy) and java.lang.Object. The can't be the same, since Object does not provide the right interface. That means java.lang.Object will have a base class, or will be tied to an Object. No matter how this is done, I expect strange results if some foreign object appears in a Java application - will reflection continue to work? 4. In Python.NET, I'm not certain how they have solved the issue of __dict__: Each object can have arbitrary many attributes, whereas in .NET, each class must have a static set of fields. What happens if you pass a Python Object-derived instance to, say, a C++ application? > While different languages allow you to express things in particular > ways, many will map to the same assembly or byte code, or close > enough. The mismatches may come when one language has some aspect > that is impossible to duplicate the others, which might not be that > often. It happens all the time. Give me any two languages, and it won't be difficult to find a list of significant differences. Regards, Martin