## $Id: TODO.pod 27031 2008-04-19 12:17:01Z bernhard $

=head1 Things that NQP needs

This list is based on discussions with pmichaud and unimplemented
items in the grammar, C<src/Grammar.pg>.

Last updated: 2007-11-24

=head2 Code

=over 4

=item * C<&> sigil

Handle the mapping between C<&foo> and 'foo' subroutines.

=item * C<return> statement

While it seems like implementing C<return> would be a simple
matter of generating PIR C<.return> statements, it's not quite
that simple, because C<return> statements can occur inside of
nested blocks.

So, we need an NQP C<return> statement to throw a "return exception",
which is then caught by the outermost block of the currently
executing subroutine and then used as the argument to C<.return>.

Fortunately, the new design of S05 means that we don't really need
return statements for developing action grammars, so this is no
longer as much of a priority as it was.

=back

=head2 Tests

=over 4

=item * More tests for method ops

We should be able to load an external module (Pm suggests Test.pbc)
and exercise methods using that.

=item * Match variable access C<$/>

=item * More tests for scalar context $( ... )

=item * More tests for list context @( ... )

=item * Variables with twigils

=item * More tests for optional arguments and parameters

=item * More tests for named arguments and parameters

=back

=head2 Bootstrap

The directory C<bootstrap> contains the necessary files to implement NPQ
in NQP. While this is not a major goal, it is interesting to compare the
speed of NQP implemented in PIR and in NQP. For this to work, some things
must be fixed. The bootstrap version can be tested with

  cd bootstrap && perl t/harness

=over 4

=item * it seems that the action for the C<for-statement> is broken.

=item * NQP should not have a runtime containing support routines. The
original NQP (in PIR) implements all operators as PIR instructions. This
should also be the case for the bootstrapped NQP. Currently, the optable
action does not handle the "inline" specifications.

=item * Some actions are not complete. For instance, the action method
C<package_declarator>, where classes can be defined.

=item * the NQP compiler driver should accept a commandline option indicating
which Actions object should be used: the PIR or NQP version. HLLCompiler
has support for adding commandline options, this could be used.

=back

