A meter and a second are different things.
Units combine through arithmetic. Multiplying a distance by a rate gives a new dimension. Adding incompatible dimensions produces a type error.
Kornwolf Research · language + runtime
Programs that know a price from a duration.
KrankScript works with asset amounts, prices, units, time and live Series. The language gives each value a type the compiler understands. Hosts supply the market data, world state and actions that programs use.
Amount · BTC
Price<BTC, USDT>
Duration<millisecond>
Series<Price<BTC, USDT>>
01 · Semantic values
A duration counts milliseconds or seconds. An amount belongs to BTC or USDT. A timestamp identifies a point in time. Krank can check these distinctions while it compiles your program.
Units combine through arithmetic. Multiplying a distance by a rate gives a new dimension. Adding incompatible dimensions produces a type error.
An amount of BTC and an amount of USDT have different types, even when both are stored as numbers.
Instants, durations, intervals, calendar dates and time zones follow different rules. Type checking can catch a mix-up before it runs.
One definition
The same type description drives compiler checks, runtime validation, serialization and editor help.
type identity
operations
result typesvalidation normalization serialization
completion hover diagnostics
02 · Arithmetic + lowering
Krank tracks the asset, unit and precision of a value. The compiler can then lower it to fixed-point, floating-point or vector operations that meet the program’s accuracy requirements.
Multiplication, division and powers derive dimensions and compound semantic types, keeping results typed through arithmetic.
Workloads can state the precision they need. The runtime can pick an implementation that meets the contract without paying for stronger arithmetic everywhere.
Parsing and wire formats live at external boundaries. Inside a Krank program, values keep their semantic types.
Types retain enough structure for diagnostics, schemas, editor help and runtime inspection to describe the value in domain terms.
Executable proof
The example uses the KrankScript compiler and portable runtime. Its run record shows the Kornwolf host interface, artifact fingerprint, resource use and computed value.
use kornwolf::market::plot scaled = close * 1.01 + 100 plot(scaled)
interface kornwolf.market@2026.10.04 type series<float> fingerprint fnv1a64:b8e07b0c0fce0409
fuel 9 host calls 2 outputs 1 value [110.1, 120.2]
03 · Time + causality
Market bars, sensor readings and strategy signals arrive over time. Krank records their order and state so a program can replay market history, simulate a run and process live updates.
loading executable Series demo…
A new bar updates the affected indicators and signals. Earlier values stay available for history and replay.
Host calls, writes and model requests carry effects that the runtime can track through execution and replay.
Tasks carry cancellation, resource budgets and backpressure rules the runtime can enforce.
04 · Hosts
KrankScript uses .ks files. Kornwolf adds market data and trading capabilities. Axora adds worlds, scenes and audio. Each host provides typed modules to the same language and runtime. Pine v6 compatibility work tracks a separate .pine frontend.
.ks
core language
portable libraries
typed capabilities.ks
kornwolf::market
kornwolf::alerts
strategy policy.ks
axora::world
sensorium + audio
creator capabilitiesParser-backed examples
These .ks examples pass the current parser. Their host modules come from Kornwolf and Axora. The syntax is still evolving.
use kornwolf::market::{market, plot} btc = market("BINANCE:BTCUSDT").bars("1m") eth = market("BINANCE:ETHUSDT").bars("1m") z = zscore(log(btc.close) - log(eth.close), 240) plot(z, label: "BTC / ETH relative value")
05 · Capability atlas
Explore the compiler, execution engine, Series model, host integration and Pine v6 coverage. Each area shows its current development stage.
06 · Toolchain
Tree-sitter parses KrankScript as you type. The Rust compiler and language server provide analysis, diagnostics and completion. Browser adapters bring those tools into web editors.
Incremental parsing and highlight queries for editor and browser use.
Syntax, semantic analysis and runtime work share typed internal structures.
Diagnostics, completion and navigation can use the same semantic definitions.
The language package exposes source identity and linked host metadata to web tools.