QuickJS is a small and embeddable JavaScript engine. It comes with an interactive command-line interface with contextual colorization.
The source code for qjs.com can be found in the third_party/quickjs folder.
qjs.com
third_party/quickjs
git clone https://github.com/jart/cosmopolitan && cd cosmopolitan build/bootstrap/make.com o//third_party/quickjs/qjs.com ./o/third_party/quickjs/qjs.com
Run and test the interpreter:
$ o/third_party/quickjs/qjs.com QuickJS - Type "\h" for help qjs >: console.log(2+2) 4 undefined qjs >:
Print 10 numbers from the Fibonacci sequence:
qjs >: let a = 0, b = 1, temp; for (let i = 0; i<9; i++) { console.log(a); temp = a+b; a=b; b=temp; } 0 1 1 2 3 5 8 13 21 34
There was an error while loading. Please reload this page.