logo       

Re: pmc_type: msg#00584

lang.perl.perl6.internals

Subject: Re: pmc_type

Stéphane Payrard writes:
> That would allow to implement typechecking in imcc.
>
> .sym Scalar a
> a = new .PerlInt # ok. Perlint is derived from Scalar

Ugh, yeah, but what does that buy you? In dynamic languages pure
derivational typechecking is very close to useless. The reason C++[1]
has pure derivational semantics is because of implementation. The
vtable functions have the same relative address, so you can use a
derived object interchangably. In a language where methods are looked
up by name, such strictures are more often over-restrictive than
helpful.

Anyway, that's just my rant. If such a thing is to be in imcc, it
_must_ be optional without loss of feature. I have quibble with the
automatic typechecking of .param variables for the same reason.

Luke

[1] And the reason Java has it is because C++ did. Great design work,
guys.



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise