The more platforms we have, the more likely we are to find portability problems. Parrot has to be the most portable thing we've created.
More platforms also means more compilers. Maybe your DEC compiler is more picky than gcc, and spews more warnings. Good! More opportunities for cleaning!
Use as many compiler warnings as we possibly can. The more warnings we enable, the less likely something will pass the watchful eye of the compiler.
Note that warnings may not just be -W flags. Some warnings in gcc only show up when optimization is enabled.
Splint (http://www.splint.org) is a very very picky lint tool, and setup and configuration is a pain. Andy has tried to get Perl 5 running under it nicely, but has met with limited success. Maybe the Parrot will be nicer.
Create a make target for splint.
Make splint run against all the *.c files.
Make a reasonable set of rules for splint.
splint spews many many errors by default. Take a look at the Makefile that perl5 has for the start of some rules that Andy worked on for the perl5 code.
Sun has made its dev tools freely available at http://developers.sun.com/prodtech/cc/. Its lint is the best one out there, except from Gimpel's FlexeLint (http://www.gimpel.com/html/flex.htm) which costs many dollars.
Create a make target for lint.
Make lint run against all the *.c files.
Make a reasonable set of rules for lint.
Andy has a pretty decent set of rules for perl5's code in that project's Makefile. Take a look at those for a start.
Automatic standards checking
The docs in filename here explains what our code should look like. Write something that automatically validates it in a .t file.
const checking
const
Declaring variables as const wherever possible lets the compiler do lots of checking that wouldn't normally be possible. Walk the source code adding the const qualifier wherever possible. The biggest bang is always in passing pointers into functions.
const explaining
The description above is pretty sparse. A good description of const and its benefit would be helpful for newcomers.
PMD (http://pmd.sourceforge.net/) has been used on C code, even though it's a Java tool. It looks for repeated strings of tokens that are candidates for either functions or macros.
Perl5 has a lot of good source management techniques that we can use.
Standardizing on "interp"
Standarizing on "interp" or maybe even "intr" as the interpreter variable, for brevity & consistency
Macro for interp argument
A macro for declaring the interpreter argument, and maybe a macro for passing it
BTW, our Perl experience teaches us that somebody is going to want to make the interpreter a C++ object for Windows environments, and it wouldn't hurt to make that possible, or at least work in that direction, as long as clarity doesn't suffer.
Redo CONTEXT(interp->ctx)->foo
Eliminating the CONTEXT(interp->ctx)->foo usage in favor of the much simpler interp->ctx->foo, or similar simplification.
CONTEXT(interp->ctx)->foo
interp->ctx->foo
Parrot_xxx macros
Automated processing that would make a macro to let us write
somefunc(interp,a,b,c)
while the linkage is
Parrot_somefunc(interp,a,b,c)
for namespace cleanup. This is straight out of embed.fnc and proto.h in Perl5.
This has started significantly with the headerizer.pl program. Right now, it extracts the function headers correctly, but now I have to have it create the .h files.
Fix symbol table namespace pollution
Extern functions and variables must have names that begin with Parrot .
Parrot
Fix non-symbol-table namespace pollution in public headers
Public headers are the ones in include/parrot directory. These are included by embedders and extenders. They must not declare or define any symbol that isn't clearly Parrot-specific. Prefixing symbols with Parrot or PARROT is the easiest & safest way, but it can lead to a lot of verbosity, so Chip is willing to entertain exceptions or new conventions.
include/parrot
PARROT
It's OK for public headers might have non-public parts protected with #ifdef PARROT_IN_CORE. Those non-public parts might #define shorter versions of the public symbols, e.g. #define foo Parrot_foo.
#ifdef PARROT_IN_CORE
#define foo Parrot_foo
Most of Andy's work right now is with GCC 4.2 on Linux. We need many more.
Valgrind (http://valgrind.org/) is a profiler/debugger most notable for the way it magically monitors memory accesses and management.
Make a "make valgrind" target
Coverity already runs Prevent on the Perl 5 source. Let's get Parrot running under it, too. http://scan.coverity.com/
From #parrot:
vsoni: there seems to be some dead code/feature....I had a chat with leo and I am going to send and email to p6i for deprecation of certain old features
From chip's comment at http://www.oreillynet.com/onlamp/blog/2006/07/calling_for_parrot_janitors.html
We've just had contributed an improved register allocation implementation, but since the contributor is new to Parrot, there are some style and coding standards issues that need to be worked out. It'd be great if a Cage Cleaner could step up and help our new contributor bang the code into Parrotish form.
interpinfo .INTERPINFO_NAMESPACE_ROOT
The new get_root_namespace opcode obsoletes, and should replace each usage of, the old interpinfo .INTERPINFO_NAMESPACE_ROOT feature. (Which can then be eliminated.)
get_root_namespace
Also look at docs/BROKEN.pod, docs/ROADMAP.pod, and the list of Cage items on RT: http://xrl.us/owsd (Link to rt.perl.org)
To install Parrot::Op, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parrot::Op
CPAN shell
perl -MCPAN -e shell install Parrot::Op
For more information on module installation, please visit the detailed CPAN module installation guide.