The Narcissus meta-circular JavaScript interpreter
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 142 commits behind mozilla:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tests
LICENSE
README.md
njs

README.md

Narcissus

Narcissus is a JavaScript interpreter written in pure JavaScript (i.e., a meta-circular evaluator), using the SpiderMonkey engine.

Originally a proof-of-concept by Brendan Eich, Narcissus is being revived as a test-bed for rapidly prototyping new language features for the JavaScript language (as well as the ECMAScript standard).

Usage

To run the Narcissus shell, install the SpiderMonkey shell and either set the NJS_SHELL environment variable to the path to the js executable, or creating a symbolic link to js in the top-level Narcissus directory. Then run Narcissus with the njs script.

Usage: njs

Options:
  -h, --help            show this help message and exit
  -f FILE, --file=FILE  JS file to load
  -e JS_EXPS, --expression=JS_EXPS
                        JS expression to evaluate
  -i, --interactive     enable interactive shell
  -H, --harmony         enable ECMAScript Harmony mode
  -S, --ssa             enable parse-time SSA construction

Dependencies

The front end of Narcissus, consisting of a lexer and parser (js{defs,lex,parse}.js), is written in portable ECMAScript Edition 3 code. The back end, consisting of the interpreter (js{ssa,exec}.js), is written using JavaScript extensions currently supported only by SpiderMonkey.

Development

More to come.

Contributors

  • Tom Austin
  • Brendan Eich
  • Andreas Gal
  • Shu-yu Guo
  • Dave Herman
  • Dimitris Vardoulakis
  • Patrick Walton