develooper Front page | perl.perl5.porters | Postings from July 2020

Re: Types in Cor (and Perl)

Thread Previous | Thread Next
Paul "LeoNerd" Evans
July 13, 2020 16:12
Re: Types in Cor (and Perl)
Message ID:
Hi Ovid,

First, thanks for giving this what is evidently a lot of thought.

I'm currently busy trying to keep things moving on several fronts
(`LEAVE`, `try/catch`, firstclass exceptions, dumbmatch aka "a better
switch", as well as the ongoing Perl 7 thoughts), but I thought I'd
write a brief holding note.

I agree that signatures, variables, object slots, etc.. all want to use
a single unified idea. What that idea is yet, I don't know. But they
need it. I intend to come back and give it a good amount of thought and
experimentation at some point soon because it will overlap with several
things later down my queue. I'll be sure to come back and see what
research and ideas you have conducted when I do.

The way I see it, there's three different reasons to want "types". I'm
not saying that any reason is more valid than the others, but there are
three distinct (and maybe-overlapping) reasons, and any further
discussion on what a "type system" is needs first to consider why you
want that in the first place:

 1) I want my compiler to tell me I have written a program that can
    never work (aka. the static typing on variables/functions/etc..)

 2) I want my runtime to tell me I am operating on the wrong data (aka
    the runtime arguments/return type assertions)

 3) I want my runtime to perform faster because I have restricted what
    operations it might be expected to do (e.g. consider `use integer`).

Different people who ask for "types" are often asking for different
ones. It helps to be clear what type of type people are after because
only then can you begin to design a system that would cover their

Paul "LeoNerd" Evans      |  |

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About