

Mjs – An interpreter for ECMAScript 1st edition written in C++17
source link: https://www.tuicool.com/articles/hit/6VjEZnZ
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

mjs
Introduction
mjs is an interpreter for ECMAScript 1st edition (a.k.a. Javascript 1997) written in C++17. It was written as a hobby project for the purpose of gaining a better understanding of how Javascript actually works. As such it doesn't strive to be neither fast, secure nor particularly beautiful. In fact some things are downright terribly implemented. Also no real programs were actually tested.
Most of ES1 should be implemented (to some degree...), but see the TODO file for details. Also be aware that you probably haven't programmed in ES1 before and will find most modern conveniences (e.g. array and object literals) missing from the specification.
Building
You need a modern C++ compiler that supports C++17 and CMake 3.7 or later. It has currently been tested with the following compilers:
- Visual C++ 2017 15.8.8 on Windows 10
- GCC 7.1.0 (x64 distribution from Stephan T. Lavavej ) on Windows 10
- GCC 8.2.0 (on x64 Linux, Debian testing as of October 2018)
To run the tests build the "check" target.
The interpreter is built in the "src" directory. It accepts a Javascript file on the command line or starts in REPL mode if no argument is given.
These steps should work for most people:
mkdir build cd build cmake .. # Here you may want use e.g. CXX=g++-8 cmake .. cmake --build . cmake --build . --target check
Support
Forget about it :). Feel free to raise an issue on Github, but don't expect anything to come of it.
Recommend
-
204
README.md anko
-
38
GoAWK: an AWK interpreter written in Go AWK is a fascinating text-processing language, and somehow after reading the delightfully-terse
-
89
README.md GoAWK: an AWK interpreter written in Go
-
61
README.md JSCPP This is a simple C++ interpreter written in JavaScript. Try it out on github.io
-
59
README.md
-
41
Ben Hoyt is an experienced software engineer at Compass in New York City. He and his wife and three daughters live just across the Hudson River in New Jersey.
-
57
APL\iv interpreter and stream processor contents apl:...
-
57
RustPython A Python-3 (CPython >= 3.5.0) Interpreter written in Rust :snake::scream: . Usage Check out our online demo running...
-
11
“This is your last chance. After this, there is no turning back. You take the blue pill — the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill — you stay in Wonderland and I show you how deep...
-
5
The 1st code interpreter extension powered by GPT-4, freeSort by: 👋 Hello Product Hunter, I'm thrilled to share some exciting news with you today. Our team has been hard at work, and I'm delighted to introduce y...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK