Type System
This page explains how to think about Targo's type system, not every syntax detail.
The key mental model is simple:
Targo uses TypeScript-shaped syntax to express a Go-first type system.
What changes first
numberexists, but maps tofloat64- explicit Go numeric types still matter at boundaries
- conditions should stay explicitly
bool classis closer to a Go struct reference model than a JS class runtime- string length follows Go-style expectations when Unicode matters
Practical advice
- default to
intfor ordinary integer business logic - use concrete Go numeric types when width and compatibility matter
- choose
slice<T>first for Go-native data flow - reach for
Array<T>only when you explicitly want JS-style collection methods