Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ling — The Omniglot Systems Language

Ling is a polyglot scripting language whose keywords and builtins are available in 16+ human languages simultaneously — Chinese, Thai, Korean, Japanese, English, Arabic, Hebrew, Russian, and more — in the same source file.

# All four in one file:
令 启 = 执 { 印("你好") }          # Chinese
令 เริ่ม = ดำเนินการ { พิมพ์("สวัสดี") }  # Thai
bind start = do { print("Hello") }   # English
바인드 시작 = 수행 { 인쇄("안녕") }      # Korean

Core features

  • Polyglot keywords — write loops in Chinese, functions in Thai, variables in English
  • 3D software renderer — vector geometry (vtex_*) and pixel textures (tex_*)
  • 4D spatial audio — pentatonic synthesis with positional mixing
  • FFT analysis — frequency bands from any audio source
  • Cross-platform — native Windows/macOS/Linux and WebGL2 WASM

Crates

CrateVersionPurpose
ling-lang2030.1.3Main interpreter binary
ling-core2030.0.0Core types
ling-audio2030.0.04D audio + FFT
ling-game2030.0.0ECS, mesh, physics
ling-graphics2030.0.03D/4D rendering
ling-crypto2030.0.0Cryptography
ling-net2030.0.0Async networking
ling-ai2030.0.0LLM / neural nets

Quick navigation

Ling — Showcase

Ling is the omniglot creative-systems language: you write the same program in English, 中文, 日本語, 한국어, or ไทย — keywords, builtins, even file names — and it runs identically. One small native binary gives you a 3D/4D holographic renderer, vector fonts, a UI toolkit, a music studio (decode · BPM/key · GM synth · MIDI · karaoke), spatial audio, post-quantum crypto, and a physics lab — no engine install, no package soup.

# the same program, four ways — all run:
bind start = do { open_window(800, 600)  draw_disc(400.0, 300.0, 120.0)  present() }
绑定 开始 = 做 { 开窗(800.0, 600.0)  画实心圆(400.0, 300.0, 120.0)  显() }
バインド 開始 = 実行 { ウィンドウ開く(800,600)  塗りつぶし円(400,300,120)  表示() }
ผูก เริ่ม = ทำ { เปิดหน้าต่าง(800,600)  วาดวงกลมทึบ(400,300,120)  แสดงผล() }

lingfu normalize <lang> rewrites any Ling project into a single language — so a team can each read the code in their own tongue and commit a normalized form.

What makes Ling unique

  • Polyglot by design — five human languages are first-class, not comments or i18n strings. Every keyword and ~hundreds of builtins have native aliases; the lexer/parser accept any mix.
  • Batteries welded in — graphics, vector fonts, UI, music, MIDI, spatial audio, crypto, physics and AI tensors ship in the one toolchain. First pixel in ~5 lines.
  • 3D and 4D / holographic — a depth-sorted software renderer with a cel/holographic shader, 4D camera projection, and vector-texture primitives (vtex_*).
  • Resolution-independent vector fonts — TrueType outlines cached as .ling glyph files and rendered (stroke or fill) crisp in 2D/3D/4D, in every script (灵 · ABC · あ · 가 · ก).
  • A real music layer — load WAV/FLAC/OGG/MP3, extract BPM & musical key, synthesize any GM-style instrument from a .ling patch, read MIDI, build rhythm games & karaoke.
  • Post-quantum crypto built in — hashes, AEAD, signatures, ML-KEM/X25519 hybrids, Shamir, Schnorr/VRF — usable from a script in one call.
  • Physics from a script — rigid + angular dynamics, deformable soft-body meshes, and a fast immiscible water/oil liquid sim that maps onto plane/sphere/cylinder/cone/dome.
  • Tiny & native — one binary, software-rendered (no GPU driver required), runs headless for CI frame-capture; also targets WASM.

How Ling compares

Legend: ● built-in · ◐ partial / via add-on · ○ not a goal.

CapabilityLingUnityGodotBevy (Rust)Pygamep5.jsLÖVE
Source in 5 human languages
Single self-contained binary
No GPU/driver required (software)
3D rendering
4D / hyperbolic / holographic
Vector fonts (2D/3D/4D)
Immediate-mode UI toolkit
Audio playback
Spatial (3D/4D) audio + FX
BPM / musical-key analysis
GM-style synth from a patch file
MIDI load + rhythm/karaoke kit
Rigid + angular physics
Soft-body / deformable mesh
Fast immiscible liquid sim
Post-quantum crypto built in
Headless CI frame capture
Lines to first pixel~5many~15~40~10~5~8

Comparisons are about what ships in the box. Mature engines like Unity/Godot/Bevy have far deeper 3D pipelines, tooling and ecosystems — Ling’s angle is breadth-in-one-binary plus the things no one else has: truly multilingual source, 4D/holographic vector rendering, built-in music analysis + GM synth, and post-quantum crypto.

See it run

DemoWhat it shows
examples/music/hallway_runner.lingAuto-playing FFT-reactive infinite runner; MIDI-driven coins ring the melody as spatial SFX
examples/music/karaoke_hero.lingKaraoke-Hero pitch bars from a vocal MIDI + live mic tuner
examples/music/synth_jam.lingGM instruments synthesized from .ling patches
examples/physics/bouncy_ball.lingSpring-mass soft body squashing as it bounces
examples/physics/tumbling.lingRigid bodies tumbling & rolling (angular dynamics)
examples/physics/liquid_marble.lingWater+oil sim mapped onto a spinning sphere/cone/dome
examples/ui/hud_showcase.lingThe full vector UI toolkit (HUD, meters, controls, game UI)
examples/crypto/crypto_donut_physics.lingA SHA3 hash → a bouncing knot-torus with reactive audio
cargo run --bin ling -- examples/physics/liquid_marble.ling

See the full reference (in 5 languages) at https://docs.ling-lang.org.

Installation

From crates.io

cargo install ling-lang

From source

git clone https://github.com/taellinglin/ling
cd ling
cargo build --release
# binary at target/release/ling

Requirements

  • Rust 1.75+
  • On Linux: libasound2-dev (for audio)
  • On macOS/Windows: no extra dependencies

Run a script

ling examples/basics/thai_hello_world.ling

Hello World

Ling supports any Unicode identifier. All built-in keywords work in every supported language simultaneously in the same source file.

English

bind start = do {
    print("Hello, World!")
}

Chinese 中文

令 启 = 执 {
    印("你好,世界!")
}

Thai ภาษาไทย

ผูก เริ่ม = ทำ {
    พิมพ์("สวัสดีชาวโลก")
}

Korean 한국어

바인드 시작 = 실행 {
    print("안녕하세요, 세계!")
}

Mixed (all valid simultaneously)

令 启 = 执 {
    若 true {
        印("Hello from 中文!")
    }
    bind x = 42
    println(x)
}

Your First 3D Room

A minimal windowed scene with a floor grid and a spinning chakra mandala.

令 PI = 3.14159265

令 启 = 执 {
    open_fullscreen("My First Room")
    set_ambient(0.15)

    令 帧 = 0

    循 window_is_open() {
        fill(0, 0, 8)           # deep-blue background

        令 ry = 帧 * 0.0006
        set_camera(cos(ry), sin(ry), 1.0, 0.0)
        set_camera_pos(sin(ry) * 6.0, 1.0, cos(ry) * 6.0)
        set_zdist(2.0)

        # Floor grid
        vtex_grid(0, -3, 0,  1,0,0,  0,0,1,  8, 8,  1.0, 1.0,  帧*0.0001, 1.57)

        # Spinning mandala
        vtex_chakra(0, 0, 0,  1,0,0,  0,1,0,  2.5, 8,  帧*0.0005, 3.50)
        vtex_lotus( 0, 0, 0,  1,0,0,  0,1,0,  0.6, 2.2, 8,  帧*0.0004, 2.10)

        display()
        令 帧 = 帧 + 1
    }
}

Save as room.ling and run:

ling room.ling

Press Escape or close the window to exit.

Syntax Reference

Ling is an expression-oriented language with a clean, minimal syntax. Every keyword below has equivalents in all supported lexicons — see Keyword Aliases for the full table.

Binding (variable declaration)

令 x = 42
令 name = "Ling"
令 flag = true

Re-binding shadows the previous binding in the same scope:

令 i = 0
令 i = i + 1   # i is now 1

Functions

函 add(a, b) {
    返 a + b
}

Functions are values and can be stored in bindings:

令 square = 函 (n) { 返 n * n }
令 result = square(7)   # 49

Do blocks ()

A block evaluates all statements and returns the value of the last one. The entry point of every Ling program is 令 启 = 执 { ... }.

令 启 = 执 {
    令 x = 10
    令 y = 20
    印(x + y)
}

Conditionals

若 x > 0 {
    印("positive")
}

若 x > 0 {
    印("positive")
} 否则 {
    印("non-positive")
}

While loops

令 i = 0
循 i < 10 {
    印(i)
    令 i = i + 1
}

Note: Ling has no unary minus operator. Write 0 - x instead of -x.

Lists

令 lst = list_new()
令 lst = list_push(lst, 42)
令 lst = list_push(lst, "hello")
令 n   = list_len(lst)         # 2
令 v   = list_get(lst, 0)      # 42

Comments

# This is a comment
令 x = 1   # inline comment

Arithmetic and comparison

令 sum  = a + b
令 diff = a - b
令 prod = a * b
令 quot = a / b
令 rem  = a % b
令 eq   = a == b
令 neq  = a != b
令 lt   = a < b
令 lte  = a <= b
令 gt   = a > b
令 gte  = a >= b

Built-in math functions

sin(x)   cos(x)   tan(x)
asin(x)  acos(x)  atan2(y, x)
sqrt(x)  abs(x)   floor(x)   ceil(x)
log(x)   exp(x)   pow(x, y)

Core Builtins Reference

All builtins support multilingual names — see Builtin Aliases for the full international lookup table.

Every alias listed in the 5-language tables below is accepted by the interpreter, the lexer/parser, and the lingfu normalize command, so an English program normalized to any of these languages runs unchanged. The interpreter accepts the union of every alias, so you can mix languages in one file.

Output · Core

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
print / println / 打印印刷출력พิมพ์Print value(s) to stdout
format格式フォーマット서식รูปแบบFormat string with args
ok良し좋아โอเคWrap value as Ok
bad / err悪い나쁨ผิดWrap value as Err
sleep睡眠眠る / スリープ잠자기 / หยุด / นอนSleep for N ms

Math

All math args and results are f64. Angles are in radians.

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
sin正弦サイン사인ไซน์Sine
cos余弦コサイン코사인โคไซน์Cosine
tan正切タンジェント탄젠트แทนเจนต์Tangent
asin反正弦アークサイン아크사인อาร์กไซน์Arcsine
acos反余弦アークコサイン아크코사인อาร์กโคไซน์Arccosine
atan反正切アークタンジェント아크탄젠트อาร์กแทนเจนต์Arctangent
atan2反正切2アークタンジェント2아크탄젠트2Two-arg arctangent
tanh双曲正切双曲線正接쌍곡탄젠트Hyperbolic tangent
sqrt平方根 / 平方根제곱근รากที่สองSquare root
cbrt立方根立方根세제곱근รากที่สามCube root
powべき乗거듭제곱ยกกำลังx raised to y
exp指数指数関数지수e^x
hypot斜边斜辺빗변√(x²+y²)
ln / log对数対数로그ลอการิทึมNatural log
log2 / log10对数2 / 对数10対数2 / 対数10로그2 / 로그10Base-2 / base-10 log
abs绝对值 / 绝对絶対値절댓값 / 절대값ค่าสัมบูรณ์Absolute value
floor向下取整 / 下整床関数내림ปัดลงRound down
ceil向上取整 / 上整天井関数올림ปัดขึ้นRound up
round四舍五入 / 四舍四捨五入반올림ปัดเศษRound to nearest
trunc / int取整 / 整数整数化 / 切り捨て정수화 / 정수ตัดทศนิยมTruncate toward zero
fract小数部分小数部소수부Fractional part
min最小最小최솟값ต่ำสุดMinimum of two
max最大最大최댓값สูงสุดMaximum of two
clamp截取範囲制限범위제한จำกัดClamp to [lo, hi]
pi圆周率円周率파이พายπ constant
tau双周率タウ타우ทาวτ constant (2π)

Cells marked have no native alias in that language yet (English still works everywhere). Filling these is tracked in TODO.md.

Lists

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
list_new新建列表新規リスト새목록รายการใหม่Create empty list
list_push列表添加リスト追加목록추가เพิ่มรายการAppend value, return new list
list_get取元素要素取得요소가져오기รับรายการGet element at index
list_join / join连接連結연결รวมรายการJoin list into a string
len / str_len长度長さ길이ความยาวLength of list or string

Strings

FunctionDescription
str_len(s)Length in characters
str_concat(a, b)Concatenate strings
str_slice(s, start, end)Substring
str_to_num(s)Parse as number
num_to_str(n)Number to string
str_contains(s, sub)Substring test

Type checks

FunctionReturns
is_num(v)true if number
is_str(v)true if string
is_list(v)true if list
is_bool(v)true if boolean

Window & display

See Window & Camera reference.

Vector geometry

See vtex reference.

Pixel textures

