Top 18 JavaScript Interpreter Projects
-
jquery.terminal
jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands
There is way more than in the Wikipedia article. I was implementing an interpreter for ANSI Art some time ago, maybe you will find it helpful. After a lot of struggle with my own parser using regular expressions, someone suggested that I should use a real parser which I use now. My project is in JavaScript and I used Node Ansi parser. It handles all ANSI escape code including cursor movements. There are no good documentation, I got help from one of the contributors that were also a contributor to the XTerm.js library. You can see my code that uses the library here: unix_formatting.js the file includes NodeAnsiParser.
-
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
-
Project mention: [AskJS] Feasibility of a pure JS argon2id hasher | reddit.com/r/javascript | 2022-04-19
There's no reason you can't just use a JS-based WebAssembly interpreter for Argon2 hashing. I'm pretty sure there are ways to actually use pure WASM or Rust in Cloudflare Workers too. But to be honest I can't think of any use cases where you'd need to run such an expensive hashing algorithm in a Cloudflare Worker; if you're trying to hash passwords this isn't the right solution anyway.
-
then you might be impressed by https://github.com/engine262/engine262 as well
-
In case you've jumped straight to the comments, here are some 'intro' links. Many of these also appear in ngn/k's readme.
First, direct links to ngn/k in the browser:
- REPL: https://ngn.bitbucket.io/k/#r
- editor: https://ngn.bitbucket.io/k/
Second, the best one-stop shop for an overview of k6's primitives (both ngn/k and oK are based on k6). https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual....
The best k intro examples are in John Earnest's k editor iKe - there's a dropdown at the bottom right. http://johnearnest.github.io/ok/ike/ike.html
ngn/k's editor also has an 'examples' dropdown in its menu.
Next, some Advent of Code solutions, to show that k doesn't have to look like a mass of meaningless symbols: https://github.com/chrispsn/aoc2017/blob/main/answers.k
For an illustration of k's strengths,
-
-
A Fast Excel Formula Parser and Evaluator\ (22 comments)
-
Scout APM
Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
-
Project mention: Tabloid: The clickbait headline programming language | news.ycombinator.com | 2022-05-14
-
Project mention: Defining syntactic sugar in the source code of your program? | reddit.com/r/ProgrammingLanguages | 2022-05-13
I've added syntax extensions to my LIPS Scheme. This is a way to extend the parser while the code is parsing the input. I plan to make it work more like Common Lisp reader macros. I didn't work on that language for a while, but the idea is simple to hook the reader into the parser for syntax extension. So when syntax token is found it will call a defined function and that function can use read to read stuff consumed by the parser.
-
Project mention: Roku publishes IDK to allow consumers to develop applications for their Roku | news.ycombinator.com | 2021-10-29
> Enthusiasts had to create an interpreter for it (https://github.com/sjbarag/brs) to speed up development time.
Author of that interpreter here - didn't expect to wake up to that repo appearing in a top HN comment! That started as a side project and was maintained during spare work hours (thanks, Hulu!) for the past 3 years, along with a unit testing framework that runs in it (https://github.com/hulu/roca).
I'm happy to answer any "developing for Roku" questions that come up :)
-
Method calls are nothing special, just calls which have the form .(). For example: const foo = { bar: function () { console.log(this); } }; foo.bar(); Enter fullscreen mode Exit fullscreen mode For method calls, this gets set to the object from which the method was called. Again, functions don't matter* for this, just the calls. function foo() { console.log(this); } let x = { bar: foo }; foo(); // Window x.bar(); // x let baz = x.bar; baz(); // Window Enter fullscreen mode Exit fullscreen mode Even baz will print Window. It's not a method call, it doesn't follow the method call format! 3. Constructor calls Or new calls (are calls too I suppose). In that case this gets set to the empty object {}. function Foo() { console.log(this); } new Foo(); // {} Foo(); // Window let x = { foo: Foo }; x.foo(); // x Enter fullscreen mode Exit fullscreen mode That's pretty much all there is to it......... ........or is it?! I apologize for this Remember how I told you this is all about function calls, not the functions themselves? Well, I lied. Ok look, let me remind you once again: They made javascript in 10 days! The this rules we've discussed above, they are a bit limiting. So there's three* ways you can override these rules. * don't you dare even mention apply 1. call The special call method on functions allows you to pass your own custom value of this to a function call (or the call's scope I should say). function foo() { console.log(this); } foo.call({ a: 42 }); // { a: 42 } Enter fullscreen mode Exit fullscreen mode 2. bind bind is another builtin method on functions. Much like call it too allows you to pass a custom value for this to the function call. Except unlike call, bind doesn't immediately call the function. It instead returns a special 'bound' functions. function foo() { console.log(this); } let bar = foo.bind({ a: 42 }); foo(); // Window bar(); // { a: 42 } Enter fullscreen mode Exit fullscreen mode 3. Arrow functions Arrow functions are the third way to override the call rules for this described previously. Arrow functions capture the this from the function scope in which they are created. function foo() { const bar = () => { console.log(this); }; return bar; } let bar = foo.call({ a: 42 }); bar(); // { a: 42 } Enter fullscreen mode Exit fullscreen mode So they're essentially the same as defining a normal function but then also binding it. // achieves the same effect function foo() { const bar = (function () { console.log(this); }).bind(this); return bar; } let bar = foo.call({ a: 42 }); bar(); // { a: 42 } Enter fullscreen mode Exit fullscreen mode In summary Yes, no pun in the heading this time (oops). The key takeaways are this: In JS this is associated with the current function scope, and since function scopes are associated with functions calls -- this is associated with calls. Those are the rules but they can be overridden. That is the reason why people are often confused when passing functions referencing this to callbacks. It's also why you were told to use arrow functions if you need to pass them to callbacks. I too was confused about this for a long time. Instead of taking the more sensible approach of reading an article such as this one, I instead decided to implement my own javascript. I wrote a subset of javascript. In that subset of javascript. If you want to go down that rabbit hole, then check out the repo: https://github.com/BlueBlazin/thislang If you want more posts on other javascript or computing related topics let me know on twitter: https://twitter.com/suicuneblue
-
Some APL environments such as ngn/apl[0] allow tab completion like |o results in ⌽. This is probably available on tryapl.org too, but I can't test it when it's down :/
-
Project mention: Doing M1 MacBook Pro (M1 Max, 64GB) Compile Benchmarks! | reddit.com/r/rust | 2021-10-26
-
Yazur
A YOLOL interpreter with multi-chip support for testing out your planned starbase ideas. Currently used as the backend behind the code snippet editors on Pasukaru's Yolol tutorial website "Yolol.info" (linked)
-
Project mention: 🧠 BrainAlias: A interpreter generator for your BF-aliases language | reddit.com/r/esolangs | 2022-01-30
And more...
-
Project mention: I build a programming language with JS | reddit.com/r/learnprogramming | 2022-01-05
Github: https://github.com/YigitGunduc/cycle
-
Project mention: Logan BASIC: An online BASIC interpreter that runs both text- and graphics-based programs directly in the browser. | reddit.com/r/Basic | 2022-03-16
-
Project mention: Show HN: Watasu.js – Flexible Abstraction Interpreter | news.ycombinator.com | 2022-03-01
JavaScript Interpreter related posts
- Explanation of the .ANS file format?
- Tabloid: The clickbait headline programming language
- [AskJS] Feasibility of a pure JS argon2id hasher
- Logan BASIC: An online BASIC interpreter that runs both text- and graphics-based programs directly in the browser.
- OK – an Open-Source interpreter for the KS language
- And so was the C compiler.
- [AskJS] is there a way to quantitatively check if a number value is copied or only the pointer to that number is copied?
Index
What are some of the best open-source Interpreter projects in JavaScript? This list will help you:
Project | Stars | |
---|---|---|
1 | jquery.terminal | 2,692 |
2 | sablejs | 797 |
3 | webassemblyjs | 663 |
4 | engine262 | 600 |
5 | ok | 467 |
6 | hyper-haskell-server | 356 |
7 | fast-formula-parser | 321 |
8 | tabloid | 260 |
9 | LIPS | 237 |
10 | brs | 93 |
11 | thislang | 29 |
12 | ngn-apl | 29 |
13 | monkey-rust | 11 |
14 | Yazur | 6 |
15 | brainalias | 2 |
16 | cycle | 1 |
17 | LoganBASIC | 1 |
18 | watasu | 0 |
Are you hiring? Post a new remote job listing for free.