This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Propagating const outwards from Perl_moreswitches() is to be done.
[perl5.git] / pod / perltodo.pod
index 925c157..ac349b5 100644 (file)
@@ -20,17 +20,16 @@ not, but if your patch is incorporated, then we'll add your name to the
 F<AUTHORS> file, which ships in the official distribution. How many other
 programming languages offer you 1 line of immortality?
 
-=head1 The roadmap to 5.10
-
-The roadmap to 5.10 envisages feature based releases, as various items in this
-TODO are completed.
+=head1 Tasks that only need Perl knowledge
 
-=head2 Needed for the final 5.10.0 release
+=head2 merge common code in installperl and installman
 
-Review perlguts. Significant changes have occured since 5.8, and we can't
-release a new version without making sure these are covered.
-
-=head1 Tasks that only need Perl knowledge
+There are some common subroutines and a common C<BEGIN> block in F<installperl>
+and F<installman>. These should probably be merged. It would also be good to
+check for duplication in all the utility scripts supplied in the source
+tarball. It might be good to move them all to a subdirectory, but this would
+require careful checking to find all places that call them, and change those
+correctly.
 
 =head2 common test code for timed bail out
 
@@ -50,6 +49,13 @@ is needed to improve the cross-linking.
 The addition of C<Pod::Simple> and its related modules may make this task
 easier to complete.
 
+=head2 merge checkpods and podchecker
+
+F<pod/checkpods.PL> (and C<make check> in the F<pod/> subdirectory)
+implements a very basic check for pod files, but the errors it discovers
+aren't found by podchecker. Add this check to podchecker, get rid of
+checkpods and have C<make check> use podchecker.
+
 =head2 Parallel testing
 
 (This probably impacts much more than the core: also the Test::Harness
@@ -97,6 +103,28 @@ tests that are currently missing.
 
 A full test suite for the B module would be nice.
 
+=head2 Deparse inlined constants
+
+Code such as this
+
+    use constant PI => 4;
+    warn PI
+
+will currently deparse as
+
+    use constant ('PI', 4);
+    warn 4;
+
+because the tokenizer inlines the value of the constant subroutine C<PI>.
+This allows various compile time optimisations, such as constant folding
+and dead code elimination. Where these haven't happened (such as the example
+above) it ought be possible to make B::Deparse work out the name of the
+original constant, because just enough information survives in the symbol
+table to do this. Specifically, the same scalar is used for the constant in
+the optree as is used for the constant subroutine, so by iterating over all
+symbol tables and generating a mapping of SV address to constant name, it
+would be possible to provide B::Deparse with this functionality.
+
 =head2 A decent benchmark
 
 C<perlbench> seems impervious to any recent changes made to the perl core. It
@@ -118,6 +146,9 @@ distribution needs to be dual lifed. Anything else can be too. Figure out what
 changes would be needed to package that module and its tests up for CPAN, and
 do so. Test it with older perl releases, and fix the problems you find.
 
+To make a minimal perl distribution, it's useful to look at
+F<t/lib/commonsense.t>.
+
 =head2 Improving C<threads::shared>
 
 Investigate whether C<threads::shared> could share aggregates properly with
@@ -312,11 +343,31 @@ cross-compilation/execution environments the HOST and the TARGET do
 not see the same filesystem(s), the $Config{run} may need to do some
 file/directory copying back and forth.
 
+=head2 roffitall
+
+Make F<pod/roffitall> be updated by F<pod/buildtoc>.
+
 =head1 Tasks that need a little C knowledge
 
 These tasks would need a little C knowledge, but don't need any specific
 background or experience with XS, or how the Perl interpreter works
 
+=head2 Modernize the order of directories in @INC
+
+The way @INC is laid out by default, one cannot upgrade core (dual-life)
+modules without overwriting files. This causes problems for binary
+package builders.  One possible proposal is laid out in this
+message:
+L<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-04/msg02380.html>.
+
+=head2 -Duse32bit*
+
+Natively 64-bit systems need neither -Duse64bitint nor -Duse64bitall.
+On these systems, it might be the default compilation mode, and there
+is currently no guarantee that passing no use64bitall option to the
+Configure process will build a 32bit perl. Implementing -Duse32bit*
+options would be nice for perl 5.12.
+
 =head2 Make it clear from -v if this is the exact official release
 
 Currently perl from C<p4>/C<rsync> ships with a F<patchlevel.h> file that
@@ -365,6 +416,11 @@ custom allocates so it would both use less memory and less CPU to allocate
 the various OP structures from arenas. The SV arena code can probably be
 re-used for this.
 
+Note that Configuring perl with C<-Accflags=-DPL_OP_SLAB_ALLOC> will use
+Perl_Slab_alloc() to pack optrees into a contiguous block, which is
+probably superior to the use of OP arenas, esp. from a cache locality
+standpoint.  See L<Profile Perl - am I hot or not?>.
+
 =head2 Improve win32/wince.c
 
 Currently, numerous functions look virtually, if not completely,
