I was having a fierce debate with a Python pureist at work over the benefits of static typing in large projects. Shortly following, I actually did some research on the topic (so I sound like I know what I am talking about now).

As far as I can tell Strong/Weak typing is about whether you can change at run-time how the compiler/interpreter treats a certain piece of memory. For example by Type-Casting Pointers. C and C++ are Weakly Typed. Perl 5, Python, Ruby and Java are Strongly Typed. C# is Strongly Typed, except in an "unsafe" block, where it is Weakly Typed.

Static/Dynamic typing is about whether or not you can determine the type of a variable without running it. ie At Compile-time. Perl 5, Python, Ruby are Dynamically Typed. C, C++, Java and C# are Statically Typed.

What caught my eye reading about it on Wikipedia...

- Perl 6 was the only language classified as Hybridly Typed when it comes to Staticness.

- Perl 6 is classified as Strongly Typed, whereas Perl 5 is classified as Weakly Typed. Is that a mistake? I thought Perl 5 was Strongly Typed. In what way is it Weakly Typed?

Also what does Hybridly Typed mean? It sounds cool. What features of Perl 6 make it Hybridly Typed? Are there Perl 5 modules of back-ported Perl 6 features that could give Perl 5 this magic Hybridness too?

-Andrew.


In reply to Perl 6: Static/Dynamic Strong/Weak Type Systems by tomazos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.