On Tuesday 22 July 2008 15:37:33 chromatic wrote:
> The wiki page at:
>
>       http://www.perlfoundation.org/parrot/index.cgi?inter_hll_mapping_not
>es
>
> seems to be missing the rationale for *why* it's necessary to map
> types between languages?  (Also see "If Perl 6 has to care about the
> internal storage format of an Integer PMC, it's doing something very
> wrong.")

Integer is a good example of the problem, actually.

The internal storage format doesn't change, but the methods you can call 
on it definitely will.  HLLs wrap the Integer class with their own 
subclasses, so that they have methods they can call on integers, which 
are expected by the HLL.

But when your perl6 function passes a Perl6Int to a TCL function, TCL 
HLL code code will try to access the integer, but it's not a TclInt, 
its a Perl6Int!  The value itself is fine, but the methods it expects 
to find will not be there.  Hence the need for conversion/mapping.

-- 
Mark

Reply via email to