Let me clarify that Perl does have static typing - it is implied by sigils,>
So you define Perl5's types as being scalar, array, hash and few others.
However instead of type check failures, you get coercions in many places,
No, no coercions occur between any of of those types. There's only coercion if you consider Perl to have dynamic typing (signed integer, unsigned integer, UTF8=0 string, UTF8=1 string, float, regex, IO, etc) in addition to static typing.
The more a compiler knows about a program, the more it can optimize.
Indeed, and Perl5 doesn't have that much information available at compile time. Yeah, you can consider scalar to be a static type, but considering all subs take a list of scalars for argument, it's a rather useless type from the perspective of optimising sub calls.
Talking of static vs dynamic typing sounds a lot like talking about strong vs weak typing.
In reply to Re^2: compiling perl scripts aka why is perl not as fast as C
by ikegami
in thread compiling perl scripts aka why is perl not as fast as C
by punkish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |