Language support
Yantrix aims to transpile to any turing-full language, the primary one being Typescript. Since implementation is independent, certain features may be shipped at varying times for different languages.
| Feature | JS | TS | PureJS1 | PureTS1,2 | Python3 | Java |
|---|---|---|---|---|---|---|
| FSM from diagram | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Context / reducers | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Payloads | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Expressions | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Built-in functions | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
define/fn(args) => expr | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| User function injection4 | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Forks / predicates | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Event subscription | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Event emission | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
createEventBus() factory | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
@yantrix/core compatible5 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Epoch tracking | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Cycle counter | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Named ID type aliases | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ |
| TypeScript declarations | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ |
| Pause / resume / disable | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Zero external runtime deps | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| Side effects | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
NOTE
1 pure-javascript and pure-typescript produce self-contained output with zero npm runtime dependencies. No @yantrix/core or @yantrix/automata import in the generated file.
2 pure-typescript emits a .js file plus a .d.ts type declaration file as a pair.
3 Python requires pydash as a runtime peer dependency.
4 User function injection accepts .ts/.js files for JS/TS dialects and .py files for Python.
5 @yantrix/core compatible means the generated code exposes event adapters that can be plugged into @yantrix/core's CoreLoop orchestrator. Pure dialects and Python generate self-contained factories without event adapter infrastructure.
Type Mapping
| Language | Language Type | Yantrix Type |
|---|---|---|
| JS/TS | String | String |
| JS/TS | Number | Number |
| JS/TS | Array | List |
| JS/TS | Object | Object |
| Python | String | String |
| Python | Integer/Float* | Number |
| Python | List | List |
| Python | Dictionary | Object |
| Java | String | String |
| Java | Long | Number |
| Java | List | List |
| Java | Map | Object |
NOTE
* Values are typecasted depending on expression context