The .syln schema.
One file describes your data types. SyncLangs reads it at build time and generates idiomatic, type-safe code for TypeScript, Python, Go, Rust, Java, C++, and C#. This page documents the syntax: primitives, collections, and how each maps to the target language.
Primitive types
| .syln type | Python | TypeScript |
|---|---|---|
| string | str | string |
| int | int | number |
| float | float | number |
| bool | bool | boolean |
| any | Any | any |
Collections
list<string>
Maps to list[str] in Python and string[] in TS.
map<string, int>
Maps to dict[str, int] in Python and Record<string, number> in TS.
Checked before codegen
Run syln check and SyncLangs validates every type, enforces naming rules, and resolves type references first. If the schema is wrong, you find out before any code is generated, not at runtime.
Regenerates on save
Run syln watch and it listens for file changes through native OS events (inotify, FSEvents). Edit the schema, save, and every target language regenerates. Your types stay in sync as you work.