zdc-runtime 0.1.0

Embeds the ZDeceptron JavaScript runtime and evaluates it without an external toolchain.
Documentation
  • Coverage
  • 85%
    34 out of 40 items documented0 out of 11 items with examples
  • Size
  • Source code size: 368.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.32 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 28s Average build duration of successful builds.
  • all releases: 28s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • DrDrewCain/zdeceptron
    1 0 67
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DrDrewCain

The ZDeceptron JavaScript runtime, embedded and executable from Rust.

The runtime library that generated code links against is written in JavaScript, because it manipulates the DOM and there is no other way to do that (spec §14E.2). But verifying it must not require a JavaScript toolchain: needing Node to build ZDeceptron would be the first crack in the claim that a developer installs one binary and nothing else.

So the sources are embedded here and evaluated with a pure-Rust engine. cargo test covers the runtime; nothing else has to be installed.

Two halves, and why the seam is a feature

Holding the runtime sources and running them are different jobs, and the evaluate feature is where they part. Everything above the seam is text and plain data — the .js and .css a bundle ships, and the signatures a capability is written against. Everything below it is boa_engine, a JavaScript interpreter written in Rust.

The seam is cut here rather than left implicit because boa_engine reaches getrandom, and getrandom will not build for wasm32-unknown-unknown without an entropy backend chosen by --cfg. zdc-codegen depends on this crate for seven const &strs, so without the seam the entire front end inherited that refusal and no part of this compiler could run in a browser (#171). See the feature's comment in Cargo.toml for the dependency chain in full.