Narcissus (JavaScript engine)
From Wikipedia, the free encyclopedia
Narcissus is an open source JavaScript engine. It was written by Brendan Eich, who also wrote the first JavaScript engine, SpiderMonkey. Its name is based on the mythical figure of Narcissus, who fell in love with himself. This relates to the fact that this JavaScript engine is a metacircular interpreter, because the engine itself is also written in JavaScript, albeit using a lot of non-standard extensions that are specific to SpiderMonkey, one of them specially added for Narcissus and currently only available in a development branch of SpiderMonkey.
[edit] How to run
Read http://developer.mozilla.org/en/docs/Build_Documentation. You need MozillaBuild to build on Windows.
$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login password: anonymous $ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/js/src $ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/js/narcissus $ cd mozilla/js/src $ make -f Makefile.ref NARCISSUS=1
Make a file like this at mozilla/js/narcissus/test.js .
print(evaluate("function divTest(a, b) { return a / b; }; divTest(355, 113);"));
Then you can run by this.
$ cd ../narcissus $ ../src/WINNT5.1_DBG.OBJ/js.exe -f js.js test.js
WINNT5.1_DBG.OBJ will change by your OS.
[edit] See also
[edit] External links
|