RFC 304 (v1) C<sort> algorithm to be selectable at compile time
[email protected] (Perl6 RFC Librarian) 25 Sep 2000 20:14:25 -0000
| Newsgroups | perl.perl6.announce.rfc,perl.perl6.internals |
|---|---|
| Message-ID | <[email protected]> |
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE C<sort> algorithm to be selectable at compile time =head1 VERSION Maintainer: Simon Cozens <[email protected]> Date: 25 Sep 2000 Mailing List: [email protected] Number: 304 Version: 1 Status: Developing =head1 ABSTRACT Quicksort and mergesort both have their uses. Let the user choose which Perl uses. =head1 DESCRIPTION While this RFC is ostensibly to allow the user to say something like this: { use sort 'quick'; @array2 = sort @array; } use sort 'merge'; ... the real benefit comes when the code is being compiled into a standalone executable; given sufficient magic, the compiler can analyze the expected data flow and guess what the most suitable sort algorithm should be for each instance of C<sort>. =head1 IMPLEMENTATION Provide multiple sort algorithms, and have a pragma select which Perl uses; when a program is being compiled, analyze the data and heuristically select the better algorithm if possible. =head1 REFERENCES None.