HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jterrace
js.js
JavaScript2012–2023
jterrace / js.js

js.js

js.js: A JavaScript JavaScript interpreter

19Distinct people
21Mentions
0Explicit recommenders
1.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

js.js: A JavaScript JavaScript interpreter

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year21 dated mentions

Observed mentions: 2012-01-02 22:21:46 UTC to 2023-06-01 17:14:33 UTC.

02462012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC211
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC707
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC413
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC303
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC110
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
js.js is a JavaScript interpreter in JavaScript. Instead of trying to create an interpreter from scratch, SpiderMonkey is compiled into LLVM and then emscripten translates the output into JavaScript. Demos See several running demos here. Paper Academic paper to appear at WebApps 2012 located here. Status The compiled version of js.js is 3MB and only 594KB after gzip compression. Using the Sunspider benchmark, the interpreter is about 200 times slower than Spidermonkey's native interpreter with the JIT compiler turned off. More optimizations and benchmarks are coming soon. Example Use Here is an example of how to use the API: var jsObjs = JSJS.Init(); var rval = JSJS.EvaluateScript(jsObjs.cx, jsObjs.glob, "1 + 1"); var d = JSJS.ValueToNumber(jsObjs.cx, rval); window.alert(d); //2 JSJS.End(jsObjs); More examples are available in the examples directory. Files The following files are located in the src directory. File Description js.O0.js Command-line JS shell, no optimizations js.O0.min.js Command-line JS shell, no optimizations, closure compiled js.O1.js Command-line JS shell, O1 optimizations js.O1.min.js Command-line JS shell, O1 optimizations, closure compiled js.O2.js Command-line JS shell, O2 optimizations js.O2.min.js Command-line JS shell, O2 optimizations, closure compiled libjs.O0.js JSAPI shared library, no optimizations libjs.O0.min.js JSAPI shared library, no optimizations, closure compiled with js.js wrapper libjs.O1.js JSAPI shared library, O1 optimizations libjs.O1.min.js JSAPI shared library, O1 optimizations, closure compiled with js.js wrapper libjs.O2.js JSAPI shared library, O2 optimizations libjs.O2.min.js JSAPI shared library, O2 optimizations, closure compiled with js.js wrapper jsjs-wrapper.js js.js wrapper API to make using the JSAPI easier To run the shell, you want to run one of these: js js.O2.min.js -e "print('hello');" node js.O2.min.js -e "print('hello');" To include the API in your website, include the minified libjs like this: <script type="text/javascript" src="libjs.O2.min.js"></script> Alternatively, you can use the wrapper script directly with a non-minified version (useful for debugging and modifications): <script type="text/javascript" src="libjs.O2.js"></script> <script type="text/javascript" src="jsjs-wrapper.js"></script>
Read the full README on GitHub

What Hacker News says

21 sources
Definitely not the first JS VM compiled to the browser. Aside from JSC as another comment mentioned, there was also js.js which is SpiderMonkey compiled to JS (around 2012!), https://github.com/jterrace/js.js/ This shouldn't be surprising - many VMs have been compiled to the Web, like Lua, Python (both CPython and PyPy!), etc., and JS is just another VM.
In QuickJS JavaScript Engine
It's not as impossible as it sounds. There are many JS engines which are extremely small compared to the big guys used in browsers. Most of them tend to grab a subset of the language and implement that. For example, the creators of nginx created their own specialized engine called nginScript that runs JS for their stuff https://www.nginx.com/resources/wiki/nginScript/ There is even a javascript interpreter written in javascript which can be a good starting point to learn a bit how it works https://github.com/jterrace/js.js/
In Microsoft Edge's JavaScript engine to go open-source
The footer says that if you want a real "Javascript to Javascript interpreter", to see js.js[0], which is a JS interpreter written JS; where the satirical js2js is a JS-to-JS compiler, something different. If you want a real JS to JS compiler, see Google's "Closure Compiler"[1]. [0]: https://github.com/jterrace/js.js/ [1]: https://developers.google.com/closure/compiler/ / https://github.com/google/closure-compiler
In Js2js: A revolutionary open-source compiler from JavaScript to JavaScript

Ask HN: What options are there for executing untrusted code in Node.js?

Over the past couple of weeks while prototyping various ideas I've kept on running into a hurdle when it comes to trying to run untrusted JavaScript code in Node.JS. One solution I found early on was Sandbox (http://gf3.github.io/sandbox/), which seems to be fairly safe security wise, but doesn't offer much else. Node.JS also has a vm module (http://nodejs.org/api/vm.html), but it it is 'Unstable'. I've also come across sandboxed-module (https://github.com/felixge/node-sandboxed-module), however I can't figure out what it actually does, and also js.js (https://github.com/jterrace/js.js), but it's much too slow to be of much use. So, does anyone else know of any other solutions?
4 points · Open discussion

Showing the 15 most recent of 21 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.