Commit | Line | Data |
---|---|---|
7711098a GS |
1 | =head1 NAME |
2 | ||
3 | perltodo - Perl TO-DO List | |
4 | ||
5 | =head1 DESCRIPTION | |
e50bb9a1 | 6 | |
722d2a37 | 7 | This is a list of wishes for Perl. Send updates to |
e50bb9a1 GS |
8 | I<perl5-porters@perl.org>. If you want to work on any of these |
9 | projects, be sure to check the perl5-porters archives for past ideas, | |
10 | flames, and propaganda. This will save you time and also prevent you | |
11 | from implementing something that Larry has already vetoed. One set | |
12 | of archives may be found at: | |
13 | ||
14 | http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/ | |
15 | ||
cd793d32 | 16 | =head1 assertions |
e50bb9a1 | 17 | |
cd793d32 | 18 | Clean up and finish support for assertions. See L<assertions>. |
e50bb9a1 | 19 | |
cd793d32 | 20 | =head1 iCOW |
e50bb9a1 | 21 | |
cd793d32 NC |
22 | Sarathy and Arthur have a proposal for an improved Copy On Write which |
23 | specifically will be able to COW new ithreads. If this can be implemented | |
24 | it would be a good thing. | |
e50bb9a1 | 25 | |
cd793d32 | 26 | =head1 (?{...}) closures in regexps |
4b3b956a | 27 | |
cd793d32 | 28 | Fix (or rewrite) the implementation of the C</(?{...})/> closures. |
4b3b956a | 29 | |
cee7ab84 NC |
30 | =head1 A re-entrant regexp engine |
31 | ||
32 | This will allow the use of a regex from inside (?{ }), (??{ }) and | |
33 | (?(?{ })|) constructs. | |
34 | ||
cd793d32 | 35 | =head1 pragmata |
e50bb9a1 | 36 | |
cd793d32 | 37 | =head2 lexical pragmas |
0562c0e3 | 38 | |
cd793d32 NC |
39 | Reimplement the mechanism of lexical pragmas to be more extensible. Fix |
40 | current pragmas that don't work well (or at all) with lexical scopes or in | |
41 | run-time eval(STRING) (C<sort>, C<re>, C<encoding> for example). MJD has a | |
42 | preliminary patch that implements this. | |
0562c0e3 | 43 | |
cd793d32 | 44 | =head2 use less 'memory' |
f35392ae | 45 | |
cd793d32 NC |
46 | Investigate trade offs to switch out perl's choices on memory usage. |
47 | Particularly perl should be able to give memory back. | |
f35392ae | 48 | |
cd793d32 | 49 | =head1 prototypes and functions |
c5fc23ff | 50 | |
cd793d32 | 51 | =head2 _ prototype character |
e50bb9a1 | 52 | |
cd793d32 NC |
53 | Study the possibility of adding a new prototype character, C<_>, meaning |
54 | "this argument defaults to $_". | |
e50bb9a1 | 55 | |
cd793d32 | 56 | =head2 inlining autoloaded constants |
776f8809 | 57 | |
cd793d32 NC |
58 | Currently the optimiser can inline constants when expressed as subroutines |
59 | with prototype ($) that return a constant. Likewise, many packages wrapping | |
60 | C libraries export lots of constants as subroutines which are AUTOLOADed on | |
61 | demand. However, these have no prototypes, so can't be seen as constants by | |
62 | the optimiser. Some way of cheaply (low syntax, low memory overhead) to the | |
63 | perl compiler that a name is a constant would be great, so that it knows to | |
64 | call the AUTOLOAD routine at compile time, and then inline the constant. | |
776f8809 | 65 | |
cd793d32 | 66 | =head2 Finish off lvalue functions |
e50bb9a1 | 67 | |
cd793d32 NC |
68 | The old perltodo notes "They don't work in the debugger, and they don't work for |
69 | list or hash slices." | |
e50bb9a1 | 70 | |
cd793d32 | 71 | =head1 Unicode and UTF8 |
e50bb9a1 | 72 | |
cd793d32 | 73 | =head2 Implicit Latin 1 => Unicode translation |
e50bb9a1 | 74 | |
cd793d32 NC |
75 | Conversions from byte strings to UTF-8 currently map high bit characters |
76 | to Unicode without translation (or, depending on how you look at it, by | |
77 | implicitly assuming that the byte strings are in Latin-1). As perl assumes | |
78 | the C locale by default, upgrading a string to UTF-8 may change the | |
79 | meaning of its contents regarding character classes, case mapping, etc. | |
80 | This should probably emit a warning (at least). | |
e50bb9a1 | 81 | |
cd793d32 | 82 | =head2 UTF8 caching code |
e50bb9a1 | 83 | |
cd793d32 | 84 | The string position/offset cache is not optional. It should be. |
e50bb9a1 | 85 | |
938c8732 NC |
86 | =head2 Unicode in Filenames |
87 | ||
88 | chdir, chmod, chown, chroot, exec, glob, link, lstat, mkdir, open, | |
89 | opendir, qx, readdir, readlink, rename, rmdir, stat, symlink, sysopen, | |
90 | system, truncate, unlink, utime, -X. All these could potentially accept | |
91 | Unicode filenames either as input or output (and in the case of system | |
92 | and qx Unicode in general, as input or output to/from the shell). | |
93 | Whether a filesystem - an operating system pair understands Unicode in | |
94 | filenames varies. | |
95 | ||
96 | Known combinations that have some level of understanding include | |
97 | Microsoft NTFS, Apple HFS+ (In Mac OS 9 and X) and Apple UFS (in Mac | |
98 | OS X), NFS v4 is rumored to be Unicode, and of course Plan 9. How to | |
99 | create Unicode filenames, what forms of Unicode are accepted and used | |
100 | (UCS-2, UTF-16, UTF-8), what (if any) is the normalization form used, | |
101 | and so on, varies. Finding the right level of interfacing to Perl | |
102 | requires some thought. Remember that an OS does not implicate a | |
103 | filesystem. | |
104 | ||
105 | (The Windows -C command flag "wide API support" has been at least | |
106 | temporarily retired in 5.8.1, and the -C has been repurposed, see | |
107 | L<perlrun>.) | |
108 | ||
109 | =head2 Unicode in %ENV | |
110 | ||
111 | Currently the %ENV entries are always byte strings. | |
112 | ||
cd793d32 | 113 | =head1 Regexps |
e50bb9a1 | 114 | |
cd793d32 | 115 | =head2 regexp optimiser optional |
e50bb9a1 | 116 | |
cd793d32 NC |
117 | The regexp optimiser is not optional. It should configurable to be, to allow |
118 | its performance to be measured, and its bugs to be easily demonstrated. | |
e50bb9a1 | 119 | |
938c8732 | 120 | =head2 common suffices/prefices in regexps (trie optimization) |
c47ff5f1 | 121 | |
722d2a37 SC |
122 | Currently, the user has to optimize C<foo|far> and C<foo|goo> into |
123 | C<f(?:oo|ar)> and C<[fg]oo> by hand; this could be done automatically. | |
e50bb9a1 | 124 | |
cd793d32 | 125 | =head1 POD |
e50bb9a1 | 126 | |
cd793d32 | 127 | =head2 POD -> HTML conversion still sucks |
e50bb9a1 | 128 | |
938c8732 NC |
129 | Which is crazy given just how simple POD purports to be, and how simple HTML |
130 | can be. | |
131 | ||
cd793d32 | 132 | =head1 Misc medium sized projects |
e50bb9a1 | 133 | |
cd793d32 | 134 | =head2 UNITCHECK |
e50bb9a1 | 135 | |
cd793d32 NC |
136 | Introduce a new special block, UNITCHECK, which is run at the end of a |
137 | compilation unit (module, file, eval(STRING) block). This will correspond to | |
138 | the Perl 6 CHECK. Perl 5's CHECK cannot be changed or removed because the | |
139 | O.pm/B.pm backend framework depends on it. | |
e50bb9a1 | 140 | |
cd793d32 | 141 | =head2 optional optimizer |
e50bb9a1 | 142 | |
cd793d32 | 143 | Make the peephole optimizer optional. |
e50bb9a1 | 144 | |
0c13e809 NC |
145 | =head2 You WANT *how* many |
146 | ||
60cb11a8 | 147 | Currently contexts are void, scalar and list. split has a special mechanism in |
0c13e809 NC |
148 | place to pass in the number of return values wanted. It would be useful to |
149 | have a general mechanism for this, backwards compatible and little speed hit. | |
150 | This would allow proposals such as short circuiting sort to be implemented | |
151 | as a module on CPAN. | |
152 | ||
cd793d32 | 153 | =head2 lexical aliases |
e50bb9a1 | 154 | |
cd793d32 | 155 | Allow lexical aliases (maybe via the syntax C<my \$alias = \$foo>. |
e50bb9a1 | 156 | |
cd793d32 | 157 | =head2 no 6 |
e50bb9a1 | 158 | |
cd793d32 | 159 | Make C<no 6> and C<no v6> work (opposite of C<use 5.005>, etc.). |
e50bb9a1 | 160 | |
cd793d32 | 161 | =head2 IPv6 |
3958b146 | 162 | |
cd793d32 | 163 | Clean this up. Check everything in core works |
e50bb9a1 | 164 | |
cd793d32 | 165 | =head2 entersub XS vs Perl |
e50bb9a1 | 166 | |
cd793d32 NC |
167 | At the moment pp_entersub is huge, and has code to deal with entering both |
168 | perl and and XS subroutines. Subroutine implementations rarely change between | |
169 | perl and XS at run time, so investigate using 2 ops to enter subs (one for | |
170 | XS, one for perl) and swap between if a sub is redefined. | |
e50bb9a1 | 171 | |
cd793d32 | 172 | =head2 @INC source filter to Filter::Simple |
e50bb9a1 | 173 | |
cd793d32 NC |
174 | The second return value from a sub in @INC can be a source filter. This isn't |
175 | documented. It should be changed to use Filter::Simple, tested and documented. | |
e50bb9a1 | 176 | |
cd793d32 | 177 | =head2 bincompat functions |
e50bb9a1 | 178 | |
cd793d32 NC |
179 | There are lots of functions which are retained for binary compatibility. |
180 | Clean these up. Move them to mathom.c, and don't compile for blead? | |
e50bb9a1 | 181 | |
722d2a37 | 182 | =head2 Use fchown/fchmod internally |
e50bb9a1 | 183 | |
cd793d32 NC |
184 | The old perltodo notes "This has been done in places, but needs a thorough |
185 | code review. Also fchdir is available in some platforms." | |
e50bb9a1 | 186 | |
6168cf99 NC |
187 | =head2 Constant folding |
188 | ||
189 | The peephole optimiser should trap errors during constant folding, and give | |
190 | up on the folding, rather than bailing out at compile time. It is quite | |
191 | possible that the unfoldable constant is in unreachable code, eg something | |
192 | akin to C<$a = 0/0 if 0;> | |
193 | ||
cd793d32 | 194 | =head1 Tests |
e50bb9a1 | 195 | |
cd793d32 | 196 | =head2 Make Schwern poorer |
e50bb9a1 | 197 | |
cd793d32 | 198 | Tests for everything, At which point Schwern coughs up $500 to TPF. |
e50bb9a1 | 199 | |
cd793d32 | 200 | =head2 test B |
722d2a37 | 201 | |
cd793d32 | 202 | A test suite for the B module would be nice. |
722d2a37 | 203 | |
cd793d32 | 204 | =head2 common test code for timed bailout |
e50bb9a1 | 205 | |
cd793d32 NC |
206 | Write portable self destruct code for tests to stop them burning CPU in |
207 | infinite loops. Needs to avoid using alarm, as some of the tests are testing | |
208 | alarm/sleep or timers. | |
e50bb9a1 | 209 | |
cd793d32 | 210 | =head1 Installation |
e50bb9a1 | 211 | |
cd793d32 | 212 | =head2 compressed man pages |
e50bb9a1 | 213 | |
cd793d32 | 214 | Be able to install them |
e50bb9a1 | 215 | |
cd793d32 | 216 | =head2 Make Config.pm cope with differences between build and installed perl |
e50bb9a1 | 217 | |
cd793d32 | 218 | =head2 Relocatable perl |
e50bb9a1 | 219 | |
cd793d32 NC |
220 | Make it possible to create a relocatable perl binary. Will need some collusion |
221 | with Config.pm. We could use a syntax of ... for location of current binary? | |
e50bb9a1 | 222 | |
cd793d32 | 223 | =head2 make HTML install work |
e50bb9a1 | 224 | |
89007cb3 NC |
225 | =head2 put patchlevel in -v |
226 | ||
227 | Currently perl from p4/rsync ships with a patchlevel.h file that usually | |
228 | defines one local patch, of the form "MAINT12345" or "RC1". The output of | |
229 | perl -v doesn't report that a perl isn't an official release, and this | |
230 | information can get lost in bugs reports. Because of this, the minor version | |
fa11829f | 231 | isn't bumped up until RC time, to minimise the possibility of versions of perl |
89007cb3 NC |
232 | escaping that believe themselves to be newer than they actually are. |
233 | ||
234 | It would be useful to find an elegant way to have the "this is an interim | |
235 | maintenance release" or "this is a release candidate" in the terse -v output, | |
236 | and have it so that it's easy for the pumpking to remove this just as the | |
237 | release tarball is rolled up. This way the version pulled out of rsync would | |
238 | always say "I'm a development release" and it would be safe to bump the | |
239 | reported minor version as soon as a release ships, which would aid perl | |
240 | developers. | |
241 | ||
cd793d32 | 242 | =head1 Incremental things |
e50bb9a1 | 243 | |
cd793d32 | 244 | Some tasks that don't need to get done in one big hit. |
e50bb9a1 | 245 | |
cd793d32 | 246 | =head2 autovivification |
e50bb9a1 | 247 | |
cd793d32 | 248 | Make all autovivification consistent w.r.t LVALUE/RVALUE and strict/no strict; |
e50bb9a1 | 249 | |
cd793d32 | 250 | =head2 fix tainting bugs |
e50bb9a1 | 251 | |
cd793d32 NC |
252 | Fix the bugs revealed by running the test suite with the C<-t> switch (via |
253 | C<make test.taintwarn>). | |
e50bb9a1 | 254 | |
cd793d32 | 255 | =head2 Make tainting consistent |
e50bb9a1 | 256 | |
cd793d32 NC |
257 | Tainting would be easier to use if it didn't take documented shortcuts and allow |
258 | taint to "leak" everywhere within an expression. | |
e50bb9a1 | 259 | |
969e704b NC |
260 | =head2 Dual life everything |
261 | ||
262 | As part of the "dists" plan, anything that doesn't belong in the smallest perl | |
263 | distribution needs to be dual lifed. Anything else can be too. | |
264 | ||
cd793d32 | 265 | =head1 Vague things |
e50bb9a1 | 266 | |
cd793d32 | 267 | Some more nebulous ideas |
e50bb9a1 | 268 | |
cd793d32 | 269 | =head2 threads |
e50bb9a1 | 270 | |
cd793d32 | 271 | Make threads more robust. |
e50bb9a1 | 272 | |
cd793d32 | 273 | =head2 POSIX memory footprint |
e50bb9a1 | 274 | |
cd793d32 NC |
275 | Ilya observed that use POSIX; eats memory like there's no tomorrow, and at |
276 | various times worked to cut it down. There is probably still fat to cut out - | |
277 | for example POSIX passes Exporter some very memory hungry data structures. | |
e50bb9a1 | 278 | |
cd793d32 | 279 | =head2 Optimize away @_ |
f86a8bc5 | 280 | |
80b46460 | 281 | The old perltodo notes "Look at the "reification" code in C<av.c>". |
3298bd4d | 282 | |
cd793d32 | 283 | =head2 switch ops |
3298bd4d | 284 | |
cd793d32 NC |
285 | The old perltodo notes "Although we have C<Switch.pm> in core, Larry points to |
286 | the dormant C<nswitch> and C<cswitch> ops in F<pp.c>; using these opcodes would | |
287 | be much faster." | |
0562c0e3 | 288 | |
d10fc472 | 289 | =head2 Attach/detach debugger from running program |
1626a787 | 290 | |
cd793d32 NC |
291 | The old perltodo notes "With C<gdb>, you can attach the debugger to a running |
292 | program if you pass the process ID. It would be good to do this with the Perl | |
293 | debugger on a running Perl program, although I'm not sure how it would be done." | |
294 | ssh and screen do this with named pipes in tmp. Maybe we can too. | |
1626a787 | 295 | |
d10fc472 NC |
296 | =head2 A decent benchmark |
297 | ||
298 | perlbench seems impervious to any recent changes made to the perl core. It would | |
299 | be useful to have a reasonable general benchmarking suite that roughly | |
300 | represented what current perl programs do, and measurably reported whether | |
301 | tweaks to the core improve, degrade or don't really affect performance, to | |
302 | guide people attempting to optimise the guts of perl. | |
80b46460 RGS |
303 | |
304 | =head2 readpipe(LIST) | |
305 | ||
306 | system() accepts a LIST syntax (and a PROGRAM LIST syntax) to avoid | |
307 | running a shell. readpipe() (the function behind qx//) could be similarly | |
308 | extended. | |
2810d901 NC |
309 | |
310 | =head2 Self ties | |
311 | ||
312 | self ties are currently illegal because they caused too many segfaults. Maybe | |
313 | the causes of these could be tracked down and self-ties on all types re- | |
314 | instated. |