|There's more than one way to do things|
Perl 6: Static/Dynamic Strong/Weak Type Systemsby tomazos (Deacon)
|on Apr 15, 2006 at 22:06 UTC||Need Help??|
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?