in reply to Re: compiling perl scripts aka why is perl not as fast as C
in thread compiling perl scripts aka why is perl not as fast as C
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: compiling perl scripts aka why is perl not as fast as C
by moritz (Cardinal) on Mar 22, 2010 at 09:56 UTC | |
by ikegami (Patriarch) on Mar 22, 2010 at 17:10 UTC | |
by moritz (Cardinal) on Mar 22, 2010 at 17:26 UTC | |
by ikegami (Patriarch) on Mar 22, 2010 at 17:39 UTC | |
by moritz (Cardinal) on Mar 22, 2010 at 17:57 UTC | |
| |
by Hue-Bond (Priest) on Mar 22, 2010 at 17:50 UTC | |
by ikegami (Patriarch) on Mar 22, 2010 at 17:56 UTC | |
by ikegami (Patriarch) on Mar 22, 2010 at 18:38 UTC |