Explain How Jint Works
Asked Answered
A

2

9

I would like to understand how Jint, a JavaScript Intrepreter written in C# works. Specifically:

  1. How does it makes use of Antlr?
  2. Which parts, if any, or this project are novel, and which parts represent a port of an existing JS Intrepreter to C#.NET?
  3. In general, how does one go about writing a Javascript Intrepreter in C#? For instance, what's out there already in terms of technology and code, and what do you have to write yourself?
  4. What would be the most challenging parts of writing an interpreter of JS?
Ankeny answered 17/5, 2011 at 1:54 Comment(0)
G
19

I am the author of Jint and before developing it I wrote an article about the techniques which are used in Jint. It was for another project, but this is the exact same architecture.

The article is State of the Art Expression Evaluation

It describes a tool which is on GitHub, NCalc

Gradatim answered 19/9, 2011 at 1:10 Comment(1)
Is there a documentation for Jint ?Mcqueen
I
1
  1. Look at the page on CodePlex, it says it uses it.
  2. Nothing is really novel, they're just writing an interpreter of Javascript.
  3. See this
  4. Actually writing it, getting recursion to work, getting the object model to work, etc. And, of course, just getting all the darn operators down correctly.
Irisation answered 17/5, 2011 at 1:59 Comment(1)
4a. (As I understand it) you cannot write a lexer for JavaScript without also writing a parser (unlike many other languages). Details: mozilla.org/js/language/js20-2002-04/rationale/…Lozengy

© 2022 - 2024 — McMap. All rights reserved.