$ show sebastienros/jint
Jint is a high-performance JavaScript interpreter for .NET, implementing the full ECMAScript specification (ES2025+) with extensive Web API support (Fetch, Streams, Crypto, Encoding, Workers, etc.) and a headless browser automation layer. The core engine provides a rich embedding API with CLR interop, module loading, execution constraints, and debugging via the Chrome DevTools Protocol. The architecture is modular: the engine itself is a library (Jint), with separate packages for DevTools debugging (Jint.DevTools), browser automation (Jint.Browser), and source generators for efficient interop (Jint.SourceGenerators). The codebase is exceptionally well-tested with thousands of unit tests, Web Platform Tests (WPT), and Test262 conformance tests, plus a comprehensive benchmark suite. It is used in production by projects like RavenDB, EventStore, and OrchardCore as an embedded scripting engine.
The LLM identified 4 files worth highlighting for reuse:
Provides a reusable benchmark harness that creates a fresh engine per benchmark row, warms it with the target script, and runs the measurement. This eliminates cross-row cache contamination and ensures accurate, isolated performance measurements. The pattern is self-contained and can be extracted for any Jint benchmarking scenario.
Implements a lazy property descriptor that defers the creation of the underlying function or value until first access. It supports flag clearing for inline cache admission and survives dictionary-mode deoptimization. This pattern is reusable for any JavaScript engine or object system needing deferred property materialization.
A queue-with-sizes data structure used by ReadableStream and WritableStream controllers. It maintains a running total of queued sizes with explicit floating-point rounding error compensation. The implementation is isolated, well-documented, and could be reused in any stream or buffer management system.
Implements the Map iterator prototype with a cursor-based traversal that tolerates concurrent mutations (additions, deletions) during iteration. It uses a KeyedCollectionCursor pattern that can be extracted for any collection requiring mutation-safe iteration. The code is self-contained and demonstrates careful handling of edge cases.