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

Backends

Every target receives the same typed IR and emits an ordinary library. The build output for one package is:

TargetModuleRuntime
TypeScriptout/ts/src/<package>.tsout/ts/_lingua_rt.ts
Pythonout/py/gen/<package>.pyout/py/lt_runtime.py
Goout/go/gen/<package>/<package>.goout/go/lt/runtime.go

The package name, not the file name, determines the module. A file contains exactly one package. Packages from external dependencies are emitted under _deps/<key>/ and do not expose their tests.

Shared mapping

LTTypeScriptPythonGo
Intbigint + i64 helpersint + 64-bit maskint64
Floatnumberfloatfloat64
Strstringstrstring
Boolbooleanboolbool
List<T>LList<T>LListList[T]
Map<K,V>LMap<K,V>LMapMap[K,V]
Dict<V>LDict<V>LDictDict[V]
Set<T>LSet<T>LSetSet[T]
Option<T>tagged unionOptVariant
Result<T,E>tagged unionResVariant
structreadonly classfrozen dataclassstruct + constructor
enumtagged unionfrozen dataclassVariant

Names follow the host convention: camelCase in TypeScript, snake_case in Python and Go, with export controlling visibility. Private declarations remain callable from the same package’s tests.

Test runners

TargetRunnerCommand
TypeScriptvitest + tsc --strictlt test -t ts … --run
Pythonpytest + mypy --strictlt test -t py … --run
Gogo test + go vetlt test -t go … --run

Read the target page for the exact representation, package layout, naming, and limitations: