$ show trynova/nova
Nova is a custom ECMAScript (JavaScript) engine implemented in Rust, designed as a modular, embeddable runtime. It features a full bytecode compiler and virtual machine, a custom mark-compact garbage collector with typed arena allocation, and a shape-based (hidden class) object model for property access optimization. The engine closely follows the ECMAScript specification, implementing built-in objects (Promise, Array, Map, Set, Proxy, Temporal, etc.), module loading, and concurrent agents. Its architecture emphasizes data-oriented design and safe GC interaction through Rust-specific patterns like `GcScope`/`NoGcScope` and the `Bindable` trait. The project includes a standalone CLI (`nova_cli`) for running scripts and a test262 harness, currently passing approximately 80% of the official test suite. While actively developed, the engine has known limitations: many features are incomplete or behind feature flags (e.g., RegExp lacks full compliance, Temporal has placeholders, and several built-ins have `todo!()` stubs). The codebase exhibits high craftsmanship in its GC safety system, bytecode compiler, and object shape mechanics, but relies heavily on unsafe Rust and manual lifetime management. Nova is primarily a research-grade implementation aimed at embedding and exploration, not yet production-ready for general use.
The LLM identified 3 files worth highlighting for reuse:
A standalone crate providing a `SmallStr` type that stores strings up to 7 bytes inline without heap allocation, with fallback to a heap-allocated `Box<str>` for longer strings. This is a clean, reusable implementation of the small string optimization (SSO) pattern, complete with WTF-8 support, hashing, and conversion traits. It could be extracted into any Rust project needing efficient short string storage.
Implements a fluent builder for creating ECMAScript built-in functions (constructors and functions) with automatic shape optimization, prototype linking, and property configuration. This pattern is reusable for any JavaScript engine that needs to declare built-in objects declaratively, separating spec logic from construction boilerplate.
A Dylint lint rule that enforces immediate binding of scoped GC values in the Nova engine, preventing use-after-free bugs. The lint detects calls to `.bind()` and `.unbind()` patterns, ensuring that scoped values are not left unbound after fallible operations. This pattern demonstrates a reusable approach to enforcing complex lifetime invariants via compile-time linting, applicable to any Rust project with similar GC or borrow-checking bypass needs.