Giuseppe Castagna wrote:
I would like to know where I can find the latest documentation on the type (and above all subtype) system for Perl 6. The synopsis does not say much about it.

I found this:
but agin there is not much information.

From what I've seen, details of the Perl 6 type system are spread all over the Synopsis documents ( ), but to start off with you should probably look at the part of Synopsis 2 that introduces the built-in types, and look at all of Synopsis 12.

If your are curious about my interest, the reason is that I wanted to propose a type system for a core of Perl 6. The idea is to use the type system of the CDuce language ( without the XML part but using the same technique used there to type the (late bound) overloaded functions (akin to multi-methods). I want to adapt it to Perl 6 multi sub/methods (with ";;" parameters) by using the ideas I wrote long ago in the following paper:

G. Castagna: Covariance and contravariance: conflict without a cause. ACM Transactions on Programming Languages and Systems, vol. 17, n. 3, pag. 431-447, 1995.

Is there an electronic copy of this that you can link to?

the advantage is that combining these old ideas with the recent advances of the Cduce type system should yield a type system very easy to understand and use for the average programmer since it relies on simple notions such as union, intersection, and set (of values) containment. Furthermore the powerful (sub-)typing algorithms developed CDuce could be probably reused with minor modifications.

I have never heard of Cduce before, but I have seen some of the ideas you talk about before, such as conceiving types as sets of values and you can define types in terms of others using set operations. Perl 6 does some of that, in particular it has union types and subset types and I think intersection types, though the last obviously only makes sense to declare with 2 subset types with the same base type.

And by "union types", I mean both that you can say "Dog | Cat" (syntax?) to allow either Dog or Cat values, and also that Perl 6 roles effectively declare union types but that the members add themselves to the union rather than the union itself declaring what it ranges over; in the latter case, the union type is "every value that does this role".

I would like to know the current status of the Perl6 in order to adapt my presentation. In particular, a complete syntax for types would be welcome (the most complete description I found is this one

Thanks in advance for your help. Of course I will be happy to discuss the details of my proposal on this list, if there is any interest, of course.


P.S. If you are interested to see what I work on, please check my web page:

I haven't looked at CDuce yet, but given the kind and quantity of papers you appear to have published, I believe your input would be valuable for my own programming language, "Muldis D" (see for links), which I believe already goes further in the direction you seem to propose than I perceive that Perl 6 does. To capsule summarize, Muldis D is what I believe that SQL should have been in the first place. It is a computationally complete language that is specialized in working with relational databases. Its design is *strongly* influenced by Perl 6, that being its biggest influence which isn't database specific or functional, and so I believe that any proposals for Perl 6 can potentially be applicable to Muldis D. (P.S. Muldis D doesn't yet spec roles/mixins/interfaces but that will be in the next major version, so says the spec's TODO file.)

If you want to discuss that further you may best do it elsewhere as strictly speaking it is not on topic for Perl-6-Language.

-- Darren Duncan

Reply via email to