Remove no 6 from the todo list
[p5sagit/p5-mst-13.2.git] / pod / perltodo.pod
1 =head1 NAME
2
3 perltodo - Perl TO-DO List
4
5 =head1 DESCRIPTION
6
7 This is a list of wishes for Perl.  Send updates to
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
16 =head1 assertions
17
18 Clean up and finish support for assertions. See L<assertions>.
19
20 =head1 iCOW
21
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.
25
26 =head1 (?{...}) closures in regexps
27
28 Fix (or rewrite) the implementation of the C</(?{...})/> closures.
29
30 =head1 A re-entrant regexp engine
31
32 This will allow the use of a regex from inside (?{ }), (??{ }) and
33 (?(?{ })|) constructs.
34
35 =head1 pragmata
36
37 =head2 lexical pragmas
38
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.
43
44 =head2 use less 'memory'
45
46 Investigate trade offs to switch out perl's choices on memory usage.
47 Particularly perl should be able to give memory back.
48
49 =head1 prototypes and functions
50
51 =head2 _ prototype character
52
53 Study the possibility of adding a new prototype character, C<_>, meaning
54 "this argument defaults to $_".
55
56 =head2 inlining autoloaded constants
57
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.
65
66 =head2 Finish off lvalue functions
67
68 The old perltodo notes "They don't work in the debugger, and they don't work for
69 list or hash slices."
70
71 =head1 Unicode and UTF8
72
73 =head2 Implicit Latin 1 => Unicode translation
74
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).
81
82 =head2 UTF8 caching code
83
84 The string position/offset cache is not optional. It should be.
85
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
113 =head1 Regexps
114
115 =head2 regexp optimiser optional
116
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.
119
120 =head1 POD
121
122 =head2 POD -> HTML conversion still sucks
123
124 Which is crazy given just how simple POD purports to be, and how simple HTML
125 can be. It's not actually I<as> simple as it sounds, particularly with the
126 flexibility POD allows for C<=item>, but it would be good to improve the
127 visual appeal of the HTML generated, and to avoid it having any validation
128 errors. See also L</make HTML install work>, as the layout of installation tree
129 is needed to improve the cross-linking.
130
131 =head1 Misc medium sized projects
132
133 =head2 UNITCHECK
134
135 Introduce a new special block, UNITCHECK, which is run at the end of a
136 compilation unit (module, file, eval(STRING) block). This will correspond to
137 the Perl 6 CHECK. Perl 5's CHECK cannot be changed or removed because the
138 O.pm/B.pm backend framework depends on it.
139
140 =head2 optional optimizer
141
142 Make the peephole optimizer optional.
143
144 =head2 You WANT *how* many
145
146 Currently contexts are void, scalar and list. split has a special mechanism in
147 place to pass in the number of return values wanted. It would be useful to
148 have a general mechanism for this, backwards compatible and little speed hit.
149 This would allow proposals such as short circuiting sort to be implemented
150 as a module on CPAN.
151
152 =head2 lexical aliases
153
154 Allow lexical aliases (maybe via the syntax C<my \$alias = \$foo>.
155
156 =head2 IPv6
157
158 Clean this up. Check everything in core works
159
160 =head2 entersub XS vs Perl
161
162 At the moment pp_entersub is huge, and has code to deal with entering both
163 perl and XS subroutines. Subroutine implementations rarely change between 
164 perl and XS at run time, so investigate using 2 ops to enter subs (one for
165 XS, one for perl) and swap between if a sub is redefined.
166
167 =head2 @INC source filter to Filter::Simple
168
169 The second return value from a sub in @INC can be a source filter. This isn't
170 documented. It should be changed to use Filter::Simple, tested and documented.
171
172 =head2 bincompat functions
173
174 There are lots of functions which are retained for binary compatibility.
175 Clean these up. Move them to mathom.c, and don't compile for blead?
176
177 =head2 Constant folding
178
179 The peephole optimiser should trap errors during constant folding, and give
180 up on the folding, rather than bailing out at compile time.  It is quite
181 possible that the unfoldable constant is in unreachable code, eg something
182 akin to C<$a = 0/0 if 0;>
183
184 =head1 Tests
185
186 =head2 Make Schwern poorer
187
188 Tests for everything, At which point Schwern coughs up $500 to TPF.
189
190 =head2 test B
191
192 A test suite for the B module would be nice.
193
194 =head2 common test code for timed bailout
195
196 Write portable self destruct code for tests to stop them burning CPU in
197 infinite loops. Needs to avoid using alarm, as some of the tests are testing
198 alarm/sleep or timers.
199
200 =head1 Installation
201
202 =head2 compressed man pages
203
204 Be able to install them. This would probably need a configure test to see how
205 the system does compressed man pages (same directory/different directory?
206 same filename/different filename), as well as tweaking the F<installman> script
207 to compress as necessary.
208
209 =head2 Make Config.pm cope with differences between build and installed perl
210
211 Quite often vendors ship a perl binary compiled with their (pay-for)
212 compilers.  People install a free compiler, such as gcc. To work out how to
213 build extensions, Perl interrogates C<%Config>, so in this situation
214 C<%Config> describes compilers that aren't there, and extension building
215 fails. This forces people into chosing between re-compiling perl themselves
216 using the compiler they have, or only using modules that the vendor ships.
217
218 It would be good to find a way teach C<Config.pm> about the installation setup,
219 possibly involving probing at install time or later, so that the C<%Config> in
220 a binary distruction better describes the installed machine, when the installed
221 machine differs from the build machine in some significant way.
222
223 =head2 Relocatable perl
224
225 Make it possible to create a relocatable perl binary. Will need some collusion
226 with Config.pm. We could use a syntax of ... for location of current binary?
227
228 =head2 make HTML install work
229
230 There is an C<installhtml> target in the Makefile. It's marked as
231 "experimental". It would be good to get this tested, make it work reliably, and
232 remove the "experimental" tag. This would include
233
234 =over 4
235
236 =item 1
237
238 Checking that cross linking between various parts of the documentation works.
239 In particular that links work between the modules (files with POD in F<lib/>)
240 and the core documentation (files in F<pod/>)
241
242 =item 2
243
244 Work out how to split perlfunc into chunks, preferably one per function group,
245 preferably with general case code that could be used elsewhere. Challenges
246 here are correctly identifying the groups of functions that go together, and
247 making the right named external cross-links point to the right page. Things to
248 be aware of are C<-X>, groups such as C<getpwnam> to C<endservent>, two or
249 more C<=items> giving the different parameter lists, such as
250
251     =item substr EXPR,OFFSET,LENGTH,REPLACEMENT
252     
253     =item substr EXPR,OFFSET,LENGTH
254     
255     =item substr EXPR,OFFSET
256
257 and different parameter lists having different meanings. (eg C<select>)
258
259 =back
260
261 =head2 put patchlevel in -v
262
263 Currently perl from p4/rsync ships with a patchlevel.h file that usually
264 defines one local patch, of the form "MAINT12345" or "RC1". The output of
265 perl -v doesn't report that a perl isn't an official release, and this
266 information can get lost in bugs reports. Because of this, the minor version
267 isn't bumped up until RC time, to minimise the possibility of versions of perl
268 escaping that believe themselves to be newer than they actually are.
269
270 It would be useful to find an elegant way to have the "this is an interim
271 maintenance release" or "this is a release candidate" in the terse -v output,
272 and have it so that it's easy for the pumpking to remove this just as the
273 release tarball is rolled up. This way the version pulled out of rsync would
274 always say "I'm a development release" and it would be safe to bump the
275 reported minor version as soon as a release ships, which would aid perl
276 developers.
277
278 =head1 Incremental things
279
280 Some tasks that don't need to get done in one big hit.
281
282 =head2 autovivification
283
284 Make all autovivification consistent w.r.t LVALUE/RVALUE and strict/no strict;
285
286 =head2 fix tainting bugs
287
288 Fix the bugs revealed by running the test suite with the C<-t> switch (via
289 C<make test.taintwarn>).
290
291 =head2 Make tainting consistent
292
293 Tainting would be easier to use if it didn't take documented shortcuts and allow
294 taint to "leak" everywhere within an expression.
295
296 =head2 Dual life everything
297
298 As part of the "dists" plan, anything that doesn't belong in the smallest perl
299 distribution needs to be dual lifed. Anything else can be too.
300
301 =head1 Vague things
302
303 Some more nebulous ideas
304
305 =head2 threads
306
307 =over 4
308
309 =item *
310
311 Re-implement C<:unique> in a way that is actually thread-safe
312
313 =item *
314
315 Make C<threads::shared> share aggregates properly
316
317 (these two may actually share approach, if not implementation
318
319 =back
320
321 Generally make threads more robust. See also L<iCOW>
322
323 =head2 POSIX memory footprint
324
325 Ilya observed that use POSIX; eats memory like there's no tomorrow, and at
326 various times worked to cut it down. There is probably still fat to cut out -
327 for example POSIX passes Exporter some very memory hungry data structures.
328
329 =head2 Optimize away @_
330
331 The old perltodo notes "Look at the "reification" code in C<av.c>".
332
333 =head2 switch ops
334
335 The old perltodo notes "Although we have C<Switch.pm> in core, Larry points to
336 the dormant C<nswitch> and C<cswitch> ops in F<pp.c>; using these opcodes would
337 be much faster."
338
339 =head2 Attach/detach debugger from running program
340
341 The old perltodo notes "With C<gdb>, you can attach the debugger to a running
342 program if you pass the process ID. It would be good to do this with the Perl
343 debugger on a running Perl program, although I'm not sure how it would be done."
344 ssh and screen do this with named pipes in tmp. Maybe we can too.
345
346 =head2 A decent benchmark
347
348 perlbench seems impervious to any recent changes made to the perl core. It would
349 be useful to have a reasonable general benchmarking suite that roughly
350 represented what current perl programs do, and measurably reported whether
351 tweaks to the core improve, degrade or don't really affect performance, to
352 guide people attempting to optimise the guts of perl.
353
354 =head2 readpipe(LIST)
355
356 system() accepts a LIST syntax (and a PROGRAM LIST syntax) to avoid
357 running a shell. readpipe() (the function behind qx//) could be similarly
358 extended.
359
360 =head2 Self ties
361
362 self ties are currently illegal because they caused too many segfaults. Maybe
363 the causes of these could be tracked down and self-ties on all types re-
364 instated.