A lightweight JavaScript interpreter written in C# that parses and evaluates JavaScript code using an S-expression intermediate representation.
All documentation is organized in the docs/ folder. This is the main entry point for all documentation.
- Quick Start Guide - Installation, basic usage, and first steps
- API Reference - Complete API documentation
- Supported Features - Comprehensive list of all implemented JavaScript features with examples
- NPM Package Compatibility - Running npm packages with the engine
- Architecture Overview - System design, components, and design decisions
- Transformation Pipeline - How JavaScript code transforms through the pipeline (JS → S-Expr → CPS)
- Documentation Index - Complete documentation index with all implementation details
- CPS Transformation Plan - Async/await implementation strategy
- ASI Implementation - Automatic Semicolon Insertion
- Signal Pattern - Control flow signal pattern
- Control Flow Alternatives - Alternative approaches for control flow
- Investigations - Investigation notes and debugging documentation
- Key investigations: Parser vs CPS analysis, promise rejection investigation, exception channel results
- Feature Status - Current implementation status
- Completed Features - Catalog of implemented features
- Remaining Tasks - What's left to implement
Asynkron.JsEngine implements a substantial subset of JavaScript features:
- ✅ Variables, functions, classes, objects, arrays
- ✅ Async/await, Promises, generators
- ✅ ES6 modules (import/export) including dynamic imports
- ✅ Template literals, destructuring, spread/rest
- ✅ All operators and control flow
- ✅ Comprehensive standard library (Math, Date, JSON, RegExp, etc.)
- ✅ Symbol, Map, Set, WeakMap, WeakSet collections
- ✅ BigInt for arbitrary precision integers
- ✅ Typed Arrays and ArrayBuffer for binary data
- ✅ Async iteration (for await...of)
See Complete Feature List for detailed documentation with examples.
Only 2 highly specialized features remain: Proxy/Reflect. See Large Features Not Implemented for analysis.
Note: BigInt, Typed Arrays, WeakMap/WeakSet, async iteration, and dynamic imports are now implemented!
Console application demos are included in the examples folder:
cd examples/Demo
dotnet runThe main demo showcases basic features including variables, functions, closures, objects, arrays, control flow, operators, and standard library usage.
cd examples/PromiseDemo
dotnet runDemonstrates setTimeout, setInterval, Promise creation, chaining, error handling, and event queue processing.
cd examples/NpmPackageDemo
dotnet runShows that the engine can run pure JavaScript npm packages without Node.js dependencies.
cd examples/SExpressionDemo
dotnet runDisplays the S-expression representation and CPS transformation of JavaScript code. See Transformation Pipeline for details.
# Build the solution
dotnet build
# Run tests
cd tests/Asynkron.JsEngine.Tests
dotnet testContributions are welcome! Please feel free to submit a Pull Request.
See LICENSE file for details.
Developed by Asynkron