@@ -390,10 +446,17 @@ warning suppressant and actually make use of the new secure CRT functions.
 
 There is also a similar issue with POSIX CRT function names like fileno having
 been deprecated in favour of ISO C++ conformant names like _fileno. These
-warnings are also currently suppressed with the compiler option /wd4996. It
+warnings are also currently suppressed by adding -D_CRT_NONSTDC_NO_DEPRECATE. It
 might be nice to do as Microsoft suggest here too, although, unlike the secure
 functions issue, there is presumably little or no benefit in this case.
 
+=head2 __FUNCTION__ for MSVC-pre-7.0
+
+Jarkko notes that one can things morally equivalent to C<__FUNCTION__>
+(or C<__func__>) even in MSVC-pre-7.0, contrary to popular belief.
+See L<http://www.codeproject.com/debug/extendedtrace.asp> if you feel like
+making C<PERL_MEM_LOG> more useful on Win32.
+
 =head1 Tasks that need a knowledge of XS
 
 These tasks would need C knowledge, and roughly the level of knowledge of
@@ -442,6 +505,12 @@ See L</"Virtualize operating system access">.
 Currently glob patterns and filenames returned from File::Glob::glob()
 are always byte strings.  See L</"Virtualize operating system access">.
 
+=head2 Unicode and lc/uc operators
+
+Some built-in operators (C<lc>, C<uc>, etc.) behave differently, based on
+what the internal encoding of their argument is. That should not be the
+case. Maybe add a pragma to switch behaviour.
+
 =head2 use less 'memory'
 
 Investigate trade offs to switch out perl's choices on memory usage.
@@ -521,17 +590,49 @@ only the interpretation of non-ASCII characters, and not for the script file
 handle. To make it work needs some investigation of the ordering of function
 calls during startup, and (by implication) a bit of tweaking of that order.
 
+=head2 Propagate const outwards from Perl_moreswitches()
+
+Change 32057 changed the parameter and return value of C<Perl_moreswitches()>
+from <char *> to <const char *>. It should now be possible to propagate
+const-correctness outwards to C<S_parse_body()>, C<Perl_moreswitches()>
+and C<Perl_yylex()>.
+
 
 =head1 Tasks that need a knowledge of the interpreter
 
 These tasks would need C knowledge, and knowledge of how the interpreter works,
 or a willingness to learn.
 
+=head2 state variable initialization in list context
+
+Currently this is illegal:
+
+    state ($a, $b) = foo(); 
+
+The current Perl 6 design is that C<state ($a) = foo();> and
+C<(state $a) = foo();> have different semantics, which is tricky to implement
+in Perl 5 as currently the produce the same opcode trees. It would be useful
+to clarify that the Perl 6 design is firm, and then implement the necessary
+code in Perl 5. There are comments in C<Perl_newASSIGNOP()> that show the
+code paths taken by various assignment constructions involving state variables.
+
 =head2 Implement $value ~~ 0 .. $range
 
 It would be nice to extend the syntax of the C<~~> operator to also
 understand numeric (and maybe alphanumeric) ranges.
 
+=head2 A does() built-in
+
+Like ref(), only useful. It would call the C<DOES> method on objects; it
+would also tell whether something can be dereferenced as an
+array/hash/etc., or used as a regexp, etc.
+L<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-03/msg00481.html>
+
+=head2 Tied filehandles and write() don't mix
+
+There is no method on tied filehandles to allow them to be called back by
+formats.
+
 =head2 Attach/detach debugger from running program
 
 The old perltodo notes "With C<gdb>, you can attach the debugger to a running
@@ -539,6 +640,12 @@ program if you pass the process ID. It would be good to do this with the Perl
 debugger on a running Perl program, although I'm not sure how it would be
 done." ssh and screen do this with named pipes in /tmp. Maybe we can too.
 
+=head2 Optimize away empty destructors
+
+Defining an empty DESTROY method might be useful (notably in
+AUTOLOAD-enabled classes), but it's still a bit expensive to call. That
+could probably be optimized.
+
 =head2 LVALUE functions for lists
 
 The old perltodo notes that lvalue functions don't work for list or hash
@@ -658,6 +765,12 @@ implement per-thread working directories: Win32 already does this.
 
 See also L</"Extend PerlIO and PerlIO::Scalar">.
 
+=head2 Investigate PADTMP hash pessimisation
+
+The peephole optimier converts constants used for hash key lookups to shared
+hash key scalars. Under ithreads, something is undoing this work. See
+See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-09/msg00793.html
+
 =head1 Big projects
 
 Tasks that will get your name mentioned in the description of the "Highlights