Skip to content

Standard Library Overview

The Shape standard library provides modules for common programming tasks. Modules are organized into native (Rust-backed), core (pure Shape), math, and domain libraries.

These modules are implemented in Rust and provide high-performance operations:

ModuleDescription
ioFile I/O, path operations, networking, and process management
fileFile reading and writing utilities (text)
jsonJSON parsing and serialization with Json enum + typed deserialization
csvCSV parsing, records, and serialization
msgpackMessagePack binary serialization (hex + bytes variants)
tomlTOML parsing and serialization
yamlYAML parsing and serialization (single and multi-document)
xmlXML parsing and serialization
httpAsync HTTP client (GET, POST/PUT text/bytes/json, DELETE)
timeMonotonic timing, async sleep, benchmark, wall-clock millis
envEnvironment variables, args, cwd, OS / arch info
regexRegular expression matching, replacement, splitting
cryptoSHA-1/256/512, MD5, HMAC, base64/hex, Ed25519 signatures
unicodeNormalization, category lookup, grapheme clusters
compressData compression (gzip, zstd, deflate)
archiveArchive creation and extraction (tar, zip)
parallelData-parallel array operations (planned; bindings not yet wired)
mathMath primitives: bare global builtins + std::core::math constants and trig

Written in Shape, these provide essential data structures, scientific primitives, and utilities:

ModuleDescription
stateContent-addressed VM state capture / resume / hash / diff / patch
snapshotSuspension-point snapshot primitive
mathStatistical functions (sum, mean, std, variance, percentile, zscore)
randomRandom number generation (ChaCha8 PRNG)
distributionsStatistical distributions: samplers, PDFs, CDFs
stochasticStochastic processes (Brownian, GBM, OU, random walk)
monte_carloMonte Carlo runner with variance-reduction methods
odeODE integrators (Euler, RK4, RK45 adaptive)
collectionsAdvanced collection types
setUnordered collection of unique elements
logStructured logging with level filtering
testingUnit test assertions
property_testingProperty-based / QuickCheck-style testing
rollingRolling-window aggregations on numeric arrays
remote@remote annotation and remote function execution
transportDistributed transport interface (TCP, QUIC)

Specialized math libraries under std::math:::

ModuleDescription
linalgVector operations on Array<number> (dot, cross, norm, normalize, scale, add, sub)
interpolationBilinear and trilinear grid interpolation
optimizeNelder-Mead simplex minimizer
rotation3D rotation math (Euler angles, matrices, composition)

Specialized libraries for specific application domains:

ModuleDescription
financeFinancial data types, risk metrics, indicators, backtesting
physicsNewtonian mechanics, collision detection
iotIoT device monitoring, anomaly detection
simulationGeneric simulation framework (also lives at std::core::simulation)