Type system for Perl 6

2010-02-04 Thread Giuseppe Castagna

Hi,

   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:
http://www.dlugosz.com/Perl6/web/typesystem-summary.html
but agin there is not much information.

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 (http://www.cduce.org) 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.


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 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

http://www.programmersheaven.com/2/Perl6-FAQ-Types).

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.



---Beppe---

P.S. If you are interested to see what I work on, please check my web page: 
http://www.pps.jussieu.fr/~gc


Re: Type system for Perl 6

2010-02-04 Thread Darren Duncan

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:
http://www.dlugosz.com/Perl6/web/typesystem-summary.html
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 ( http://perlcabal.org/syn/ ), 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 (http://www.cduce.org) 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

http://www.programmersheaven.com/2/Perl6-FAQ-Types).

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.


---Beppe---

P.S. If you are interested to see what I work on, please check my web 
page: http://www.pps.jussieu.fr/~gc


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 http://muldis.com/ 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


Re: Type system for Perl 6

2010-02-04 Thread Timothy S. Nelson

On Fri, 5 Feb 2010, Giuseppe Castagna wrote:


Hi,

  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.


http://perlcabal.org/syn/

	There's no one document there that contains all the information about 
types, but those are the latest, most authoritative documents.  If the code 
doesn't do what these documents say, then it's the code that is wrong, not the 
documents.  You probably want the links in the "Specification" column.


	Without knowing exactly what you mean by "type system" (I'm not 
one of the experts around here), I'd suggest that the places you want to look 
are parts of:

-   S02: Bits and Pieces
-   S09: Data Structures
-   S12: Objects
-   S14: Roles and Parametric Types

Possibly the following may also be useful:
-   S10: Packages
-   S11: Modules
-   S13: Overloading
-   S32: This contains API information for some of the individual types

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

http://www.programmersheaven.com/2/Perl6-FAQ-Types).


See link above.

	As for the status; let me start by stating that (unlike Perl 5), Perl 
6 is a specification that has multiple (incomplete) implementations.  The 
sections marked [DRAFT] at the link above are still far from final.  The 
others, while still changing daily, are more ... thorough and 
community-approved.


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.


	As I've said, I'm no expert; I didn't completely understand your 
original message.  Hopefully one of the experts will be able to chime in as 
the discussion progresses.


	Just before I end this e-mail, I should maybe also provide a link to 
http://perl6.org/ since it links to things that may be useful to you.


HTH,

:)


-
| Name: Tim Nelson | Because the Creator is,|
| E-mail: wayl...@wayland.id.au| I am   |
-

BEGIN GEEK CODE BLOCK
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- 
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI D G+ e++> h! y-

-END GEEK CODE BLOCK-



Re: Type system for Perl 6

2010-02-04 Thread Darren Duncan

Darren Duncan wrote:

Giuseppe Castagna wrote:
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?


Ah, spoke too soon.  An electronic copy is linked to from one of the other sites 
you gave, at http://www.pps.jussieu.fr/~gc/selected.en.html ; the PDF version is 
at http://www.pps.jussieu.fr/~gc/papers/toplas95.pdf . -- Darren Duncan