Skip to content

The Narcissus meta-circular JavaScript interpreter

License

Notifications You must be signed in to change notification settings

allenwb/narcissus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Narcissus

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

This verson of Narcissus adds various experimental features that have been proposed for ES Harmony. See harmony.md for a list of new features.

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 (note that pre-built versions of the shell are available in the Firefox nightly builds, for example http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/jsshell-win32.zip or http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/jsshell-mac.zip). After building or downloading 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
  • Allen Wirfs-Brock

About

The Narcissus meta-circular JavaScript interpreter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.7%
  • Python 2.3%