[package]
name = "tishlang_core"
version = "2.8.0"
edition = "2021"
description = "Shared Value type and utilities for Tish (used by interpreter and runtime)"

license-file = { workspace = true }
repository = { workspace = true }
[features]
default = []
regex = ["dep:fancy-regex"]
# Make `Value` (and its array / object / regex payloads) `Send + Sync` by
# switching the interior `Rc<RefCell<T>>` to `Arc<Mutex<T>>` and the native
# function type from `Rc<dyn Fn>` to `Arc<dyn Fn + Send + Sync>`. Enabled
# transitively by any crate that needs to pass `Value`s across threads —
# most notably `tishlang_runtime/http`, which dispatches HTTP handlers
# across a worker pool. Off by default so wasm / wasi / cranelift / llvm /
# interpreter builds pay no atomic-ref-count or mutex overhead.
send-values = ["dep:parking_lot"]

[dependencies]
ahash = "0.8.11"
arcstr = "1"
smallvec = "1"
indexmap = "2"
# Fast integer→decimal for the JSON.stringify number fast-path (already in the workspace lock).
itoa = "1"
fancy-regex = { version = "0.17.0", optional = true }
# Only under `send-values` (the Arc<Mutex> path): parking_lot's uncontended lock is a
# single atomic with no pthread syscall — profiled as a top cost on object/array access.
parking_lot = { version = "0.12", optional = true }

[target.wasm32-unknown-unknown.dependencies]
getrandom = { version = "0.3", features = ["wasm_js"] }
