Preview. Stack v4.0 has not been released, and what is documented here can still change before it does. The current release is v3.2.Go to v3.2
Numscript

Selecting an Interpreter

Select a Numscript interpreter and understand which runtimes are available for each Ledger release.

Ledger 3.0 ships a single Numscript interpreter — the portable one — so there is no interpreter to choose: no runtime field on a transaction request and no ledger.experimental-* server setting to turn on.

Every experimental feature is available, and the server restricts none of them. Each script opts in to the ones it uses by declaring a #![feature("...")] pragma before the rest of the script, so a feature is enabled per script rather than per request or per cluster. Declaring #![feature("experimental-oneof")], for example, makes oneof available to that script alone.

FeaturePragmaWhat it does
OneOfexperimental-oneofConditional routing based on availability
Account interpolationexperimental-account-interpolationDynamic addresses such as @escrow:$order_id
Mid-script function callsexperimental-mid-script-function-callQuery balances during execution
Overdraft functionexperimental-overdraft-functionDynamic overdraft calculation
get_assetexperimental-get-asset-functionExtract the asset from a monetary value
get_amountexperimental-get-amount-functionExtract the amount from a monetary value
Asset colorsexperimental-asset-colorsTrack fund origins with colored assets

To submit a script, see Numscript transactions.

The Numscript playground runs the same interpreter. Its feature flags selector is a playground control that stands in for the pragmas above; against Ledger 3.0, declare the pragma in the script itself.