Karl Brodowsky wrote:
Mark Sparshatt wrote:you're right this is something that the compiler could handle.
From the description in PDD15 I'm not sure how to hand languages where a class is also an object. Where Foo is an instance of Foo' which is an instance of Class.
Could this be handled during compilation?
The compiler could produce the classes Foo and Foo' and use something like
Ruby-Class from a library. Then Foo could contain a hidden reference to
Foo', using a convention that the compiler can handle. I would expect that
the dependency on Ruby-libraries still exist, when running compiled Ruby
anywhere where Perl6 has been installed.
The problem is what happens when some Python code tries to call a class method on a Ruby object? if Python doesn't know about the hidden reference within Foo it won't be able to find Foo' in order to call the method.
I think that if different languages are going to interoperate then this either needs to be handled within Parrot, or if it is handled by the compiler than there needs to standard approach.
-- Mark Sparshatt