Swap the JavaScript engine under a Rust project like Deno without touching its own code.
Shrink the binary size of a Rust based JavaScript runtime by using a smaller engine or the OS's built in JavaScriptCore.
Compare binary size tradeoffs between V8, JavaScriptCore, and QuickJS-ng for a given project.
| littledivy/v8x | akitaonrails/ratatui-bubbletea | deepdiy/pdf2md | |
|---|---|---|---|
| Stars | 20 | 20 | 20 |
| Language | Rust | Rust | Rust |
| Setup difficulty | moderate | easy | easy |
| Complexity | 4/5 | 2/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires editing your Rust project's Cargo.toml dependency on the v8 crate.
v8x is a Rust library that lets programs built to use Google's V8 JavaScript engine switch to a different JavaScript engine instead, without changing their own code. Normally, a Rust project that depends on the v8 crate is locked into using V8 specifically. v8x acts as a drop in replacement: you swap one line in your project's dependency list, and the rest of your code keeps working exactly as it did before, now running on whichever engine you picked. The project currently supports three different JavaScript engines: V8 itself, JavaScriptCore, which is the engine behind Apple's WebKit browser technology and can also use the version already built into the operating system, and QuickJS-ng, a smaller and lighter JavaScript engine. It works by taking the actual source code of the real v8 crate and reimplementing its internal interface on top of whichever engine you choose, so other libraries that expect the standard v8 crate, such as Deno's deno_core, continue to compile and run without any changes on their end. One practical reason to make this swap is binary size. The README includes measurements for Deno, the JavaScript runtime, built with different engines: using the default V8 engine produces a build around 78.7 megabytes, using JavaScriptCore comes to about 80.7 megabytes, using the JavaScriptCore that is already part of the operating system shrinks that to about 54.2 megabytes since no engine needs to be bundled at all, and using QuickJS-ng produces a build of about 56.1 megabytes with only around 1 megabyte of engine code included. This is a low level, infrastructure focused project aimed at developers who build JavaScript runtimes or tools in Rust and want more control over which JavaScript engine powers their software, particularly when binary size or platform availability matters.
A Rust library that lets projects using the V8 JavaScript engine switch to JavaScriptCore or QuickJS-ng without changing their code.
Mainly Rust. The stack also includes Rust, V8, JavaScriptCore.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.