Backends
Every target receives the same typed IR and emits an ordinary library. The build output for one package is:
| Target | Module | Runtime |
|---|---|---|
| TypeScript | out/ts/src/<package>.ts | out/ts/_lingua_rt.ts |
| Python | out/py/gen/<package>.py | out/py/lt_runtime.py |
| Go | out/go/gen/<package>/<package>.go | out/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
| LT | TypeScript | Python | Go |
|---|---|---|---|
Int | bigint + i64 helpers | int + 64-bit mask | int64 |
Float | number | float | float64 |
Str | string | str | string |
Bool | boolean | bool | bool |
List<T> | LList<T> | LList | List[T] |
Map<K,V> | LMap<K,V> | LMap | Map[K,V] |
Dict<V> | LDict<V> | LDict | Dict[V] |
Set<T> | LSet<T> | LSet | Set[T] |
Option<T> | tagged union | Opt | Variant |
Result<T,E> | tagged union | Res | Variant |
struct | readonly class | frozen dataclass | struct + constructor |
enum | tagged union | frozen dataclass | Variant |
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
| Target | Runner | Command |
|---|---|---|
| TypeScript | vitest + tsc --strict | lt test -t ts … --run |
| Python | pytest + mypy --strict | lt test -t py … --run |
| Go | go test + go vet | lt test -t go … --run |
Read the target page for the exact representation, package layout, naming, and limitations: