Git Product home page Git Product logo

nqp's Introduction

NQP - Not Quite Perl (6)

NQP is Copyright (C) 2009-2013 by The Perl Foundation. See LICENSE for licensing details.

This is "Not Quite Perl" -- a lightweight Perl 6-like environment for virtual machines. The key feature of NQP is that it's designed to be a very small environment (as compared with, say, perl6 or Rakudo) and is focused on being a high-level way to create compilers and libraries for virtual machines (such as the Parrot Virtual Machine [1] and the JVM). 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.

[1] http://parrot.org/

Building from source

To build NQP from source, you'll just need a make utility and Perl 5.8 or newer. To automatically obtain and build Parrot you may also need a git client.

To obtain NQP directly from its repository:

$ 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/tree/master and clicking "Download". Then unpack the tarball or zip.

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

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

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

$ ./nqp hello.nqp

The --gen-parrot option above tells Configure.pl to automatically download and build the most appropriate version of Parrot into a local "parrot/" subdirectory, install that Parrot into the "parrot_install/" subdirectory, and use that for building NQP. It's okay to use the --gen-parrot option on later invocations of Configure.pl; the configure system will re-build Parrot only if a newer version is needed for whatever version of Rakudo you're working with.

You can use --parrot-config=/path/to/parrot_config instead of --gen-parrot to use an already installed Parrot for building NQP. This installed Parrot must include its development environment; typically this is done via Parrot's make install target or by installing prebuilt parrot-devel and/or libparrot-dev packages. The version of the already installed Parrot must satisfy a minimum specified by the NQP being built -- Configure.pl will verify this for you. Released versions of NQP always build against the latest release of Parrot; checkouts of the HEAD revision from github often require a version of Parrot that is newer than the most recent Parrot monthly release.

Once built, NQP's make install target will install NQP and its libraries into the Parrot installation that was used to create it. Until this step is performed, the "nqp" executable created by make above can only be reliably run from the root of NQP's build directory. After make install is performed the executable can be run from any directory (as long as the Parrot installation that was used to create it remains intact).

If the NQP compiler is invoked without an explicit script to run, it enters a small interactive mode that allows statements 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).

Differences from nqp-rx

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 only ran on Parrot, whereas NQP also runs on the JVM and is designed to be portable to more.

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

nqp's People

Contributors

arnsholt avatar bacek avatar benabik avatar bkeeler avatar chromatic avatar cognominal avatar coke avatar colomon avatar cotto avatar diakopter avatar donaldh avatar froggs avatar gerdr avatar hoelzro avatar jnthn avatar kboga avatar krisshannon avatar lizmat avatar mberends avatar mlschroe avatar moritz avatar perlpilot avatar plobsing avatar pmichaud avatar pmurias avatar ruz avatar snarkyboojum avatar sorear avatar tene avatar timo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.