weissel
- About: Coding, coding, coding ...
Recent Actions
-
Commented on Current subroutine signatures implementation contains two features which purposes are different
If you want the highest execution performance, Perl is usually the wrong choice. Many many comparisons have shown languages like C, C++, Java, Go, compiled Lua, Assembler, etc. to be immensely faster than Perl for some given task. So nobody...
-
Commented on I think subroutine signatures don't need arguments count checking
Hmmm. Yuki, you seem to have a strong opinion here. Not that there is anything wrong with having strong opinions --- but it would be much better if you could at least point to some facts that support your opinion....
Comment Threads
-
Slobo commented on
Current subroutine signatures implementation contains two features which purposes are different
I understand the need for speed, but as benchmark above shows, you are only losing a second for every 10M calls - if you are doing anything remotely noon trivial in those subs you will not notice the time paid for correctness.
Besides, it seems that as per benchmark #5, if you needed to hyper optimize code you would need to avoid destructuring anyways, regardless of argument checking.
Lastly, can you point to any consensus that correctness should take back seat to performance in perl?
Thanks
-
Slobo commented on
Current subroutine signatures implementation contains two features which purposes are different
I'm also genuinely interested in your argument that dynamic language implies no argument checking, do you mind elaborating a bit more on it?
-
Yuki Kimoto commented on
Current subroutine signatures implementation contains two features which purposes are different
Slobo
I don't believe correctness by argument count checking. I don't need this feature.
There are two type people.
Why subroutine signature forces argument count checking by default syntax?
sub ($foo, $bar, @) is not good syntax, I don't want to use this syntax for only avoid argument count checking.
"sub foo($x, $y)" meaning "sub foo { my ($x, $y) = @_ }" is natural expansion most people want.
Argument count checking is next step.
-
Slobo commented on
Current subroutine signatures implementation contains two features which purposes are different
Hi Yuki, thanks for your response.
I am always looking to learn better software engineering techniques. I hope you don't mind me pressing for more details from you. Is it only the performance impact of arg count check that bothers you? Or do you find yourself often wanting to define
sub foo($bar) { ... }
and then use it as
foo( $bar, $baz );
# or maybe
foo( @only_first_matters )I am curious to discover any techniques that revolve around these patterns?
Re: correctness, I can only offer my own experience with a legacy code … -
Yuki Kimoto commented on
Current subroutine signatures implementation contains two features which purposes are different
Slobo
Thanks for your comment.
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.