node-js 0.1.2

JavaScript as a fusevm frontend: a lexer/parser and compiler to fusevm::Chunk on a JsHost object heap, with no bespoke VM or JIT
Documentation
[package]
name = "node-js"
version = "0.1.2"
edition = "2021"
rust-version = "1.80"
description = "JavaScript as a fusevm frontend: a lexer/parser and compiler to fusevm::Chunk on a JsHost object heap, with no bespoke VM or JIT"
license = "MIT"
authors = ["MenkeTechnologies <linux.dev25@gmail.com>"]
repository = "https://github.com/MenkeTechnologies/node-js"
homepage = "https://menketechnologies.github.io/node-js/"
documentation = "https://docs.rs/node-js"
keywords = ["javascript", "interpreter", "compiler", "jit", "fusevm"]
categories = ["command-line-utilities", "compilers"]
publish = true
# Keep the published crate lean: ship `src/`, `man/`, `completions/`,
# README/LICENSE — nothing else. Everything below stays in git for
# local/CI use but is omitted from `cargo package` / the crates.io
# tarball. Mirrors strykelang's exclude set.
exclude = [
    "/.github/",
    "/tests/",
    "/examples/",
    "/docs/",
    "/parity-scripts/",
    "/BUGS.md",
]

# node-js is a standalone crate, not a workspace member. An explicit empty
# `[workspace]` stops cargo walking up to the MenkeTechnologiesMeta parent.
[workspace]

[lib]
name = "nodejs"
path = "src/lib.rs"
# staticlib so an AOT object can be linked against the nodejs runtime into a
# standalone native executable (mirrors pythonrs).
crate-type = ["rlib", "staticlib"]

[[bin]]
name = "node"
path = "src/main.rs"

# Differential parity harness: runs the corpus through node-js and the reference
# `node`, diffing stdout. Development tool — needs `node` on PATH, so CI never
# runs it; its frozen outputs live in tests/data/parity_expected.txt, which
# tests/parity.rs replays with no `node` installed.
# Offline reference-manual generator: consumes the `nodejs::lsp` corpus and
# writes docs/reference.html (article-format keyword/global/method reference).
# The MenkeTechnologiesPublications reference PDF pipeline runs this.
[[bin]]
name = "gen-docs"
path = "src/bin/gen_docs.rs"

[[bin]]
name = "parity"
path = "src/bin/parity.rs"

# Differential parity FUZZER: generates thousands of deterministic-output JS
# snippets (biased toward float repr / exponential-notation threshold, ToInt32
# bitwise wrap, the `==` coercion matrix, `+` coercion, string/array methods,
# toFixed/toPrecision rounding, JSON round-trips) and diffs `node -e` against the
# reference `node -e`, delta-debugging every divergence to a minimal repro.
# Subprocess-only (never links the lib); std-only (no `rand`). Dev tool — needs
# `node` on PATH, so CI never runs it.
[[bin]]
name = "parity-fuzz"
path = "src/bin/parity_fuzz.rs"

[dependencies]
# JavaScript executes on fusevm. node-js is a pure frontend: it lowers JS to
# fusevm bytecode (src/compiler.rs) and hosts the JS object heap (src/host.rs,
# reached from fusevm's builtin dispatch + numeric hook). Object/str/array cells
# ride through the VM as `Value::Obj(u32)` handles into that heap.
#
# `jit-disk-cache` turns on fusevm's Cranelift JIT *and* its persistent on-disk
# cache of compiled native code; `aot` enables the ahead-of-time object emitter.
# `ffi` enables inline Rust FFI (`rust { ... }` blocks) — src/rust_ffi.rs.
fusevm = { version = "0.23.0", features = ["jit", "jit-disk-cache", "aot", "ffi"] }

clap = { version = "4.5", features = ["derive", "cargo"] }
thiserror = "2.0"
rustc-hash = "2.1"
# JS objects preserve property insertion order (observable in iteration / repr).
indexmap = "2"
# Stackful, same-thread coroutines backing generators (`function*`/`yield`) and
# `await` suspension — mirrors pythonrs. The thread_local JsHost heap is shared
# across every suspend/resume because the coroutine runs on the same thread.
corosensei = "0.3"

# rkyv-backed bytecode cache at ~/.node-js/scripts.rkyv (mirrors pythonrs/
# zshrs/rubylang): the outer shard is a zero-copy rkyv archive; the inner
# per-script fusevm::Chunk is bincode (fusevm::Chunk is serde-owned, not
# rkyv::Archive). Versioned from day one so a cached .js that worked never
# breaks (compat floor).
rkyv = { version = "0.7", features = ["validation", "archive_le", "size_32"] }
bincode = "1.3"
memmap2 = "0.9"
dirs = "5"
once_cell = "1"

