Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cargo features

recast (the binary) and recast-core (the library) expose a matching set of cargo features so users can opt out of grammars or modes they don’t need.

recast binary

FeatureDefaultPulls in
scriptrecast-core/script (Rhai callback)
lang-rusttree-sitter + tree-sitter-rust
lang-tstree-sitter + tree-sitter-typescript
lang-jstree-sitter + tree-sitter-javascript
lang-pythontree-sitter + tree-sitter-python
lang-bashtree-sitter + tree-sitter-bash
lang-gotree-sitter + tree-sitter-go
lang-jsontree-sitter + tree-sitter-json
lang-mdtree-sitter + tree-sitter-md
lang-allMeta — enables every lang-* above

Stock install:

cargo install --path crates/recast

Slim install — Rust grammar only, no script engine:

cargo install --path crates/recast \
  --no-default-features \
  --features lang-rust

Slim install — Python + TypeScript only:

cargo install --path crates/recast \
  --no-default-features \
  --features lang-python,lang-ts

recast-core library

The library exposes the same lang-* features plus serde (JSON output schema). At least one lang-* must be enabled for structural mode to compile in.

Binary size

Each grammar adds ~5–15 MB of compiled tables. The full --features lang-all binary is ~80 MB. A slim lang-rust-only build is ~25 MB. Static musl builds are a few MB larger.