Tea — a strongly typed scripting language
Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

Agent documentationContributingCommunityRepository

Language Runtime

Built-ins

Standard Library

std.argsstd.assertstd.audiostd.encodingstd.envstd.fsstd.hashstd.httpstd.netstd.jsonstd.mathstd.parsestd.pathstd.processstd.randomstd.raylibstd.regexstd.stringstd.timestd.url

Read as Markdown

Standard Library

std.json

JSON values with checked parsing and schema validation.

Exported functions

pub def encode[T](value: T) -> String

Encode a value as JSON. Use Dynamic explicitly for heterogeneous dictionaries and lists.

pub def decode[T](text: String) -> T ! DecodeError

Parse JSON and validate every nested value against T before returning. Supports Int, Float, Bool, String, List, Dict, optional values, and Dynamic. JSON objects remain dictionaries; nominal structs require explicit construction.

Examples

use json from "std.json"

const config = json.decode[Dict[String, String]](`{"theme":"dark"}`)
@println(config["theme"] ?? "default") # dark