# LSP (`node --lsp`) + DAP (`node --dap`) over stdio. libc gives the DAP server
# a pipe + dup2 to capture the debuggee's stdout (console.log) so program output
# streams as `output` events instead of corrupting the JSON-RPC channel; it also
# backs the `isatty` REPL fallthrough.
lsp-server = "0.7.9"
lsp-types = "0.97.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
libc = "0.2"

# Interactive REPL (`node --repl` / TTY fallthrough): reedline line editor,
# nu-ansi-term for status colors.
reedline = "0.47.0"
nu-ansi-term = "0.50"

# Hash backends for the `crypto` module (createHash md5/sha1/sha256).
md-5 = "0.10"
sha1 = "0.10"
sha2 = "0.10"
# HMAC (createHmac), OS randomness (randomBytes/randomUUID), and real DEFLATE/gzip
# for the `zlib` module.
hmac = "0.12"
getrandom = "0.2"
flate2 = "1"
# Pure-Rust TLS for the `tls`/`https` modules (blocking rustls::Stream over a
# std TcpStream); rustls-pemfile parses cert/key PEMs; webpki-roots is the client
# trust anchor set.
rustls = "0.23"
rustls-pemfile = "2"
webpki-roots = "0.26"
# HPACK header compression for a minimal real HTTP/2 server (`http2`).
hpack = "0.3"

# ── Full-stdlib round: additional native backends ────────────────────────────
# zlib: Brotli + Zstd codecs and a CRC-32 (flate2 already covers deflate/gzip).
brotli = "7"
zstd = "0.13"
crc32fast = "1.4"
# crypto: real KDFs + symmetric ciphers + constant-time compare for the `crypto`
# module surface (pbkdf2/scrypt/hkdf, createCipheriv AES-CBC/CTR, timingSafeEqual).
pbkdf2 = "0.12"
scrypt = "0.11"
hkdf = "0.12"
aes = "0.8"
cbc = { version = "0.1", features = ["alloc"] }
ctr = "0.9"
cipher = "0.4"
subtle = "2.6"
# dns: real recursive/system-config DNS resolution (resolve4/6/Mx/Txt/Cname/…).
hickory-resolver = "0.24"

# ── crypto (asymmetric): real RustCrypto backends for the `crypto` module ─────
# RSA (keygen/sign/verify/OAEP+PKCS1), NIST P-256/P-384 ECDSA+ECDH, Ed25519,
# X25519 ECDH, PKCS#8/SPKI/SEC1/PEM key encoding, X.509 parsing, primality
# (checkPrime/generatePrime), Argon2 KDF.
rsa = { version = "0.9", features = ["sha2", "pem"] }
p256 = { version = "0.13", features = ["ecdsa", "ecdh", "pem", "pkcs8"] }
p384 = { version = "0.13", features = ["ecdsa", "ecdh", "pem", "pkcs8"] }
ecdsa = "0.16"
ed25519-dalek = { version = "2", features = ["pkcs8", "pem", "rand_core"] }
x25519-dalek = { version = "2", features = ["static_secrets"] }
signature = "2"
pkcs8 = { version = "0.10", features = ["pem", "alloc"] }
spki = "0.7"
sec1 = "0.7"
x509-cert = "0.2"
num-prime = "0.4"
argon2 = "0.5"
rand_core = { version = "0.6", features = ["getrandom"] }
const-oid = "0.9"

# Arbitrary-precision integers backing JS `BigInt` (the `10n` literal + bigint
# arithmetic). Same crates/versions pythonrs uses for its bignum path.
num-bigint = "0.4"
num-integer = "0.1"
num-traits = "0.2"

# JS regular-expression literals (`/pat/flags`) + `RegExp`. `fancy-regex` wraps
# the Rust `regex` crate for the linear fast path and adds a backtracking engine
# for lookaround (`(?=)`/`(?!)`/`(?<=)`/`(?<!)`) and backreferences (`\1`,
# `\k<name>`) — the JS constructs Rust `regex` alone cannot express. node-js
# translates the JS source into fancy-regex syntax (see src/regexp.rs).
fancy-regex = "0.18"
# Still used directly for the `regex`-native escape/quote helpers and re-exported
# types; fancy-regex builds on top of it.
regex = "1"
unicode-normalization = "0.1.25"

[dev-dependencies]
tempfile = "3"