develooper Front page | perl.perl6.language | Postings from September 2005

syntactic, static and dynamic type

From:
Thomas Sandlass
Date:
September 19, 2005 12:47
Subject:
syntactic, static and dynamic type
Message ID:
8B2D97A317E8C9479E35FED99ADC3096CCC8CB@br2mex01.orthogon.com
HaloO,

I'm still trying to understand the concept of context
in Perl6 from a typing perspective. My current interpretation
let me to coin three levels of typing in Perl6: syntactic, static
and dynamic. I guess the latter two are well known but the syntactic
type is new---at least do I hope so. Please inform me about prior art!

Well, in a certain way I've just replaced context with 'syntactic type'
to get two better understood words in there. Here's a little table
summarizing the idea:

type    | syntactical | static     | dynamic
--------+-------------+------------+-----------
        |          compiler        | runtime
handler +-------------+------------+-----------
        | parser      | inferencer | dispatcher

The syntactical type is strongly coupled with the sigils which
serve as some minimal type information and together with whitespace,
comma, semicolon and parens provide the basic tokenization. Again
I'll try to express the concept in a little table:

  meaning     |  sigil    | handler
-------+------+-----------+--------
 arity | type |    ::     | compile
-------+------+-----------+--------
       | code |  &  |  .  |
   1   +------+-----+-----+
       | item |  $  |  :  | runtime
-------+------+-----+-----+
0..Inf | data |  @  |  %  |
-------+------+-----+-----+--------
    access    | pos | key |

The Fantastic Four &$@% can be used to declare variables
while the dotted three :: : . are syntactic markers only.
The rest of the language is operator recognition and special
forms for statements and declaration.

Comments?
-- 
TSa





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About