{"id":14965981,"url":"https://github.com/raku/nqp","last_synced_at":"2025-05-15T01:06:11.605Z","repository":{"id":40272607,"uuid":"1342470","full_name":"Raku/nqp","owner":"Raku","description":"NQP","archived":false,"fork":false,"pushed_at":"2025-04-19T17:57:45.000Z","size":166167,"stargazers_count":349,"open_issues_count":83,"forks_count":135,"subscribers_count":105,"default_branch":"main","last_synced_at":"2025-04-21T11:43:11.469Z","etag":null,"topics":["hacktoberfest","raku"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Raku.png","metadata":{"files":{"readme":"README.pod","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-02-08T15:51:24.000Z","updated_at":"2025-04-20T16:37:02.000Z","dependencies_parsed_at":"2023-10-21T07:23:49.354Z","dependency_job_id":"68bcb426-d074-430c-b29b-4e9fa4b696d3","html_url":"https://github.com/Raku/nqp","commit_stats":{"total_commits":12209,"total_committers":146,"mean_commits":83.62328767123287,"dds":0.7061184372184455,"last_synced_commit":"5bf8ae18ea4d140cfe59f96ef25012c844f4083d"},"previous_names":["perl6/nqp"],"tags_count":160,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raku%2Fnqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raku%2Fnqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raku%2Fnqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raku%2Fnqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Raku","download_url":"https://codeload.github.com/Raku/nqp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254040,"owners_count":22039792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","raku"],"created_at":"2024-09-24T13:35:38.916Z","updated_at":"2025-05-15T01:06:06.595Z","avatar_url":"https://github.com/Raku.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"=pod\n\n=head1 NQP - Not Quite Perl\n\nNQP is Copyright (C) 2009-2025 by The Raku Foundation.  See F\u003cLICENSE\u003e\nfor licensing details.\n\nThis is \"Not Quite Perl\" -- a lightweight Raku-like environment for\nvirtual machines.  The key feature of NQP is that it's designed to be a very\nsmall environment (as compared with, say, raku or Rakudo) and is focused on\nbeing a high-level way to create compilers and libraries for virtual\nmachines like L\u003cMoarVM|https://github.com/MoarVM/MoarVM\u003e, the JVM, and others.\n\nUnlike a full-fledged implementation of Raku, NQP strives to have as small\na runtime footprint as it can, while still providing a Raku object model\nand regular expression engine for the virtual machine.\n\n=head2 Building from source\n\n=for HTML \u003ca href=\"https://dev.azure.com/Raku/nqp/_build/latest?definitionId=1\u0026branchName=master\"\u003e\u003cimg src=\"https://dev.azure.com/Raku/nqp/_apis/build/status/Raku.nqp?branchName=master\"\u003e\u003c/a\u003e\n\nTo build NQP from source, you'll just need a C\u003cmake\u003e utility and C\u003cPerl\u003e 5.8 or\nnewer.  To automatically obtain and build MoarVM you may also need\na C\u003cgit\u003e client.\n\nTo obtain C\u003cNQP\u003e directly from its repository:\n\n    $ git clone git://github.com/Raku/nqp.git\n\nIf you don't have git installed, you can get a tarball or zip of NQP from\ngithub by visiting http://github.com/Raku/nqp/tree/main and clicking\n\"Download\".  Then unpack the tarball or zip.\n\nC\u003cNQP\u003e can run on three different backends: C\u003cMoarVM\u003e, the C\u003cJVM\u003e, and C\u003cJavaScript\u003e.\nThe C\u003cJVM\u003e and C\u003cJavaScript\u003e backends are currently experimental.  The JVM backend\nrequires C\u003cJDK 1.9\u003e (also known as C\u003cJDK 9\u003e) or higher.\n\nOnce you have a copy of NQP, decide which backends you want to run,\nand configure and build it as follows:\n\n    $ cd nqp\n    $ perl Configure.pl --with-moar=/path/to/moar --backends=moar,jvm\n    $ make\n\nIf you don't have an installed MoarVM, you can have\nC\u003cConfigure.pl\u003e download and build one for you as well -- by passing the C\u003c--gen-moar\u003e\noption to it (instead of C\u003c--with-moar\u003e):\n\n    $ cd nqp\n    $ perl Configure.pl --gen-moar --backends=moar,jvm\n    $ make\n\nThe C\u003cmake\u003e step will create a C\u003cnqp\u003e or C\u003cnqp.exe\u003e executable in the current\ndirectory.  Programs can then be run from the build directory using a\ncommand like:\n\n    $ ./nqp hello.nqp\n\nBy default, NQP searches for the MoarVM executable and installs to the\ndirectory C\u003c./install\u003e.  You can change that with the C\u003c--prefix\u003e option to\nConfigure.pl; this will point to the directory prefix where `moar` is installed,\nsuch as `/usr`; it needs to be the same one used when configuring MoarVM unless\nyou use the option `--with-moar`.  This optional argument should point to the installed\n`moar` executable; for instance, `--with-moar=/usr/local/bin/moar`.\n\nOnce built, NQP's C\u003cmake install\u003e target will install NQP and its libraries\ninto the same location as the MoarVM installation\nthat was used to create it.  Until this step is\nperformed, the C\u003cnqp\u003e executable created by C\u003cmake\u003e above can only be\nreliably run from the root of NQP's build directory.  After C\u003cmake install\u003e\nis performed the executable can be run from any directory.\n\nIf the C\u003cNQP\u003e compiler is invoked without an explicit script to run, it enters\na small interactive mode that allows statements to be executed from the\ncommand line.  Each line entered is treated as a separate compilation unit,\nhowever (which means that subroutines are preserved after they are defined,\nbut variables are not).\n\n=head2 Troubleshooting\n\n=head3 OS X\n\nOn OS X, it appears that configuration fails in some configurations:\n\n  3rdparty/libuv/include/uv-darwin.h:26:11: fatal error: 'mach/mach.h' file not found\n\nShould this happen to you, then a solution might be the following:\n\n    $ cd MoarVM/3rdparty/libuv/include\n    $ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/mach\n    $ cd ../../../..\n    $ # run the Configure again\n\nNote that the 10.9 in the above, represents the major version of OS X being\nused.  On Mavericks use 10.9 (like above), on Yosemite use 10.10.\n\n=head3 JVM\n\nIf attempting to run NQP on the JVM results in NQP claiming it couldn't reserve\nenough memory, you may need to increase the memory limit of your shell like so:\n\n    $ ulimit -d 6144000\n\n=head2 Using NQP\n\nB\u003cNOTE:\u003e there's B\u003cno end-user support\u003e for NQP and the behaviour can\nchange without notice. It's a tool for writing Raku compilers, not a\nlow-level module for Raku programmers.\n\nThe L\u003cexamples directory|https://github.com/raku/nqp/tree/main/examples\u003e is a good place to start, with the\nL\u003cloops|https://github.com/raku/nqp/blob/main/examples/loops.nqp\u003e and other files. Opcodes are listed in\nL\u003cthe docs directory|https://github.com/raku/nqp/blob/main/docs/ops.markdown\u003e. NQP also has built-in routines\nlisted in L\u003cthe docs directory|https://github.com/raku/nqp/blob/main/docs/built-ins.md\u003e. You can use NQP from this\nrelease, it will be already installed if you have built Raku from\nscratch.\n\n=head2 JavaScript backend\n\nThe best thing before playing with it/hacking on it is to contact pmurias via IRC at C\u003c#raku\u003e on L\u003circ.libera.chat|https://web.libera.chat/?channels=#raku\u003e.\nWe depend on C\u003cnode.js\u003e at least 10.10.0\n\nBuilding the JavaScript backend currently requires building the moar backend:\n\n    $ perl Configure.pl --backends=moar,js\n    $ make\n\nCurrently it needs to be run like:\n\n    $ ./nqp-js file.nqp\n\nIf you are developing C\u003cnqp-js\u003e, you may want to pass the C\u003c--link\u003e option to configure to have the C\u003cnqp-runtime\u003e linked instead of installed\n\n    $ cd src/vm/js/nqp-runtime; npm link .\n    $ perl Configure --backends=moar,js\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraku%2Fnqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraku%2Fnqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraku%2Fnqp/lists"}