See tex reference.

Audio

See Audio reference.

Cryptography & Physics

ling-crypto (Blake3, SHA-3, AES-GCM-256, XChaCha20, Ed25519, X25519, Shamir, Schnorr, VRF …) and ling-physics (vectors, rigid bodies, forces, hyperbolic geometry) are exposed as Rust crate APIs, not yet as .ling builtins — call them from Rust, or via a host that embeds the interpreter. Coverage is verified by the crate test suites (crates/ling-crypto/tests, crates/ling-physics/tests). Wiring them in as multilingual builtins is tracked in TODO.md.

FFT (native only, no-op on WASM)

FunctionDescription
fft_push(samples)Feed list of f32 samples to analyzer
fft_bands(n)Return n log-spaced magnitude bands (0..1)
fft_beat()true if current frame energy exceeds average
fft_beat_ratio()energy ratio (1.0 = threshold)
fft_rms()RMS level of current window
fft_dominant_freq()Peak frequency in Hz

3-D Primitive Shapes

The shape builtins are Ling’s “Inkscape for 3-D” — a library of parametric solids (boxes, spheres, dice, cogs, gyros…) that render as lit filled triangles, wireframe, or both. Every shape shares one uniform call signature, so once you know one you know them all.

name(cx,cy,cz,  sx,sy,sz,  rx,ry,rz,  mode,  e0, e1, e2)
GroupParamsMeaning
Centrecx, cy, czworld-space position of the shape’s centre
Scalesx, sy, szper-axis size (half-extent). Non-uniform values give stretched cubes, ellipsoids, flat discs, …
Rotationrx, ry, rzEuler rotation in radians, applied X → Y → Z
Modemode0 = filled · 1 = wireframe · 2 = both (wire drawn on top)
Extrase0, e1, e2shape-specific (segment counts, sides, ratios). Omit or pass 0 for sensible defaults

The current pen colour (set_color / สีดินสอ / 设色 …) drives both the fill lighting (cel-shaded against the active lights) and the wireframe colour. Shapes are depth-sorted with the rest of the scene and flushed on present().

Camera note: like all 3-D draws, shapes are projected through the camera set with set_camera(...). Keep the camera at the origin and place shapes in front at positive Z (the same convention the room demos use).


Quick start

bind start = do {
    open_fullscreen("shapes")
    set_ambient(0.25)
    add_light(4, 4, 8, 4.0, 255, 240, 220)

    bind FR = 0
    while window_is_open() {
        fill(4, 5, 12)
        set_camera(1, 0, 1, 0)
        bind a = FR * 0.02

        set_color(230, 120, 90)
        cube(-2, 0, 9,  0.8,0.8,0.8,  a, a*0.7, 0,  0)        # filled cube

        set_color(120, 200, 255)
        icosahedron(0, 0, 9,  0.9,0.9,0.9,  a, a, 0,  2)      # d20, fill+wire

        set_color(190, 190, 200)
        gear(2, 0, 9,  0.8,0.3,0.8,  1.57, a*2, 0,  0,  14, 0.3)  # spinning cog

        present()
        bind FR = FR + 1
    }
}

Draw modes

modeResult
0Filled — cel-lit triangles
1Wireframe — edges only, in the pen colour
2Both — filled, with the wireframe biased slightly nearer so it reads on top

Rendering & lighting modes (holographic cel)

Shape fills use an anime / holographic cel model by default: surfaces are lit with smooth (averaged) vertex normals, the lit colour is interpolated across each triangle, then posterised per pixel into crisp luminance bands. The result is smooth shading with no faceted triangle edges, but clean toon bands that curve over the surface — plus coloured lights, coloured shadows, and a Fresnel rim glow.

BuiltinArgsEffect
set_shade_mode(m)0 flat · 1 cel · 2 holo (default)overall style
set_cel_bands(n)n ≥ 2 (default 4)number of posterisation bands — lower = chunkier
set_shadow_color(r,g,b)0–255tint of unlit regions (coloured shadows)
set_rim(strength, r,g,b)strength + 0–255Fresnel edge-glow colour/intensity
set_shade_mode(2)            # holographic cel (default)
set_cel_bands(4)             # 4 bands
set_shadow_color(28,36,90)   # cool indigo shadows
set_rim(0.7, 120,220,255)    # cyan holographic edge
  • Mode 0 (flat): legacy per-face cel — every triangle one flat band (faceted).
  • Mode 1 (cel): smooth bands, no rim/sheen — clean toon.
  • Mode 2 (holo): smooth bands + Fresnel rim + a subtle normal-gradient sheen.

Lighting comes from add_light(x,y,z, intensity, r,g,b) (each light contributes its own colour) and set_ambient(level). The lighting math lives in the ling-graphics crate (ling_graphics::shading).


Round & swept solids

