Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update README, explain differences between nqp and nqp-rx.
  • Loading branch information
pmichaud committed Feb 8, 2011
1 parent 67623b5 commit 4933c8c
Showing 1 changed file with 24 additions and 31 deletions.
55 changes: 24 additions & 31 deletions README
@@ -1,46 +1,45 @@
=head1 NQP - Not Quite Perl (6)

NQP is Copyright (C) 2009 by The Perl Foundation. See F<LICENSE>
NQP is Copyright (C) 2009-2011 by The Perl Foundation. See F<LICENSE>
for licensing details.

This is "Not Quite Perl" -- a compiler for quickly generating PIR
routines from Perl6-like code. The key feature of NQP is that it's
designed to be a very small compiler (as compared with, say, perl6
or Rakudo) and is focused on being a high-level way to create
transformers for Parrot (especially hll compilers). In addition,
unlike Rakudo, NQP attempts to restrict itself to generating code
that can run in Parrot without the existence of any NQP-specific
runtime libraries.
compilers and libraries for virtual machines (such as the Parrot
Virtual Machine [1]). Unlike a full-fledged implementation of Perl 6,
NQP strives to have as small a runtime footprint as it can, while
still providing a Perl 6 object model and regular expression engine
for the virtual machine.

=head2 Building from source
[1] http://parrot.org/

NQP comes bundled with Parrot, so if you have a recent Parrot
distribution you likely also have a copy of NQP. Inside of a
Parrot installation NQP is known as C<parrot-nqp>.
=head2 Building from source

To build NQP from source, you'll just need a C<make> utility
and Perl 5.8 or newer. To automatically obtain and build Parrot
you may also need a subversion (svn) client.
you may also need a git client.

To obtain NQP directly from its repository:

$ git clone git://github.com/perl6/nqp-rx.git
$ git clone git://github.com/perl6/nqp.git

If you don't have git installed, you can get a tarball or zip
of NQP from github by visiting http://github.com/perl6/nqp-rx/tree/master
of NQP from github by visiting http://github.com/perl6/nqp/tree/master
and clicking "Download". Then unpack the tarball or zip.

Once you have a copy of NQP, build it as follows:

$ cd nqp-rx
$ cd nqp
$ perl Configure.pl --gen-parrot
$ make

This will create a "nqp" or "nqp.exe" executable in the
current (nqp-rx) directory. Programs can then be run from
the build directory using a command like:
current directory. Programs can then be run from the build
directory using a command like:

$ ./nqp hello.pl
$ ./nqp hello.nqp

The C<--gen-parrot> option above tells Configure.pl to automatically
download and build the most appropriate version of Parrot into a
Expand Down Expand Up @@ -77,21 +76,15 @@ to be executed from the command line. Each line entered is treated
as a separate compilation unit, however (which means that subroutines
are preserved after they are defined, but variables are not).

=head2 Differences from previous version of NQP

* Sub declarations are now lexical ("my") by default, use
"our sub xyz() { ... }" if you want package-scoped subroutines.

* The PIR q<...>; construct is gone. Use Q:PIR or pir::opcode(...)
instead.

* The mainline code of modules is no longer tagged as ":load :init"
by default. Use INIT { ... } for any code that you want to be
run automatically at startup.

* Cuddled else's are no longer valid Perl 6, 'else' requires a
space after it.
=head2 Differences from nqp-rx

* Double-quoted strings now interpolate $-variables.
NQP is the successor implementation of "nqp-rx" [2]. Unlike nqp-rx,
which aimed to have almost no runtime component whatsoever, this new
version of NQP accepts that a minimal Perl 6 object metamodel,
multidispatcher, and regular expression engine are needed on top of
the underlying virtual machine. Also, nqp-rx is likely to only run
on Parrot, whereas we expect NQP to eventually run on other virtual
machine backends.

[2] http://github.com/perl6/nqp-rx

0 comments on commit 4933c8c

Please sign in to comment.