cube · box立方体 · 方块 · 정육면체 · ลูกบาศก์ (box: 方块//상자/กล่อง)

Axis-aligned box. Non-uniform sx,sy,sz make any rectangular block.

cube(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode)

sphere球体 · · · ทรงกลม

UV sphere. Scale axes independently for an ellipsoid.

sphere(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=16, rings=12)

icosphere二十面球 · アイコ球 · 아이코구체 · ทรงกลมเหลี่ยม

Geodesic sphere from a subdivided icosahedron (more even than a UV sphere).

icosphere(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  subdivisions=1)   # 0..4

dome穹顶 · ドーム · · โดม

Hemisphere with a closing base — useful for cupolas and skies.

dome(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=24, rings=8)

cylinder圆柱 · 円柱 · 원기둥 · ทรงกระบอก

Capped tube (height runs along local Y, scaled by sy).

cylinder(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=24)

cone圆锥 · 円錐 · 원뿔 · กรวย

Capped cone, apex at +Y.

cone(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=24)

capsule胶囊 · カプセル · 캡슐 · แคปซูล

Cylinder with hemispherical caps (a “pill”).

capsule(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=16, rings=6)

torus · ring圆环 · トーラス · 토러스 · ทอรัส

Donut. tube is the tube radius as a fraction of the outer radius.

torus(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=32, sides=12, tube=0.35)

Prisms & pyramids

pyramid金字塔 · ピラミッド · 피라미드 · พีระมิด

N-sided pyramid. sides=4 is the classic square pyramid.

pyramid(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  sides=4)

prism棱柱 · 角柱 · 각기둥 · ปริซึม

N-sided prism (extruded polygon). sides=3 → triangular prism, 6 → hex column.

prism(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  sides=6)

frustum棱台 · 錐台 · 원뿔대 · กรวยตัด

Truncated cone/pyramid. top_ratio is the top radius as a fraction of the base (0 → cone, 1 → cylinder).

frustum(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  sides=24, top_ratio=0.5)

Dice (Platonic solids)

Perfect for dice, gems, and crystal shapes — all take no extra params.

BuiltinDieAliases
tetrahedrond4d4 · 四面体 · 정사면체 · ทรงสี่หน้า
cubed6(see above)
octahedrond8d8 · 八面体 · 정팔면체 · ทรงแปดหน้า
dodecahedrond12d12 · 十二面体 · 정십이면체 · ทรงสิบสองหน้า
icosahedrond20d20 · 二十面体 · 정이십면체 · ทรงยี่สิบหน้า
icosahedron(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode)
d20(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode)          # same thing

Mechanical & architectural

gear · cog齿轮 · 歯車 · 톱니바퀴 · เฟือง

Extruded spur gear in the XZ plane. teeth count and tooth depth are configurable; thickness comes from sy.

gear(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  teeth=12, tooth=0.25)

gyro陀螺 · ジャイロ · 자이로 · ไจโร

Nested gimbal: rings concentric tori on alternating axes — a gyroscope / armillary.

gyro(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  rings=3)

arch拱门 · アーチ · 아치 · ซุ้มโค้ง

Semicircular archway (tube swept over 180°).

arch(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=24, tube=0.18)

stairs楼梯 · 階段 · 계단 · บันได

Staircase of steps cuboid steps rising along +Y/+Z.

stairs(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  steps=5)

Curves & surfaces

helix螺旋线 · らせん · 나선 · เกลียว

Tube swept along a helix around Y.

helix(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  turns=3, tube=0.15, sides=8)

spring弹簧 · ばね · 스프링 · สปริง

A tighter, thinner helix (coil). Same params as helix.

spring(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  turns=6, tube=0.12, sides=8)

star_prism · star星柱 · 별기둥 · แท่งดาว

An N-point star cross-section extruded along Y.

star_prism(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  points=5, inner_ratio=0.5)

capsule_chain · chain胶囊链 · カプセル鎖 · 캡슐체인 · โซ่แคปซูล

A row of count capsule beads along X — a chain / caterpillar.

capsule_chain(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  count=3)

mobius莫比乌斯 · メビウス · 뫼비우스 · เมอบีอุส

A half-twisted Möbius band.

mobius(cx,cy,cz, sx,sy,sz, rx,ry,rz, mode,  segments=60, width=0.3)

Tips

  • Flat disc / plate: cylinder with a small sy (e.g. 0.05).
  • Ellipsoid: sphere with unequal sx,sy,sz.
  • Obelisk: frustum with a small top_ratio and tall sy.
  • Animate by feeding the frame counter into rx,ry,rz each frame.
  • Outlined solid: use mode = 2 and a bright pen colour for a crisp cel-look with ink edges.

All shape names are available in every Ling language; see Builtin Aliases by Language.

Vector Geometry Builtins (vtex_*)

All vtex_* functions draw line-based 3D geometry onto a plane defined by:

  • Centre (cx, cy, cz) — world-space anchor point
  • U tangent (ux, uy, uz) — “right” direction in the plane
  • V tangent (vx, vy, vz) — “up” direction in the plane

Lines are depth-sorted and drawn on top of the pixel buffer when present() / แสดงผล() / 显() / 表示() / 표시() is called.

Performance tip: vtex calls are fast (pure line rasterisation). Prefer them over tex_* for real-time use — a tex_mandelbrot on a 1920×1080 window is ~2 million pixel ops per call; a vtex_rings with 32 segments is ~32 line ops.


Common plane orientations

# Horizontal plane (floor / ceiling): U=right, V=forward
1,0,0,  0,0,1

# Vertical front-facing plane (wall / mandala disc): U=right, V=up
1,0,0,  0,1,0

# Vertical side-facing plane (left/right wall): U=forward, V=up
0,0,1,  0,1,0

Primitives

vtex_grid · ลายตาราง · 纹格 · 格子模様 · 격자무늬

Rectilinear grid.

vtex_grid(cx,cy,cz, ux,uy,uz, vx,vy,vz,  cols, rows, cell_w, cell_h,  fr, hue)
ParamDefaultDescription
colsnumber of columns
rowsnumber of rows
cell_wcell width in world units
cell_hcell height in world units
frframe counter (drives colour animation)
huecolour phase offset

vtex_rings · ลายวงซ้อน · 纹环 · 同心円 · 동심원

Concentric N-sided polygon rings with optional twist.

vtex_rings(cx,cy,cz, ux,uy,uz, vx,vy,vz,  n_rings, n_sides, max_r, twist,  fr, hue)
ParamDescription
n_ringsnumber of concentric rings
n_sidespolygon sides per ring (32 = smooth circle)
max_router ring radius
twistextra rotation per ring in radians (creates vortex)

vtex_star · ลายดาว · 纹星 · 星模様 · 별무늬

Alternating outer/inner star polygon.

vtex_star(cx,cy,cz, ux,uy,uz, vx,vy,vz,  n_points, r_outer, r_inner, rot_speed,  fr, hue)

vtex_spiral · ลายเกลียว · 纹螺 · 螺旋 · 나선

Archimedean spiral.

vtex_spiral(cx,cy,cz, ux,uy,uz, vx,vy,vz,  n_turns, max_r, n_steps,  fr, hue)

vtex_flower · ลายดอก · 纹花 · 花模様 · 꽃무늬

Flower of Life: centre circle plus 6 surrounding circles.

vtex_flower(cx,cy,cz, ux,uy,uz, vx,vy,vz,  radius, n_sides,  fr, hue)

vtex_lotus · ลายดอกบัว · 纹莲 · 蓮模様 · 연꽃무늬

Radial kite-petal lotus.

vtex_lotus(cx,cy,cz, ux,uy,uz, vx,vy,vz,  r_inner, r_outer, n_petals,  fr, hue)

vtex_chakra · ลายจักร · 纹轮 · 輪模様 · 바퀴무늬

Dhamma wheel: outer rim + inner hub + N spokes + tick marks.

vtex_chakra(cx,cy,cz, ux,uy,uz, vx,vy,vz,  r, n_spokes,  fr, hue)

vtex_yantra · ลายยันต์ · 纹咒 · 護符模様 · 부적무늬

Nested interlocked triangle pairs (Sri Yantra style) with bhupura gate square.

vtex_yantra(cx,cy,cz, ux,uy,uz, vx,vy,vz,  n_layers, max_r,  fr, hue)

vtex_spiked_cog · ฟันเฟืองหนาม · 纹棘轮 · 歯車模様 · 톱니바퀴

Mechanical gear with triangular spike teeth, inner body ring, hub, and spokes.

vtex_spiked_cog(cx,cy,cz, ux,uy,uz, vx,vy,vz,
                n_teeth, r_body, r_spike, r_hub, n_spokes,
                fr, hue)
ParamDefaultDescription
n_teeth12number of spike teeth
r_body1.0radius of the flat gear body
r_spike1.3radius of spike tips
r_hub0.2inner hub radius
n_spokes6spokes from hub to body
# Example: ornate gold dharma gear
vtex_spiked_cog(0, 0, 8,  1,0,0,  0,1,0,  18, 1.6, 2.0, 0.28, 9,  FR * 0.0004, 1.57)

vtex_torii · ประตูโทริอิ · 纹鸟居 · 鳥居 · 도리이

Japanese torii gate silhouette: two pillars, straight nuki crossbar, curved kasagi top beam.

vtex_torii(cx,cy,cz, ux,uy,uz, vx,vy,vz,  width, height,  fr, hue)
ParamDefaultDescription
width4.0total gate width
height5.0pillar height
# Gate on the far wall, crimson
vtex_torii(0, 0, 16,  1,0,0,  0,1,0,  6.0, 5.0,  FR * 0.0001, 2.1)

vtex_pagoda · เจดีย์ · 纹塔 · ·

Multi-tiered pagoda silhouette with upturned eaves and spire finial.

vtex_pagoda(cx,cy,cz, ux,uy,uz, vx,vy,vz,
            n_tiers, base_w, tier_h, taper, eave_out,
            fr, hue)
ParamDefaultDescription
n_tiers5number of storeys
base_w2.0half-width of base tier
tier_h1.0height of each tier
taper0.72width reduction per tier
eave_out0.28eave overhang fraction
# 5-tier gold pagoda on back wall
vtex_pagoda(0, 0, 16,  1,0,0,  0,1,0,  5, 2.2, 1.0, 0.72, 0.28,  FR * 0.0001, 1.57)

vtex_halftone · ลายจุด · 纹半调 · 網点模様 · 망점

Cross-hatch dithered fill.

vtex_halftone(cx,cy,cz, ux,uy,uz, vx,vy,vz,  cols, rows, cell_w, cell_h, density,  fr, hue)

vtex_tessellated · ลายตาข่าย · 纹镶嵌 · 網目模様 · 격자망

Animated triangle mesh fill (sine-displaced vertices).

vtex_tessellated(cx,cy,cz, ux,uy,uz, vx,vy,vz,  cols, rows, cell, amplitude, freq,  fr, hue)

vtex_hyperbolic_uv · ลายไฮเพอร์โบลิก · 纹曲面 · 双曲線 · 쌍곡선

Poincaré-disc hyperbolic tiling (concentric circles + geodesic rays).

vtex_hyperbolic_uv(cx,cy,cz, ux,uy,uz, vx,vy,vz,  max_r, n_circles, n_rays,  fr, hue)

vtex_letter_rain · ลายอักษรไหล · 纹字雨 · 文字雨 · 글자비

Falling-glyph rain (Matrix-style, using simplified stroke glyphs).

vtex_letter_rain(cx,cy,cz, ux,uy,uz, vx,vy,vz,  n_cols, n_visible, col_w, row_h, speed,  fr, hue)

Colour system

All vtex functions use the cycle(phase) colour formula:

R = sin(phase)         * 127 + 128
G = sin(phase + 2.094) * 127 + 128   # 120° offset
B = sin(phase + 4.189) * 127 + 128   # 240° offset

Useful hue anchor values for cultural palettes:

Colourhue value
Gold / amber1.57 (π/2)
Jade green3.50
Crimson red2.10
Ivory white0.30
Deep blue4.70
Purple5.80

Pixel Texture Builtins (tex_*)

tex_* functions write RGBA pixels directly to the framebuffer before the depth queue is flushed. They are drawn underneath all vtex_* geometry.

Performance warning: Each tex_* call iterates over every pixel in the destination rectangle. A full-screen 1920×1080 call costs ~2 million iterations. For smooth 60fps, keep tex_* calls to a small off-centre region or reduce window resolution.

All functions share the signature prefix:

tex_*(dst_x, dst_y, width, height,  ...params,  palette)

Palette names: "rainbow" · "fire" · "ocean" · "psychedelic" · "neon" · "forest"


tex_checkerboard · ลายตารางหมากรุก

tex_checkerboard(x, y, w, h,  tiles,  r1,g1,b1,  r2,g2,b2)

Two-colour checker pattern. tiles = number of tiles across the width.


tex_gradient · ลายไล่สี

tex_gradient(x, y, w, h,  angle_deg,  r1,g1,b1,  r2,g2,b2)

Linear gradient at angle_deg degrees.


tex_noise · ลายนอยส์

tex_noise(x, y, w, h,  scale, octaves, seed, palette)

Fractal Brownian Motion noise.

ParamDescription
scaleNoise frequency (higher = finer)
octavesFBM octave count (1–8)
seedRandomisation seed

tex_mandelbrot · ลายแมนเดลบรอต

tex_mandelbrot(x, y, w, h,  zoom, cx, cy, max_iter, palette)
ParamDescription
zoomZoom level (1.0 = full set)
cx, cyCentre of view in the complex plane
max_iterIteration cap (higher = more detail, slower)

tex_julia · ลายจูเลีย

tex_julia(x, y, w, h,  c_re, c_im, max_iter, palette)

Julia set with complex parameter c = c_re + i·c_im.


tex_voronoi · ลายโวโรนอย

tex_voronoi(x, y, w, h,  cells, seed, palette)

tex_ripple · ลายระลอก

tex_ripple(x, y, w, h,  freq, cx, cy, time, palette)

Concentric ripple emanating from (cx, cy) in normalised [0,1] coords.


tex_spiral · ลายเกลียวหมุน

tex_spiral(x, y, w, h,  freq, n_bands, time, palette)

tex_halftone · ลายฮาล์ฟโทน

tex_halftone(x, y, w, h,  dot_size, time, palette)

tex_freq_map · ลายความถี่

tex_freq_map(x, y, w, h,  time, speed, palette)

Audio-reactive frequency bar display. Reads from the last fft_bands() call. Call fft_push(samples) then fft_bands(n) each frame to keep it animated.


Palette reference

NameDescription
"rainbow"Full spectrum cycle
"fire"Red → orange → yellow
"ocean"Blue → cyan → white
"psychedelic"High-saturation cycling
"neon"Bright neon green/cyan/magenta
"forest"Earthy greens and browns

Audio Builtins

Audio builtins are available on native targets. On WASM they are no-ops.

Every builtin below is callable in all five languages — the aliases are accepted by the interpreter and produced by lingfu normalize.

Multilingual names

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 TH
audio_tone音调音調음조เสียงโทน
audio_volume音量音量음량ระดับเสียง
audio_listener音频监听音声リスナー오디오리스너ผู้ฟัง
audio_bgm背景乐BGM배경음악เพลงพื้นหลัง
audio_bgm_volume背景乐音量BGM音量배경음악음량ระดับเสียงพื้นหลัง
fft_push频谱输入FFT入力FFT입력วิเคราะห์เสียง
fft_bands频段周波数帯주파수대แถบความถี่
fft_beat节拍检测ビート検出비트จังหวะเสียง
fft_rms均方根二乗平均RMS레벨ระดับRMS
fft_dominant_freq主频主要周波数주파수ความถี่หลัก

Tone synthesis

# audio_tone(slot, x, y, z, w,  freq_hz, amplitude, lfo_rate, lfo_depth)
audio_tone(0,  0.0, 0.0, 8.0,  1.5,   261.63, 0.08, 0.10, 0.008)
ParamDescription
slotTone slot index (0–15)
x, y, z3D world position of the sound source
wSpatial spread / falloff width
freq_hzOscillator frequency in Hz
amplitudeBase amplitude (0..1)
lfo_rateLFO modulation rate in Hz
lfo_depthLFO depth (0..1)

Volume

audio_volume(0.5)         # master volume
audio_bgm_volume(0.4)     # background music volume

Background music

audio_bgm("path/to/file.wav", 0.5)   # load and play WAV BGM

Listener position

# Must be called each frame to update 3D audio perspective
audio_listener(cos(ry), sin(ry), cos(rx), sin(rx))

Pentatonic reference

Common frequencies for East Asian pentatonic scales:

Note宫 (Gōng)商 (Shāng)角 (Jué)徵 (Zhǐ)羽 (Yǔ)
Octave 3C3 130.81D3 146.83E3 164.81G3 196.00A3 220.00
Octave 4C4 261.63D4 293.66E4 329.63G4 392.00A4 440.00
Octave 5C5 523.25D5 587.33E5 659.25G5 783.99A5 880.00

FFT analysis

# Push mono samples to the rolling FFT window
令 smp = list_new()
令 k = 0
循 k < 64 {
    令 smp = list_push(smp, sin(k * 0.1))
    令 k = k + 1
}
fft_push(smp)

# Get 32 log-spaced frequency bands (values 0..1)
令 bands = fft_bands(32)

# Beat detection
若 fft_beat() {
    印("beat!")
}
令 ratio = fft_beat_ratio()   # 1.0 = at threshold
令 rms   = fft_rms()
令 freq  = fft_dominant_freq()

Builtins — Music & Spatial Audio

ling-music is a full music layer (separate from the SFX-oriented ling-audio): decode any common format, analyse tempo & key, synthesize GM-style instruments from .ling patches, read MIDI, and build rhythm games & karaoke. ling-audio adds positional one-shots, sample playback/loops, and master FX.

Playback & analysis

music_load("song.wav") → id (WAV/FLAC/OGG/MP3/AAC) · music_play(id) / music_pause / music_stop / music_seek(sec) / music_pos() / music_volume(v) / music_duration(id) · music_bpm(id) · music_key(id) → e.g. "A minor" · music_onsets(id) · music_beat_grid(id) · music_fft(id, nbands) → spectrum at the current position (drives reactive visuals).

Synthesis (GM-capable, from .ling patches)

music_patch("instruments/rhodes_ep.ling") → inst · music_note(inst, "C4", dur, vel) · music_note_on(inst, pitch, vel) / music_note_off(inst, pitch). A patch is a small modular FM/subtractive voice (operators + ADSR + filter + LFO) able to approximate any GM family.

MIDI · rhythm · karaoke

music_midi_load("song.mid") → id · music_midi_notes(id)[time,midi,…] · music_midi_bars(id)[time,midi,dur,…] (karaoke note bars) · music_midi_count(id). music_judge(delta_ms) → grade · music_grade_name(g). music_lrc("song.lrc") / music_lyric(id,t). music_mic_pitch() → Hz (sung pitch) · music_note_name(hz) · music_hz(midi) · music_pitch_score(hz, target_hz).

Spatial audio (ling-audio)

audio_tone(idx,x,y,z,w,freq,amp,lfo_rate,lfo_depth) (continuous, 3D/4D) · audio_sfx(x,y,z,w,freq,amp,dur,wave) (positional one-shot) · audio_sample_load(path) / audio_sample_play(id,x,y,z,w,vol,loop) / audio_sample_stop(v) · audio_listener(cry,sry,crx,srx) (match the camera) · audio_volume(v) · master FX: audio_fx_delay(time,fb,mix) · audio_fx_reverb(mix) · audio_fx_lowpass(cutoff) (1.0 = open, lower = muffled/underwater).

See examples/music/{synth_jam,rhythm_game,karaoke_hero,hallway_runner}.ling. Full implemented-vs-missing list: docs/AUDIO_MUSIC_TODO.md.

Builtins — Vector Fonts

Ling renders real TrueType/OpenType fonts as resolution-independent vectors. The first time a glyph is used its outline is extracted and cached as cache/fonts/<font>/<codepoint>.ling (curves preserved), then rendered crisp — stroked or filled, with anti-aliasing — at any size and in 2D or 3D/4D.

BuiltinMeaning
font_load(path [, weight]) → handleLoad a TTF/OTF; optional variable-font weight (e.g. 600 for bold). Returns -1 on failure.
font_text(handle, x, y, px, "text")Anti-aliased stroked outline in the current set_color/set_blend.
font_text_fill(handle, x, y, px, "text")Anti-aliased filled glyphs (solid letterforms).
font_text_3d(handle, cx,cy,cz, ux,uy,uz, vx,vy,vz, size, "text")Stroked text on a 3-D plane (basis u,v), depth-sorted — rotates with the camera and projects through the 4-D pipeline.
font_width(handle, px, "text")Pixel width of a string.

Any script is covered: Latin, 中文, 日本語, 한국어, ไทย all render from the right font (e.g. Noto Sans SC covers Latin + CJK + Thai).

bind f = font_load("assets/fonts/Exo2.ttf", 600.0)
set_color(0, 230, 255)
font_text_fill(f, 40.0, 30.0, 36.0, "LING 灵")
font_text_3d(f, 0.0,0.0,0.0,  1.0,0.0,0.0,  0.0,-1.0,0.0, 0.6, "3D TEXT")

Related: project_3d(x,y,z)[sx,sy,depth] and draw_poly([x0,y0,…]) (filled 2-D polygon, blend-aware) let you place filled vector shapes onto projected 3-D points.

Builtins — UI Toolkit

A vector, theme-coloured immediate-mode widget library (HUD, meters, interface controls, game UI, plus a few faux-3D widgets). All widgets are drawn each frame; interactive ones read the mouse and return their state. Set the palette once with ui_theme; every widget takes an optional trailing r,g,b to override its main colour.

ui_theme(0,210,255,  60,255,180,  40,60,95,  255,90,90,  190,235,255,  10,16,24)

HUD / sci-fi overlays

ui_radar(cx,cy,r,sweep) · ui_compass(x,y,w,h,heading) · ui_reticle(cx,cy,r,spread) · ui_target(x,y,w,h,lock) · ui_panel(x,y,w,h,bevel) · ui_scanlines(x,y,w,h,density)

Meters & gauges

ui_bar(x,y,w,h,value,max) · ui_segbar(…,segs) · ui_gauge(cx,cy,r,value,max) · ui_ring(cx,cy,r,value,max) · ui_vu(x,y,w,h,levels_list) · ui_spark(x,y,w,h,values_list) · ui_battery(x,y,w,h,value,max)

Interface controls (interactive — return state)

ui_button(x,y,w,h) → 1 when clicked · ui_toggle(x,y,w,h,state) → new state · ui_slider(x,y,w,value,min,max) → new value · ui_checkbox(x,y,size,checked) → new checked · ui_tabs(x,y,w,h,count,active) → active index · ui_progress(x,y,w,h,frac) · ui_tooltip(x,y,w,h) · ui_stepper(x,y,w,h,value,step) → new value

Game UI

ui_healthbar(x,y,w,h,hp,max,pulse) · ui_cooldown(cx,cy,r,frac) · ui_counter(x,y,dw,dh,value,digits) (7-segment) · ui_minimap(x,y,w,h) · ui_dpad(cx,cy,r) → direction · ui_slotgrid(x,y,cols,rows,cell,sel) · ui_vignette(intensity, r,g,b)

Faux-3D in 2D space

ui_gauge3d(cx,cy,r,value,spin) · ui_panel3d(x,y,w,h,depth) · ui_radar3d(cx,cy,r,tilt,sweep)

Interface sounds

ui_sound("click"|"hover"|"confirm"|"error"|"toggle"|"tick") · audio_blip(freq,dur,wave,amp)

See examples/ui/hud_showcase.ling.

Builtins — Physics

Ling exposes the ling-physics engine to scripts: rigid bodies with angular dynamics, deformable soft bodies, and a fast 2-D immiscible liquid simulation that maps onto 3-D surfaces. Every builtin has aliases in all five languages (see Builtin Aliases by Language).

Coordinate note: in the renderer +y points down, so “gravity” is a positive y value.

Soft bodies (deformable / bouncy)

A spring-mass sphere that squashes and stretches on impact.

BuiltinMeaning
soft_ball(x, y, z, r) → idCreate a deformable ball at (x,y,z) radius r.
soft_step(id, dt, gravity)Advance the body dt seconds under gravity (y).
soft_bounce(id, floor_y, restitution)Bounce nodes off a horizontal floor.
soft_contain(id, minx,miny,minz, maxx,maxy,maxz, restitution)Keep the body inside a box, bouncing (squashing) off every wall.
soft_kick(id, dx, dy, dz, strength)Impulse the whole body along a direction.
soft_deform(id) → fDeformation factor 0 (round) … 1 (squished).
soft_centroid(id)[x,y,z]Centre of mass.
soft_nodes(id)[x,y,z, …]Flat list of every mesh node — draw it to show the deformed surface.
bind ball = soft_ball(0.0, 0.0-2.5, 0.0, 1.2)
while window_is_open() {
    soft_step(ball, 0.016, 9.0)
    soft_contain(ball, 0.0-4.0,0.0-4.0,0.0-4.0, 4.0,4.0,4.0, 0.55)
    bind ns = soft_nodes(ball)            # draw the squashing mesh
    # … render nodes …
}

See examples/physics/bouncy_ball.ling.

Rigid bodies + angular dynamics

A shared rigid-body world with torque, spin, inertia and a spin-inducing floor bounce, so bodies tumble and roll.

BuiltinMeaning
rb_add(x, y, z, mass) → iAdd a body, returns its index.
rb_gravity(gx, gy, gz)Set world gravity.
rb_torque(i, tx, ty, tz)Apply torque (world axes).
rb_spin(i, wx, wy, wz)Add to angular velocity.
rb_impulse(i, ix, iy, iz)Apply a linear impulse.
rb_floor(i, y, restitution, friction)Bounce off a floor; friction converts motion into roll/spin.
rb_step(dt)Step the whole world (integrate + collide).
rb_pos(i)[x,y,z]Body position.
rb_rot(i)[qx,qy,qz,qw]Body orientation quaternion (rotate your mesh by it).

See examples/physics/tumbling.ling (cubes rotated by rb_rot).

Liquid simulation (water + oil)

Two immiscible density fields advected by one incompressible velocity grid. The fluids only blend at their interface, so the physics decides where the blue (water) and amber (oil) colours mix. Built for speed; wrap makes it seamless for mapping onto curved surfaces.

BuiltinMeaning
liquid_new(w, h) → idCreate a w×h fluid grid.
liquid_splat(id, x, y, kind, amount, radius)Add fluid (kind 0 = water, 1 = oil) in a disc.
liquid_gravity(id, gx, gy)Set the gravity vector (rotate it to slosh).
liquid_step(id, dt)Advance the simulation.
liquid_draw(id, x, y, scale)Fast flat 2-D blit of the colour field.
liquid_draw_surface(id, kind, cx,cy,cz, radius, height)Map/wrap the field onto a 3-D surface — kind: 0 plane · 1 sphere · 2 cylinder · 3 cone · 4 dome.
bind liq = liquid_new(84.0, 84.0)
liquid_splat(liq, 42.0, 25.0, 1.0, 1.0, 3.0)   # oil
liquid_splat(liq, 42.0, 58.0, 0.0, 1.0, 3.0)   # water
while window_is_open() {
    liquid_gravity(liq, sin(time_now())*55.0, cos(time_now())*55.0)
    liquid_step(liq, 0.016)
    set_camera(cos(time_now()*0.3), sin(time_now()*0.3), cos(0.4), sin(0.4))
    liquid_draw_surface(liq, 1.0, 0.0,0.0,0.0, 2.2, 3.2)   # onto a sphere
    present()
}

See examples/physics/liquid_marble.ling.

Builtins — Animation (Anima)

Anima is Ling’s unified animation system (the ling-animation crate). Its guiding idea: one rig, any target, any temperament. Every animated thing — a 2-D vtexture, a 3-D mesh, a particle field, or a bag of scalar parameters — is a rig of abstract joints, driven by composable drivers, and deformed onto its target by a binding.

What makes Anima different is the temperament axis: a per-chain scalar from organic (灵) to mechanical (机) that selects and cross-fades the solver — muscle, breath, jiggle, and IK on one end; exact gear, cam, and linkage coupling on the other. A robot can have organic hydraulic sag; a creature can have a mechanical jaw.

The scalar drivers below are available today as builtins. They are pure functions — call them every frame with the current time (and any state you keep) to drive a scale, a position, a rotation, or a vtex parameter. Each is available in all five languages.

Organic drivers (灵)

EnglishSignatureReturnsDescription
tweentween(a, b, t)numberLinear interpolation a → b, t clamped to [0,1].
tween_easetween_ease(a, b, t, "kind")numberEased interpolation. kind is a curve name (see below).
breathebreathe(t, rate, depth)numberBreathing multiplier centred on 1.0: 1 + depth·sin(2π·rate·t).
wobblewobble(t, freq, amp, phase)numberSecondary sway / jiggle sine.
gait_phasegait_phase(t, speed)numberLocomotion phase in [0,1).
gait_swinggait_swing(t, speed, stride)numberForward/back leg swing for a walk cycle.
gait_liftgait_lift(t, speed, height)numberFoot lift (rises only during the swing half).
spring_tospring_to(pos, vel, target, stiffness, damping, dt)[pos, vel]One spring step (spring-bone / secondary motion). Returns the new position and velocity.
ik2ik2(l1, l2, tx, ty)[shoulder, elbow]Planar two-bone IK: joint angles that reach target (tx, ty).

Easing curve names (for tween_ease)

linear, step, quad_in/out/in_out, cubic_in/out/in_out (smooth), sine_in/out/in_out, expo_in/out/in_out, elastic_in/out (elastic), back_in/out/in_out (overshoot), bounce_in/out (bounce).

Mechanical drivers (机)

EnglishSignatureReturnsDescription
gear_couplegear_couple(angle, teeth_in, teeth_out)numberMeshed-gear output angle — opposite sign, scaled by the tooth ratio.
gear_traingear_train(angle, [t0, t1, t2, …])[angle…]Angles of every gear down a meshed train.
cam_liftcam_lift(angle, lift)numberCam follower displacement over a rotation (0 at θ=0, peak at θ=π).
pistonpiston(angle, crank, rod)numberSlider-crank pin position from a crank angle.
rackrack(angle, radius)numberRack-and-pinion linear travel: θ · radius.

Multilingual names

enzhjakoth
tween补间補間트윈แทรกค่า
breathe呼吸呼吸호흡หายใจ
wobble摆动揺れ흔들림โยก
gait_swing步摆歩振り걸음흔들ก้าวแกว่ง
spring_to弹向バネ寄せ스프링이동สปริงไป
ik2反解逆運動역운동ไอเค2
gear_couple齿轮联动歯車連動기어연동เฟืองทด
piston活塞ピストン피스톤ลูกสูบ

(The full table lives in lexicons/*.ling and lingfu normalize’s BUILTINS_ANIM.)

Example — a breathing, walking, geared scene

bind start = do {
    open_window("Anima")
    bind t = 0.0
    while window_is_open() {
        bind t = t + delta_time()
        fill(10, 12, 24)

        // organic 灵 — a body that breathes and a foot that walks
        bind chest = breathe(t, 0.4, 0.08)      // ~1.0 ± 0.08
        bind foot  = gait_swing(t, 1.6, 30.0)   // leg swing in pixels

        // mechanical 机 — a gear train driven by a turning shaft
        bind shaft = t * 2.0
        bind gears = gear_train(shaft, [12, 36, 12])

        present()
    }
}

For Rust authors — the crate (ling-animation)

The builtins above are the scalar layer. The crate also exposes the structural core that the runtime rig/skin builtins will build on:

  • easeEaseFunction, Lerp, tween_ease.
  • trackKeyframe, Track, Timeline.
  • rigRig, Joint, Pose, world-pose + skinning matrices.
  • temperament — the Temperament (灵 ↔ 机) axis with blend, liveliness, rigidity.
  • scalar — the per-frame driver math used by the builtins.
  • mechanism — exact linkages (gear_train, four_bar).
  • creature — procedural biped_legs, quadruped_legs, breathing_scale.

Not yet wired (roadmap)

The full rig pipeline is staged. Still to land as builtins:

  • rig_load (glTF skin import), rig_joint, pose/anim_clip/anim_play/anim_tick.
  • SkinBinding (3-D linear-blend skinning over a mesh), WarpBinding (2-D vtex control lattice), ParamBinding (drive vtex parameters / blendshapes).
  • The driver motion graph (masked, weighted blending of clip + procedural + physics).
  • GPU skinning (via ling-gpu) and driver-state snapshotting (via ling-net).

Builtins — Dialog

Cinematic, Ocarina/Majora-style dialog boxes (from ling-game): text typed out letter-by-letter, paged, auto-advancing, with colour-coded highlighting and a font of your choice. Pure-logic in ling-game; the runtime renders it.

Markup: {n}…{/} name/character · {p}…{/} place · {i}…{/} item · \n newline · || page break.

BuiltinMeaning
dialog_show("text" [, cps])Start a dialog (chars-per-second typing speed, default 32).
dialog_step(dt)Advance the typewriter + auto-advance timers (call each frame).
dialog_advance()On a key press: reveal the rest of the page, else go to the next page / close (drive it from SPACE release).
dialog_active() → boolA box is open — gate your world update on this to “suspend” physics/input.
dialog_typing() → boolStill revealing characters.
dialog_close()Force-close the box.
dialog_color(role, r,g,b)Recolour a role — 0 text · 1 name · 2 place · 3 item.
dialog_draw(x, y, w, h [, font])Draw the beveled box + revealed text (pass a font_load handle, or -1 for the stroke font).
mic_open()
bind ui = font_load("assets/fonts/Exo2.ttf", 600.0)
bind line = "Hey {n}Link{/}! Take the {i}Master Sword{/} to {p}Hyrule{/} field.||Beware the night."
while window_is_open() {
    if key_pressed("space") { if dialog_active() { dialog_advance() } else { dialog_show(line, 34.0) } }
    if dialog_active() {
        dialog_step(0.016)               # world suspended while talking
        dialog_draw(50.0, 420.0, 800.0, 150.0, ui)
    } else {
        # … normal game update …
    }
    present()
}

See examples/ui/dialog_demo.ling.

Asset Conversion — ling convert

Transcode an external asset into a self-contained, importable .ling file that reconstructs it with the engine’s own builtins — preserving geometry, names, and structure. Bulk numeric data is embedded losslessly: deflate-compressed + base64 behind the blob_f32 / blob_i32 builtins by default, or plain .ling arrays with --no-compression.

ling convert model.glb                 # → model.ling   (compressed, lossless)
ling convert sfx.wav -o sfx.ling       # explicit output
ling convert logo.svg --no-compression # plain arrays (human-readable / diff-able)
lingfu convert song.mid                # lingfu forwards to ling
ExtensionBecomesPreserves
.gltf / .glbper-mesh pos/nrm/uv + indices, node names/transforms, draw_<name>()geometry, mesh & node names, hierarchy, materials index
.wav .ogg .flac .mp3<name>_pcm (mono f32) + _rate / _durfull-precision PCM at source rate
.mid / .midiflat [time,dur,midi,vel,channel] note listevery note event + timing
.svgflattened polylines + draw_<name>(ox,oy,scale)paths (M/L/H/V/C/Q/Z), line/rect/polyline/polygon
.blendrouted through Blender’s glTF exporter (needs Blender on PATH or $BLENDER)whatever Blender’s glTF export carries

Flags: -o <out.ling> (default <asset>.ling) · --no-compression.

Using a converted file

ใช้ "model.ling"            # use / import the generated module
bind start = do {
    open_window(1280, 720)
    while window_is_open() {
        set_color(180, 220, 255)
        draw_<name>(0.0, 0.0, 0.0, 1.0)   # the generated draw fn
        flush_3d()
        present()
    }
}

The blob builtins decode the embedded data on import:

  • blob_f32("…") → list of numbers (little-endian f32, deflate+base64).
  • blob_i32("…") → list of numbers (little-endian i32) — mesh/polyline indices.

Both are lossless; --no-compression simply emits the same numbers as a literal [ … ] list instead of a blob, which is larger but human-readable.

Window & Camera Builtins

Every builtin below is callable in all five languages — the aliases listed are accepted by the interpreter and produced by lingfu normalize, so a program written (or normalized) in any language runs unchanged.

Window · 2-D drawing

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
open_window开窗ウィンドウ開く창열기เปิดหน้าต่างOpen a window
open_fullscreen全屏全画面전체화면เปิดหน้าต่างเต็มจอOpen fullscreen window
window_is_open窗开開いている창열림หน้าต่างเปิดอยู่True while window is open
get_width幅取得너비ความกว้างWindow width (px)
get_height高取得높이ความสูงWindow height (px)
fill / clear / 塗り潰し / 消去채우기 / 지우기เติมClear screen to RGB
set_color设色色設定색설정สีดินสอSet pen colour
set_color_hsl色相HSL色HSL색설정สีHSLวาดSet pen colour via HSL
draw_line画线線描く선그리기วาดเส้นDraw a 2-D line
draw_pixel画点点描く점그리기วาดจุดPlot a pixel
triangle画三角三角形描画삼각형그리기วาดสามเหลี่ยมFill a 2-D triangle
present表示표시แสดงผลFlush depth queue → screen
capture_mouse捕鼠マウス捕捉마우스잡기จับเมาส์Lock mouse to window

See also draw_circle / draw_disc / set_blend (procedural set).

Input

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
key_down按键キー押す키누름กดค้างTrue while key held
key_pressed键按キー押した키눌림กดปุ่มTrue on key-press edge
mouse_dx鼠ΔXマウスΔX마우스ΔXเมาส์XMouse delta X
mouse_dy鼠ΔYマウスΔY마우스ΔYเมาส์YMouse delta Y

Camera

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
set_camera设镜カメラ設定카메라설정ตั้งกล้องOrient camera (yaw/pitch)
set_camera_pos镜坐标カメラ座標카메라좌표ตั้งตำแหน่งกล้องPosition camera
set_zdist镜距Z距離設定Z거리설정ตั้งระยะห่างNear-plane distance
set_projection投影投影設定투영설정ตั้งโปรเจกชันSet projection mode

Lighting

EN🇨🇳 ZH🇯🇵 JA🇰🇷 KO🇹🇭 THDescription
set_ambient环境光環境光設定환경광설정ตั้งแสงรอบข้างAmbient level 0–1
add_light加灯ライト追加조명추가เพิ่มแสงAdd a point light
clear_lights清灯ライト消去조명초기화ล้างแสงRemove all lights
# Orient camera by yaw (ry) and pitch (rx) angles
set_camera(cos(ry), sin(ry), cos(rx), sin(rx))
set_camera_pos(x, y, z)
set_zdist(d)

Camera

# Orient camera by yaw (ry) and pitch (rx) angles
set_camera(cos(ry), sin(ry), cos(rx), sin(rx))

# Position camera in world space
set_camera_pos(x, y, z)

# Set near-plane distance (default 2.0)
set_zdist(d)

Lighting

# Remove all lights
clear_lights()

# Add a point light
# add_light(x, y, z,  r, g, b,  intensity, radius)
add_light(0, 4, 8,  1.0, 0.85, 0.3,  2.5, 16.0)

# Ambient level (0.0–1.0)
set_ambient(0.1)

Pen colour (for 2D drawing)

# Set pen colour for subsequent 2D draws
สีดินสอ(r, g, b)   # or: pen_color(r,g,b)

Typical main loop structure

令 启 = 执 {
    เปิดหน้าต่างเต็มจอ("My Scene")
    capture_mouse()
    set_ambient(0.10)

    令 帧 = 0
    循 หน้าต่างเปิดอยู่() {
        เติม(0, 0, 0)          # clear to black

        # update camera
        set_camera(cos(ry), sin(ry), cos(rx), sin(rx))
        set_camera_pos(cx, cy, cz)
        set_zdist(2.0)

        # draw geometry
        clear_lights()
        add_light(...)
        vtex_grid(...)
        vtex_rings(...)

        แสดงผล()               # flush
        令 帧 = 帧 + 1
    }
}

Glossary

A language-switchable reference for every Ling keyword, type, literal and builtin. Pick a language from the selector in the top bar — the tables and the sidebar switch to show only that language’s spelling.

  • 40 keywords · 6 types · 363 builtins across 12 crates.

Builtins by crate

  • ling (core runtime) — I/O, math, noise, time, colour helpers and collections — always available.
  • ling-graphics — Window, 2-D/3-D drawing, camera, lighting, cel shading, vector textures, surfaces, shadows and SVG export.
  • ling-ui — HUD, meters, controls, game UI widgets and vector fonts.
  • ling-audio — Tone synthesis, WAV playback, microphone capture, spatial SFX, samples and FX.
  • ling-music — Music decode/analysis, GM synth, rhythm grading, karaoke and MIDI.
  • ling-physics — Vector maths, forces, soft bodies, rigid + angular bodies and a liquid sim.
  • ling-animation — The Anima procedural-animation drivers: tweens, gaits, springs, gears and IK.
  • ling-ai — Neural nets, behaviour trees and the dialog LLM.
  • ling-crypto — Hashing, AEAD, signatures and the geometric / post-quantum suite.
  • ling-input — Gamepad / joystick polling, sticks, triggers and rumble.
  • ling-net — HTTP and WebSocket clients.
  • ling-dialog — On-screen dialog boxes with typewriter text.

Keywords

Reserved words and their spelling in each language.

English中文日本語한국어ไทยDescription
bind束縛바인드ผูกBind a value or function to a name.
do実行실행ทำBlock expression do { … }.
fn関数함수ฟังก์ชันFunction type / lambda.
modモジュール모듈โมดูลDeclare a module.
type타입ชนิดDeclare a type.
ifもし만약ถ้าConditional branch.
else아니면มิฉะนั้นAlternative branch.
while동안ขณะที่Loop while a condition holds.
for반복สำหรับIterate over a range or collection.
inの中안에ในIteration source: for x in 0..10.
match一致매치ตรงกับPattern match.
return戻る반환คืนค่าReturn a value from a function.
own所有소유เป็นเจ้าของOwnership: take ownership.
lend貸す빌려ให้ยืมOwnership: borrow immutably.
share共有공유แบ่งปันOwnership: shared reference.
move移動이동ย้ายOwnership: move value.
copy複製복사คัดลอกOwnership: copy value.
async非同期비동기อะซิงค์Mark a function/block asynchronous.
wait待つ기다려รอAwait an async value.
asとして로서เป็นType cast / alias.
wherewherewherewherewhereConstraint clause.
post投稿게시ส่งReturn a value (idiomatic return).
give渡す전달ให้Yield / return a value.
fitfitfitfitจับคู่Pattern / refinement.
form형태รูปแบบConstruct a form / struct.
choose選ぶ선택เลือกEnum / selection construct.
canできる가능สามารถCapability / permission.
change変える변경เปลี่ยนแปลงMutate a binding.
stop停止멈춤หยุดBreak out of the loop.
again続ける계속ทำอีกContinue the loop.
try試す시도ลองFallible expression.
sure確か확실แน่นอนAssert success.
maybe多分아마도อาจจะOptional value.
pure純粋순수บริสุทธิ์Mark as pure (no side effects).
spawn起動생성สร้างSpawn a concurrent task.
ok良い좋아ตกลงSuccess result.
bad悪い나쁨ผิดพลาดError result.
noneなし없음ไม่มีAbsent value.
start開始시작เริ่มProgram entry point: bind start = do { … }.
result結果결과ผลลัพธ์Result value.

Types

Built-in types.

English中文日本語한국어ไทยDescription
number数値숫자จำนวนNumeric type (integer or float).
text文字列문자열ข้อความText / string type.
bool論理논리ตรรกะBoolean (true / false).
listリスト목록รายการOrdered list type.
mapマップแผนที่Key / value map type.
tupleタプル튜플สิ่งอันดับFixed-size tuple type.

Literals & operators

Literals and operators are spelled the same in every language.

Literals

LiteralMeaning
true / falseBoolean values
ok / badResult success / error
noneAbsent value
123, 1.5, -7Numbers
"hello"Text
[1, 2, 3]List
0..10Range (used by for)

Operators

OperatorMeaning
+ - * / %Arithmetic
== != < <= > >=Comparison
&& || !Logical and / or / not
=Bind / assign
->Function return type
.Field / method access
|>Pipe

ling (core runtime)

I/O, math, noise, time, colour helpers and collections — always available.

I/O

English中文日本語한국어ไทย
print印刷출력พิมพ์
debug調査디버그ดีบัก
panicパニック패닉ตกใจ

Color helpers

English中文日本語한국어ไทย
hsl_color色相值HSL色値HSL색값สีHSL

Math

English中文日本語한국어ไทย
trunc截整切り捨て버림ตัดทศนิยม
int取整整数化정수화ตัดทศนิยม
sin正弦正弦사인ไซน์
cos余弦余弦코사인โคไซน์
tan正切正接탄젠트แทนเจนต์
sqrt平方根제곱근รากที่สอง
abs绝对絶対値절대값ค่าสัมบูรณ์
floor下整내림ปัดลง
ceil上整天井올림ปัดขึ้น
round四舍四捨五入반올림ปัดเศษ
powべき乗거듭제곱ยกกำลัง
log对数対数로그ลอการิทึม
min最小最小최솟값ต่ำสุด
max最大最大최댓값สูงสุด
clamp截取範囲制限범위제한จำกัด
pi圆周率円周率파이พาย
tau双周率タウ타우ทาว
lerp线性插值線形補間선형보간ค่าระหว่าง
smoothstep平滑步进スムーズステップ스무스스텝เปลี่ยนแบบนุ่ม
rand随机乱数난수สุ่ม

Noise

English中文日本語한국어ไทย
vnoise柏林噪声2Dバリューノイズ2D값노이즈2Dนอยส์2ดี
fbm分形噪声フラクタルノイズ프랙탈노이즈นอยส์ออร์แกนิก
perlin柏林噪声3Dパーリンノイズ3D펄린노이즈3Dเพอร์ลิน3ดี

Color

English中文日本語한국어ไทย
hsv_to_rgbHSV转RGBHSV変換RGBHSV변환RGBเอชเอสวีเป็นRGB
lerp_color颜色插值色補間색보간ไล่สี

Time

English中文日本語한국어ไทย
time_now当前时间経過時間현재시간เวลาปัจจุบัน
frame_count帧数フレーム数프레임수เฟรม
time時刻시간เวลา
sleep眠るนอนหลับ

Collections

English中文日本語한국어ไทย
len長さ길이ความยาว
push追加추가ต่อท้าย
pop取出꺼내기ดึงออก
new_list新列新リスト새목록รายการใหม่
new_map新图新マップ새맵แผนที่ใหม่
keys键集キー一覧키목록ชุดคีย์
values值集値一覧값목록ชุดค่า
contains含む포함มีอยู่

ling-graphics

Window, 2-D/3-D drawing, camera, lighting, cel shading, vector textures, surfaces, shadows and SVG export.

Window / graphics

English中文日本語한국어ไทย
open_window开窗ウィンドウ開く창열기เปิดหน้าต่าง
open_fullscreen全屏全画面전체화면เปิดหน้าต่างเต็มจอ
fill塗り潰し채우기เติม
clear消去지우기clear
set_color设色色設定색설정สีดินสอ
set_color_hsl色相HSL色HSL색설정สีHSLวาด
present表示표시แสดงผล
draw_line画线線描く선그리기วาดเส้น
draw_pixel画点点描く점그리기วาดจุด
triangle画三角三角形삼각형วาดสามเหลี่ยม
draw_rect画矩形矩形描く사각형그리기วาดสี่เหลี่ยม
draw_circle画圆円描く원그리기วาดวงกลม
draw_text画字文字描く글자그리기วาดข้อความ
window_is_open窗开開いている창열림หน้าต่างเปิดอยู่
get_width幅取得너비ความกว้าง
get_height高取得높이ความสูง

Monitor detection + framerate

English中文日本語한국어ไทย
monitor_width屏宽画面幅화면너비ความกว้างจอ
monitor_height屏高画面高화면높이ความสูงจอ
monitor_refresh刷新率リフレッシュレート주사율อัตรารีเฟรช
monitor_info屏幕信息画面情報화면정보ข้อมูลจอ
set_fps设帧率フレームレート設定프레임설정ตั้งเฟรมเรต

Input

English中文日本語한국어ไทย
key_down按键キー押す키누름กดค้าง
key_pressed键按キー押した키눌림กดปุ่ม
mouse_x鼠XマウスX마우스Xเมาส์X
mouse_y鼠YマウスY마우스Yเมาส์Y
mouse_dx鼠ΔXマウスΔX마우스ΔXเมาส์X
mouse_dy鼠ΔYマウスΔY마우스ΔYเมาส์Y
mouse_button鼠键マウスボタン마우스버튼ปุ่มเมาส์
capture_mouse捕鼠マウス捕捉마우스잡기จับเมาส์

3-D

English中文日本語한국어ไทย
camera_pos镜位カメラ位置카메라위치ตำแหน่งกล้อง
camera_look镜向カメラ方向카메라방향ทิศทางกล้อง
camera_fov镜角視野角시야각มุมมองกล้อง
draw_mesh画网メッシュ描く메시그리기วาดตาข่าย
draw_triangle_3d画3D三角3D三角形描く3D삼각형그리기วาดสามเหลี่ยม3มิติ
draw_line_3d画3D线3D線描く3D선그리기วาดเส้น3มิติ
set_camera设镜カメラ設定카메라설정ตั้งกล้อง
set_camera_pos镜坐标カメラ座標카메라좌표ตั้งตำแหน่งกล้อง
set_zdist镜距Z距離設定Z거리설정ตั้งระยะห่าง
set_projection投影投影設定투영설정ตั้งโปรเจกชัน

Lighting

English中文日本語한국어ไทย
set_ambient环境光環境光設定환경광설정ตั้งแสงรอบข้าง
add_light加灯ライト追加조명추가เพิ่มแสง
clear_lights清灯ライト消去조명초기화ล้างแสง

Texture patterns (vtex)

English中文日本語한국어ไทย
vtex_grid纹格格子模様격자무늬ลายตาราง
vtex_rings纹环同心円동심원ลายวงซ้อน
vtex_star纹星星模様별무늬ลายดาว
vtex_spiral纹螺螺旋나선ลายเกลียว
vtex_flower纹花花模様꽃무늬ลายดอก
vtex_lotus纹莲蓮模様연꽃무늬ลายดอกบัว
vtex_chakra纹轮輪模様바퀴무늬ลายจักร
vtex_yantra纹咒護符模様부적무늬ลายยันต์
vtex_letter_rain纹字雨文字雨글자비ลายอักษรไหล
vtex_hyperbolic_uv纹曲面双曲線쌍곡선ลายไฮเพอร์โบลิก
vtex_tessellated纹镶嵌網目模様격자망ลายตาข่าย
vtex_halftone纹半调網点模様망점ลายจุด
vtex_spiked_cog纹棘轮歯車模様톱니바퀴ฟันเฟืองหนาม
vtex_torii纹鸟居鳥居도리이ประตูโทริอิ
vtex_pagoda纹塔เจดีย์

SVG export

English中文日本語한국어ไทย
svg_beginSVG开始SVG開始SVG시작เริ่มSVG
svg_rectSVG矩形SVG矩形SVG사각형SVGสี่เหลี่ยม
svg_circleSVG圆SVG円SVG원SVGวงกลม
svg_lineSVG线SVG線SVG선SVGเส้น
svg_polylineSVG折线SVG折れ線SVG꺾은선SVGเส้นหัก
svg_textSVG文字SVG文字SVG글자SVGข้อความ
svg_endSVG结束SVG終了SVG끝จบSVG

Blending

English中文日本語한국어ไทย
set_blend混合模式ブレンドモード블렌드모드โหมดผสม

Drawing - filled

English中文日本語한국어ไทย
draw_disc画实心圆塗りつぶし円원채우기วาดวงกลมทึบ

Surfaces & shadows

English中文日本語한국어ไทย
set_alpha设透明アルファ設定투명도설정ตั้งความโปร่งใส
grad_triangle渐变三角グラデ三角그라데삼각สามเหลี่ยมไล่สี
grad_rect渐变矩形グラデ矩形그라데사각สี่เหลี่ยมไล่สี
shadow_blob阴影斑影ブロブ그림자블롭เงาวงรี
cast_shadow投射阴影影を落とす그림자드리우기ทอดเงา
shadow_params阴影参数影設定그림자설정ตั้งค่าเงา
depth_triangle深度三角深度三角形깊이삼각สามเหลี่ยมเรียงลึก
depth_line深度线深度線깊이선เส้นเรียงลึก

2030 compositing: linear-light, OkLab gradients, z-buffer

English中文日本語한국어ไทย
set_color_space色彩空间色空間색공간ปริภูมิสี
set_gradient_space渐变空间グラデ空間그라데이션공간ปริภูมิไล่สี
mix_color混合颜色色混合색혼합ผสมสี
set_depth_test深度测试深度テスト깊이테스트ทดสอบความลึก

mode: 0 filled · 1 wireframe · 2 both

English中文日本語한국어ไทย
cube立方体立方体정육면체ลูกบาศก์
box方块상자กล่อง
sphere球体ทรงกลม
icosphere二十面球アイコ球아이코구체ทรงกลมเหลี่ยม
dome穹顶ドームโดม
cylinder圆柱円柱원기둥ทรงกระบอก
cone圆锥円錐원뿔กรวย
capsule胶囊カプセル캡슐แคปซูล
torus圆环トーラス토러스ทอรัส
pyramid金字塔ピラミッド피라미드พีระมิด
prism棱柱角柱각기둥ปริซึม
frustum棱台錐台원뿔대กรวยตัด
tetrahedron四面体四面体정사면체ทรงสี่หน้า
octahedron八面体八面体정팔면체ทรงแปดหน้า
dodecahedron十二面体十二面体정십이면체ทรงสิบสองหน้า
icosahedron二十面体二十面体정이십면체ทรงยี่สิบหน้า
gear齿轮歯車톱니바퀴เฟือง
gyro陀螺ジャイロ자이로ไจโร
helix螺旋线らせん나선เกลียว
spring弹簧ばね스프링สปริง
arch拱门アーチ아치ซุ้มโค้ง
stairs楼梯階段계단บันได
star_prism星柱星柱별기둥แท่งดาว
capsule_chain胶囊链カプセル鎖캡슐체인โซ่แคปซูล
mobius莫比乌斯メビウス뫼비우스เมอบีอุส

render / lighting modes (holographic cel)

English中文日本語한국어ไทย
set_shade_mode设置着色シェード設定셰이드모드ตั้งการแรเงา
set_cel_bands设置色阶セル段数셀밴드ตั้งระดับสี
set_shadow_color设置阴影色影の色그림자색ตั้งสีเงา
set_rim设置边缘光リム設定림라이트ตั้งขอบเรือง

3D projection + filled 2D polygons

English中文日本語한국어ไทย
project_3d投影3D3D投影3D투영ฉาย3มิติ
draw_poly填充多边形ポリゴン塗り다각형채우기เติมรูปหลายเหลี่ยม

dialog + liquid rainbow + sparkle

English中文日本語한국어ไทย
sparkle闪光きらめき반짝임ประกาย

game AI : neural net, behavior tree, dialog LLM

English中文日本語한국어ไทย
orb_shell球壳オーブ殻오브껍질เปลือกทรงกลม
orb_particles球内粒子オーブ粒子오브입자อนุภาคทรงกลม

ling-ui

HUD, meters, controls, game UI widgets and vector fonts.

UI toolkit (HUD / meters / controls / game UI) + vector fonts

English中文日本語한국어ไทย
ui_theme界面主题UIテーマ인터페이스테마ธีมส่วนติดต่อ
ui_text界面文字UI文字UI텍스트ข้อความหน้าจอ
ui_frame边框フレーム枠프레임틀กรอบ
ui_bevel斜角框ベベル枠베벨틀กรอบเฉียง
ui_hot热区ホットエリア핫존พื้นที่สัมผัส
ui_radar雷达レーダー레이더เรดาร์
ui_compass罗盘コンパス나침반เข็มทิศ
ui_reticle准星照準조준선เป้าเล็ง
ui_target锁定框ターゲット표적กรอบเป้า
ui_panel面板パネル패널แผง
ui_scanlines扫描线走査線스캔라인เส้นสแกน
ui_bar进度条バー막대แถบ
ui_segbar分段条分割バー분할막대แถบแบ่ง
ui_gauge仪表ゲージ게이지มาตรวัด
ui_ring环表リングメーター링미터วงแหวนวัด
ui_vu音量条VUメーター음량막대มาตรเสียง
ui_spark迷你图スパークライン스파크라인กราฟจิ๋ว
ui_battery电池バッテリー배터리แบตเตอรี่
ui_button按钮ボタン버튼ปุ่ม
ui_toggle开关トグル토글สวิตช์
ui_slider滑块スライダー슬라이더แถบเลื่อน
ui_checkbox复选框チェックボックス체크박스ช่องเลือก
ui_tabs标签页タブแท็บ
ui_progress进度プログレス진행바ความคืบหน้า
ui_tooltip提示框ツールチップ툴팁คำแนะนำ
ui_stepper步进器ステッパー스테퍼ตัวปรับค่า
ui_healthbar血条体力バー체력바แถบพลังชีวิต
ui_cooldown冷却クールダウン쿨다운คูลดาวน์
ui_counter计数器カウンター카운터ตัวนับ
ui_minimap小地图ミニマップ미니맵แผนที่ย่อ
ui_dpad方向键方向パッド방향패드ปุ่มทิศทาง
ui_slotgrid物品格スロットグリッド슬롯격자ช่องไอเทม
ui_vignette暗角ビネット비네트ขอบมืด
ui_gauge3d立体仪表立体ゲージ입체게이지มาตรวัด3มิติ
ui_panel3d立体面板立体パネル입체패널แผง3มิติ
ui_radar3d立体雷达立体レーダー입체레이더เรดาร์3มิติ
ui_sound界面音UI音인터페이스음เสียงปุ่ม
font_load加载字体フォント読込글꼴로드โหลดฟอนต์
font_text字体文本フォント文字글꼴텍스트ข้อความฟอนต์
font_text_fill填充字体フォント塗り글꼴채움เติมฟอนต์
font_text_3d字体3Dフォント3D글꼴3Dข้อความฟอนต์3มิติ
font_width字体宽度フォント幅글꼴너비ความกว้างฟอนต์

ling-audio

Tone synthesis, WAV playback, microphone capture, spatial SFX, samples and FX.

Audio

English中文日本語한국어ไทย
tone音调音調음조เสียงโทน
play_wav播音WAV再生WAV재생เล่นWAV
stop_audio止音音停止음악멈춤หยุดเสียง
set_volume音量音量設定음량설정ปรับระดับเสียง
mic_open开麦マイク開く마이크열기เปิดไมค์
mic_peak麦克风峰值マイクピーク마이크피크เสียงพีค
mic_rms麦克风音量マイクRMS마이크RMSเสียงRMS
mic_fft实时频谱リアルタイムFFT실시간FFTวิเคราะห์เสียงสด
audio_tone空间音空間音공간음เสียงโทน
audio_volume总音量マスター音量마스터음량ระดับเสียง
audio_listener听者リスナー청취자ผู้ฟัง
audio_bgm背景乐BGM배경음악เพลงพื้นหลัง
audio_bgm_volume背景音量BGM音量배경음량ระดับเสียงพื้นหลัง

UI toolkit (HUD / meters / controls / game UI) + vector fonts

English中文日本語한국어ไทย
audio_blip提示音ビープ音효과음เสียงบี๊บ

spatial audio / samples / FX / MIDI

English中文日本語한국어ไทย
audio_sfx音效空間効果音공간효과음เสียงเอฟเฟกต์
audio_sample_load载入采样サンプル読込샘플로드โหลดตัวอย่างเสียง
audio_sample_play播放采样サンプル再生샘플재생เล่นตัวอย่างเสียง
audio_sample_stop停止采样サンプル停止샘플정지หยุดตัวอย่างเสียง
audio_fx_delay回声ディレイ効果딜레이เสียงสะท้อน
audio_fx_reverb混响リバーブ리버브เสียงก้อง
audio_fx_lowpass低通滤波ローパス저역통과กรองความถี่ต่ำ

ling-music

Music decode/analysis, GM synth, rhythm grading, karaoke and MIDI.

music toolkit (decode / analysis / GM synth / rhythm / karaoke)

English中文日本語한국어ไทย
music_load载入音乐音楽読込음악로드โหลดเพลง
music_duration音乐时长音楽長さ음악길이ความยาวเพลง
music_bpm节拍速度テンポ템포จังหวะต่อนาที
music_key调性調性조성คีย์เพลง
music_onsets音符起点オンセット온셋จุดเริ่มเสียง
music_beat_grid节拍网格ビートグリッド비트그리드กริดจังหวะ
music_play播放音乐音楽再生음악재생เล่นเพลง
music_pause暂停音乐音楽一時停止음악일시정지หยุดเพลงชั่วคราว
music_stop停止音乐音楽停止음악정지หยุดเพลง
music_seek定位音乐音楽シーク음악탐색ค้นหาเพลง
music_pos音乐位置音楽位置음악위치ตำแหน่งเพลง
music_volume音乐音量音楽音量음악음량ระดับเพลง
music_patch乐器音色音色読込악기패치แพตช์เครื่องดนตรี
music_note弹音符音符演奏음표연주เล่นโน้ต
music_note_on音符开始音符オン음표켜기โน้ตเริ่ม
music_note_off音符结束音符オフ음표끄기โน้ตจบ
music_judge判定判定する판정ตัดสินจังหวะ
music_grade_name判定名判定名称판정이름ชื่อการตัดสิน
music_lrc载入歌词歌詞読込가사로드โหลดเนื้อเพลง
music_lyric当前歌词現在歌詞현재가사เนื้อเพลงปัจจุบัน
music_mic_pitch麦克风音高マイク音程마이크음정ระดับเสียงไมค์
music_note_name音名音名称음이름ชื่อโน้ต
music_hz音符频率音符周波数음표주파수ความถี่โน้ต
music_pitch_score音准评分音程スコア음정점수คะแนนเสียง

spatial audio / samples / FX / MIDI

English中文日本語한국어ไทย
music_midi_load载入MIDIMIDI読込미디로드โหลดมิดี
music_midi_countMIDI数量MIDI数미디수จำนวนมิดี
music_midi_notesMIDI音符MIDIノート미디음표โน้ตมิดี
music_fft音乐频谱音楽スペクトル음악스펙트럼สเปกตรัมเพลง
music_midi_barsMIDI音条MIDIバー미디바แท่งมิดี

ling-physics

Vector maths, forces, soft bodies, rigid + angular bodies and a liquid sim.

Physics - vectors

English中文日本語한국어ไทย
physics_normalize向量_单位化ベクトル_単位化벡터_단위화เวกเตอร์_ทำให้เป็นหน่วย
physics_dot向量_点积ベクトル_内積벡터_내적เวกเตอร์_ผลคูณจุด
physics_cross向量_叉积ベクトル_外積벡터_외적เวกเตอร์_ผลคูณไขว้
physics_distance向量_距离ベクトル_距離벡터_거리เวกเตอร์_ระยะห่าง
physics_magnitude向量_长度ベクトル_大きさ벡터_크기เวกเตอร์_ความยาว
physics_lerp向量_插值ベクトル_補間벡터_보간เวกเตอร์_สอดแทรก
physics_angle向量_夹角ベクトル_角度벡터_각도เวกเตอร์_มุม
physics_project向量_投影ベクトル_投影벡터_정사영เวกเตอร์_ฉาย
physics_reflect向量_反射ベクトル_反射벡터_반사เวกเตอร์_สะท้อน

Physics - forces

English中文日本語한국어ไทย
physics_gravity重力_力重力_力중력_힘แรงโน้มถ่วง_แรง
physics_drag阻力_风阻抵抗_力항력_저항แรงลาก_ความต้านทาน
physics_spring弹簧_力バネ_力스프링_힘สปริง_แรง
physics_damping阻尼_力減衰_力감쇠_힘การลดการสั่น_แรง
physics_attraction万有_引力万有_引力만유_인력แรงดึงดูด_แรง
physics_repulsion排斥_力斥力_力척력_힘แรงผลัก_แรง
physics_buoyancy浮力_力浮力_力부력_힘แรงลอยตัว_แรง
physics_wind风_力風_力바람_힘ลม_แรง
physics_bounce碰撞_反弹衝突_バウンス충돌_반발การชน_กระเด้ง
physics_accel力_加速度力_加速度힘_가속도แรง_ความเร่ง

physics (soft bodies / rigid+angular / liquid sim)

English中文日本語한국어ไทย
soft_ball软球ソフトボール소프트볼ลูกบอลนุ่ม
soft_step软体步进ソフト更新소프트스텝ก้าวนุ่ม
soft_bounce软体落地ソフト着地소프트바운스เด้งนุ่ม
soft_contain软体边界ソフト箱소프트경계กล่องนุ่ม
soft_kick软体踢ソフト衝撃소프트킥เตะนุ่ม
soft_deform形变量変形量변형량ความบิดเบี้ยว
soft_centroid软体质心ソフト重心소프트중심จุดศูนย์กลางนุ่ม
soft_nodes软体节点ソフト節点소프트노드จุดนุ่ม
rb_add刚体添加剛体追加강체추가เพิ่มวัตถุแข็ง
rb_torque扭矩トルク토크แรงบิด
rb_spin自旋スピン스핀หมุน
rb_impulse刚体冲量剛体インパルス강체충격แรงดลแข็ง
rb_floor刚体落地剛体着地강체바닥พื้นแข็ง
rb_gravity刚体重力剛体重力강체중력แรงโน้มถ่วงแข็ง
rb_step刚体步进剛体更新강체스텝ก้าวแข็ง
rb_pos刚体位置剛体位置강체위치ตำแหน่งแข็ง
rb_rot刚体旋转剛体回転강체회전การหมุนแข็ง
liquid_new新建液体液体新規액체생성สร้างของเหลว
liquid_splat液体注入液体追加액체분사หยดของเหลว
liquid_gravity液体重力液体重力ベクトル액체중력แรงโน้มถ่วงเหลว
liquid_step液体步进液体更新액체스텝ก้าวของเหลว
liquid_draw绘制液体液体描画액체그리기วาดของเหลว
liquid_draw_surface液体贴面液体曲面액체곡면ของเหลวบนพื้นผิว

dialog + liquid rainbow + sparkle

English中文日本語한국어ไทย
liquid_rainbow液体彩虹液体虹액체무지개ของเหลวสายรุ้ง

game AI : neural net, behavior tree, dialog LLM

English中文日本語한국어ไทย
soft_spin软体自旋ソフト回転소프트회전หมุนนุ่ม
soft_angular_speed软体角速ソフト角速度소프트각속도ความเร็วเชิงมุมนุ่ม
liquid_mix液体混合液体混合度액체혼합การผสมของเหลว

ling-animation

The Anima procedural-animation drivers: tweens, gaits, springs, gears and IK.

Anima animation drivers

English中文日本語한국어ไทย
tween补间補間트윈แทรกค่า
tween_ease缓动补间緩和補間이징트윈แทรกนุ่ม
breathe呼吸呼吸호흡หายใจ
wobble摆动揺れ흔들림โยก
gait_phase步相歩相걸음위상เฟสก้าว
gait_swing步摆歩振り걸음흔들ก้าวแกว่ง
gait_lift抬脚足上げ발들기ยกเท้า
spring_to弹向バネ寄せ스프링이동สปริงไป
ik2反解逆運動역운동ไอเค2
gear_couple齿轮联动歯車連動기어연동เฟืองทด
gear_train齿轮组歯車列기어열ชุดเฟือง
cam_lift凸轮升程カム揚程캠리프트ยกลูกเบี้ยว
piston活塞ピストン피스톤ลูกสูบ
rack齿条ラックแร็ค

ling-ai

Neural nets, behaviour trees and the dialog LLM.

AI

English中文日本語한국어ไทย
ai_chat智聊AI会話AI대화สนทนาAI
ai_embed智嵌AI埋込AI임베드ฝังAI

game AI : neural net, behavior tree, dialog LLM

English中文日本語한국어ไทย
nn_new建神经网ニューラル作成신경망생성สร้างโครงข่าย
nn_dense密集层密層追加밀집층ชั้นหนาแน่น
nn_forward神经前向順伝播순전파ส่งต่อโครงข่าย
nn_train训练网ニューラル学習신경망학습ฝึกโครงข่าย
nn_save保存网網保存신경망저장บันทึกโครงข่าย
nn_load载入网網読込신경망불러오기โหลดโครงข่าย
bt_build建行为树行動木構築행동트리구성สร้างต้นไม้พฤติกรรม
bt_set设事实事実設定사실설정ตั้งข้อเท็จจริง
bt_tick行为树滴答行動木更新행동트리틱เดินต้นไม้พฤติกรรม
bt_status行为树状态行動木状態행동트리상태สถานะต้นไม้พฤติกรรม
dialog_new建对话模型対話モデル作成대화모델생성สร้างโมเดลสนทนา
dialog_learn对话学习対話学習대화학습เรียนรู้สนทนา
dialog_load对话载入対話読込대화불러오기โหลดชุดสนทนา
dialog_train对话训练対話訓練대화훈련ฝึกสนทนา
dialog_say对话生成対話生成대화생성พูดสนทนา
dialog_save对话存模対話モデル保存대화모델저장บันทึกโมเดลสนทนา
dialog_load_model对话载模対話モデル読込대화모델불러오기โหลดโมเดลสนทนา

ling-crypto

Hashing, AEAD, signatures and the geometric / post-quantum suite.

Math

English中文日本語한국어ไทย
sign签名署名서명ลายเซ็น

Crypto

English中文日本語한국어ไทย
hash哈希ハッシュ해시แฮช
encrypt加密暗号化암호화เข้ารหัส
decrypt解密復号化복호화ถอดรหัส
verify验证検証검증ยืนยัน

Geometric / post-quantum crypto (ling-crypto geo suite)

English中文日本語한국어ไทย
crypto_hash几何哈希幾何ハッシュ기하해시แฮชเข้ารหัส
knot_points结点坐标結び目点매듭점จุดปม
knot_label结点标签結び目ラベル매듭라벨ป้ายปม
knot_keygen生成密钥鍵生成키생성สร้างกุญแจปม
knot_public公钥公開鍵공개키กุญแจสาธารณะปม
knot_encapsulate封装密钥カプセル化캡슐화ห่อกุญแจปม
knot_decapsulate解封装密钥カプセル解除캡슐해제แกะกุญแจปม
crypto_seal封印封印する봉인ผนึก
crypto_open解封封印解除봉인해제เปิดผนึก
holo_points全息点ホログラム点홀로그램점จุดโฮโลแกรม
holo_fragment_count全息碎片数ホログラム断片数홀로그램조각수จำนวนชิ้นโฮโลแกรม

ling-input

Gamepad / joystick polling, sticks, triggers and rumble.

Gamepad / joystick

English中文日本語한국어ไทย
pad_poll手柄轮询パッド更新패드폴링อัปเดตแพด
pad_count手柄数パッド数패드수จำนวนแพด
pad_connected手柄连接パッド接続패드연결แพดเชื่อม
pad_button手柄按键パッドボタン패드버튼ปุ่มแพด
pad_pressed手柄按下パッド押下패드눌림แพดกด
pad_lx手柄左Xパッド左X패드왼Xแพดซ้ายX
pad_ly手柄左Yパッド左Y패드왼Yแพดซ้ายY
pad_rx手柄右Xパッド右X패드오XแพดขวาX
pad_ry手柄右Yパッド右Y패드오YแพดขวาY
pad_lt手柄左扳机パッド左トリガー패드왼트리거ไกแพดซ้าย
pad_rt手柄右扳机パッド右トリガー패드오트리거ไกแพดขวา
pad_rumble手柄震动パッド振動패드진동แพดสั่น

ling-net

HTTP and WebSocket clients.

Network

English中文日本語한국어ไทย
http_get网取HTTP取得HTTP가져오기ดึงHTTP
http_post网发HTTP送信HTTP보내기ส่งHTTP
ws_connect网链WS接続WS연결เชื่อมWS

ling-dialog

On-screen dialog boxes with typewriter text.

dialog + liquid rainbow + sparkle

English中文日本語한국어ไทย
dialog_show对话显示会話表示대화표시แสดงบทสนทนา
dialog_step对话步进会話更新대화스텝ก้าวบทสนทนา
dialog_advance对话推进会話送り대화진행เลื่อนบทสนทนา
dialog_active对话激活会話中대화중บทสนทนาทำงาน
dialog_typing对话打字会話タイプ中대화타이핑กำลังพิมพ์บทสนทนา
dialog_close对话关闭会話閉じる대화닫기ปิดบทสนทนา
dialog_color对话颜色会話色대화색สีบทสนทนา
dialog_draw对话绘制会話描画대화그리기วาดบทสนทนา

Crates & Functions

Ling is a Cargo workspace: the ling interpreter is backed by ~two dozen focused crates under crates/. This page lists every workspace crate, what it does, and its public functions (generated from each crate’s source — the Rust API behind the Ling builtins).

ling-ai v2030.0.1

Tensor computation, neural networks, and LLM inference

51 public functions:

add as_str assistant backward config corpus_len decode dense encode forward forward_cache from_bytes from_vec from_vocab get id_to_token learn learn_dataset matmul meta mul new next_f32 next_u64 numel ones out_width parse push rank relu say set softmax status system tick to_bytes to_chatml to_lingdialog to_plain token_to_id train train_mse training_lines turn_count uniform user utterances vocab_size zeros

ling-animation v2030.0.0

Anima — Ling’s unified animation system: one rig, any target, any temperament (organic 灵 ↔ mechanical 机)

61 public functions:

add add_rig add_timeline apply biped_legs blend breathe breathing_scale cam_lift duration eye_aperture_l find four_bar from_name from_translation gait_lift gait_phase gait_swing gear gear_train idle_noise is_empty is_mechanical is_organic key len lerp liveliness matrix new normalized offset pause piston play quadruped_legs rack reset resolve rest rig rig_mut rigidity sample set_local skinning_matrices solve solve_point spring_step stop tick tick_all timeline topology tween_ease two_bone_fk two_bone_ik value wobble world world_pos

ling-ast v2030.0.0

Abstract Syntax Tree types for the Ling language

5 public functions:

is_empty len new span union

ling-audio v2030.0.3

4D positional audio synthesis and WAV BGM for Ling

34 public functions:

add_sample beat_ratio blip clear_tone dominant_freq eval eval_animated fire freq_bands freq_texture frequency from_name fx_delay fx_lowpass fx_reverb is_beat load_bgm map_bands new ocean play_sample psychedelic push_samples rainbow rms set_bgm_volume set_listener set_listener_pos set_master_volume set_tone set_window sfx stop_sample waveform_texture

ling-codegen v2030.0.1

Code generation backends for Ling (bytecode, WASM, native)

4 public functions:

compile_mir_program load new run_main

ling-core v2030.0.1

Core types, errors, and compiler infrastructure for Ling

No public free functions (types / re-exports only).

ling-crypto v2030.1.3

Post-quantum and classical cryptography for Ling — real ML-KEM-768 (FIPS 203), X25519+ML-KEM hybrid KEM, AES-GCM, XChaCha20, Blake3, SHA3, Argon2id, Shamir over GF(2^8), Ristretto Schnorr ZKP, VRF

49 public functions:

decapsulate decrypt derive_key diffie_hellman encapsulate encapsulation_key encrypt encryption_key evaluate expand from_bytes from_digest from_scalar_bytes from_seed gather generate generate_key hash hash_many hash_password hkdf_sha3 holo_hash holo_open holo_seal kem_seed key keyed_hash knot_encapsulate knot_for_public_key label new params prove public_bytes public_key public_knot reconstruct_secret scatter schnorr_verify seed sign signing_seed split_secret subkey to_bytes verify verify_password vrf_verify xof

ling-fu v2030.1.6

灵符 — The Ling project manager. lingfu new/build/run/normalize and more.

12 public functions:

dir_names from_code from_str name name_in normalize_content normalize_project sanitize_project_kind scaffold_in_dir scaffold_project to_chinese to_english

ling-game v2030.1.1

Ling game engine — ECS, physics, and scene management

61 public functions:

add_system advance apply_force checkerboard close color_cycle cube cylinder despawn dot eval fire forest freq_map get get_mut gradient grid halftone hyperbolic_patch hypnotic_spiral icosphere index insert integrate into_vec is_closed is_last_page is_typing iter julia len mandelbrot merge mobius neon new noise normalise normals ocean overlaps pentagon positions psychedelic quit rainbow register remove rgba rgba_alpha ripple run set set_fps spawn sphere torus update visible_runs voronoi

ling-gpu v2030.0.1

GPU compute backend for Ling (CUDA via cudarc, with a portable CPU fallback)

4 public functions:

backend device_name gpu_active new

ling-graphics v2030.0.4

3D/4D rendering, geometry, animation, and font tools for the Ling ecosystem

132 public functions:

add add_child add_node add_root add_triangle add_vertex advance apply ascent at blend blend_pixel build cel_ramp center clamp clear collect_render_items compute_normals compute_tangents cone contains contains_aabb contains_point contains_sphere cube cylinder descent distance dot draw_text duration expand forward from_bytes from_color from_hex from_path from_path_weight from_point_normal from_points from_rotation from_scale from_srgb from_srgba from_three_points from_translation from_trs from_view_proj generate_text_mesh get_or_rasterize get_pixel global_matrix global_transform glyph_outline half_extents icosphere identity intersect_aabb intersect_plane intersect_sphere length lerp lit_vertex look_at luminance matrix measure measure_text minkowski_dot move_by move_forward move_right move_up mul mul_vec new node node_mut normalize normalized_time orbit orthographic pack pause perspective plane play posterize premultiply_alpha present_terminal project projection_matrix pyramid render_scene right roots run sample sample_albedo set_light set_pixel signed_distance size spawn_mesh sphere stop tick to_klein to_poincare to_rgba_bytes torus translation_4d transpose triangle_count union unpack unproject_ray up view_matrix view_proj with_alpha with_color with_emissive with_material with_mesh with_metallic_roughness with_terminal_dimensions with_texture with_transform xyz zero

ling-icon v2030.0.1

Rasterize SVG/PNG icons to multi-resolution .ico and embed them in Windows executables

4 public functions:

embed_in_build ico_bytes rasterize_and_embed write_ico

ling-input v2030.0.1

Sensorium — Ling’s unified input system: gamepads, joysticks, haptics, motion, XR controllers, and themeable on-screen touch controls (灵 organic ↔ 机 mechanical)

104 public functions:

active active_count add analog apply assign_player axis axis2d begin begin_frame bind button button_mut cancel center click contains contains_xz count current_opacity define delta disconnect dpad drift duration end events faded floating for_player forward from_center_size from_degrees gamepad get get_mut glyph gyro_aim hand hand_mut hat heartbeat high_contrast ingest is_active is_down is_playing is_silent iter joint just_pressed just_released lerp ling map map_mut max minimal modern_gamepad mouse move_by move_to moved neon new of_kind pick play player pop pressed prune pulse pump push push_text ray recenter right sample scaled scroll set set_axis set_button set_held stick stop tick to_f32 transform_point trigger twin_stick up update update_analog update_buttons value vector with_keyboard with_layout with_mouse xr_controller

ling-lex v2030.0.0

Lexical analysis and polyglot tokenization for Ling

9 public functions:

into_tokens is_keyword is_literal is_operator is_type new next_token peek pos

ling-macro v2030.0.0

Procedural macros for the Ling language ecosystem

1 public functions:

derive_ling_type

ling-mic v2030.0.2

Microphone input and real-time audio capture for Ling

7 public functions:

latest_samples open peak rms sample_rate start stop

ling-mir v2030.0.1

Ling MIR - Mid-level Intermediate Representation for codegen backends

7 public functions:

clone_blocks compute find_loops inline_function is_move_type new run

ling-music v2030.0.1

2030-ready music toolkit for Ling — decode, BPM/key analysis, GM-capable synthesis, rhythm-game & karaoke tools

53 public functions:

accuracy active_voices add_patch all_notes_off beat_grid bpm chroma detect detect_range duration from_beats from_bytes from_index from_name from_path from_str hz_to_midi hz_to_name index index_at judge key key_name line_at load midi_to_hz midi_to_name name name_to_hz name_to_midi new next_sample note note_off note_off_pitch note_on onset_envelope onsets parse parse_pitch pause pitch_class_name pitch_score play position register rms scale_steps seek set_track set_track_volume set_volume stop

ling-net v2030.0.0

Async networking — HTTP, WebSocket, QUIC, and peer-to-peer

56 public functions:

add append apply_delta approx_eq as_slice as_str at blob bool clear contains count delay delta_from expect_end finish fixed from_bytes from_seed generate get hash_snapshot head header is_empty is_success iter keyframe latest_tick len lerp matches_local new ok post public_key push quat raw remaining sample server_public_key set set_delay sign sign_snapshot stats_of str text to_bytes vec3 verify with with_capacity with_genesis with_stats

ling-physics v2030.1.8

Physics, world generation, and hyperbolic geometry for Ling

142 public functions:

aabb_max aabb_min acceleration_from_force acceleration_from_force_4d add add_room advance ambient_light angle_between angle_between_4d angular_speed angular_velocity apply_force apply_impulse apply_impulse_at apply_spin apply_torque bounce_floor bounce_velocity bounce_velocity_4d buoyancy_force centripetal_force centroid clamp_magnitude clamp_magnitude_4d contain cross damping_force damping_force_4d day_fraction deformation directional_light distance distance_4d distance_4d_squared distance_squared dot dot_4d drag_force drag_force_4d eval_node_transform exp_map fbm find floor_collision fog_color from_poincare gen_grass generate get_chunk get_height gravitational_attraction gravitational_attraction_4d gravity_dir gravity_force gravity_force_4d gust integrate is_day is_raining is_snowing joint_matrices kick lambda lerp lerp_4d load load_chunk log_map lorentz_force magnitude magnitude_4d mean_velocity mix_amount mobius_add moon_direction nbody_accel new normalize normalize_4d oil_at overlaps parallel_transport pentagon_tiling pentagon_vertices perpendicular_2d place portal_at pressure_force project project_4d quat_from_euler quat_mul reflect reflect_4d refresh_inertia reject reject_4d remove repulsive_force repulsive_force_4d resolve_collision rotate_axis_angle rotation_4d_from_axis_angle sample sample_height sample_rgb set_colors set_gravity signed_area_2d sky_color smooth_lerp smooth_lerp_4d spawn_entity sphere spin splat spring_force spring_force_4d step sun_direction terminal_velocity to_poincare total_oil total_water transform transform_dir transform_vec3 translate_pentagon unit_cube up_at update update_lod vec3_to_vec4 vec4_to_vec3 viscous_drag water_at wind_deform wind_force wind_vector world_distance world_origin

ling-polyglot v2030.0.0

Polyglot lexicon system - 16+ human languages

12 public functions:

as_str builtin_ja builtin_ko builtin_th builtin_zh detect_language from_str insert new to_canonical to_native translate_keyword

ling-py v2030.0.0

Python bindings for ling-audio, ling-physics, and ling-net

No public free functions (types / re-exports only).

ling-runtime v2030.0.0

Ling language runtime — GC, allocator, and standard library

7 public functions:

into_inner ling_debug ling_panic ling_print ling_sleep_ms ling_time new

ling-ui v2030.0.1

Ling UI framework — retained-mode widgets and flex layout

54 public functions:

add apply bar battery beveled_rect button checkbox clear compass cooldown corner_brackets counter done dpad ease from_name gauge gauge3d glyph healthbar hit_rect is_settled minimap mix new panel panel3d pixels progress radar radar3d render_widget reticle ring scanlines segbar set_target shade simple_layout slider slotgrid spark stepper tabs target text_lines text_width toggle tooltip ui update value vignette vu

ling-wasm v2030.0.8

Ling language — WebGL2 WASM runtime

2 public functions:

init_canvas run_program

道场 — Shrine Room

Source: examples/3d-rooms/ling-dao-chamber.ling

A quiet Chinese-Japanese temple rendered entirely with vector geometry (vtex_*). No pixel fills. Slow, dignified motion in a gold · jade · crimson palette.

Features demonstrated:

  • vtex_torii — torii gate
  • vtex_pagoda — five-tier pagoda
  • vtex_spiked_cog — gear mandala altar
  • vtex_chakra + vtex_lotus — dharma-wheel mandala
  • Pentatonic bell-circle audio with spatial 3D positioning
  • Pendulum camera orbit

Run with:

ling examples/3d-rooms/ling-dao-chamber.ling

Garden

Source: examples/audiovisual/Garden.ling

An outdoor garden scene with flowing organic geometry.

Run with:

ling examples/audiovisual/Garden.ling

Hyperbolic World — an H²×ℝ block walker

examples/physics/hyperbolic_world.ling is a tiny game world inspired by Hypermine. Hypermine is set in (fully 3-D hyperbolic space); this demo uses the simplest playable cousin, H²×ℝ: you walk on the hyperbolic plane (the Poincaré disk) with ordinary vertical gravity.

ling run examples/physics/hyperbolic_world.ling

Controls

KeyAction
W / Swalk forward / back
A / Dstrafe left / right
Q / Eturn left / right
SPACEjump (gravity pulls you back down)

What makes it hyperbolic

  • Exponential crowding. Blocks are placed on a lattice of growing rings; because the plane is hyperbolic, ever more cells pile up toward the horizon (the disk boundary = infinity) and shrink via the Poincaré conformal factor 1 − |z|².
  • Möbius locomotion. You stay at the disk centre and the whole world slides under you by a Möbius translation z ↦ (z + a)/(1 + ā z). Turning is a rotation about the centre.
  • Holonomy. Walk a closed loop and you come back rotated — the signature effect of moving through negatively-curved space. (Try strafing in a square.)
  • Gravity acts on the ordinary vertical axis (the ℝ factor), so jumping and falling feel completely normal even though the ground is hyperbolic.

Procedural block “textures”

Each cell hashes its lattice id (fract(sin(...))) into a block type (grass / stone / dirt / crystal) and a height, so the world is generated without any texture assets — the colour is the procedural texture, shaded with the holographic cel renderer.

Notes & ideas

  • The blocks are drawn with the cube primitive; swap in prism, cylinder, or icosahedron for different tilings.
  • Increase the ring count or cells = 6 * ring for a denser world.
  • This is H²×ℝ, not full H³ — a true Hypermine-style H³ voxel engine would track an {p,q,r} honeycomb and node graph, which is a much larger build.