v1.0 syntax
Syntax v1.0: Standard keywords
The final Fid syntax, adopted ahead of self-hosting. The original signature keywords are replaced with standard, universally understood ones.
The changes
| Old | New |
|---|---|
pf | fn |
pv | val |
pv mut | var |
pc | const |
ret | return |
ty | type |
pm | removed; use var x: T; |
cap (capabilities/traits) and use ... with { ... } (capability grants) are kept. They are short, distinct, and part of Fid’s identity.
Why
- Familiar over unique: every new user previously had to learn six unfamiliar keywords before writing a line of code.
- AI-native: models are trained on billions of lines using
fn- andreturn-style keywords; the original spellings fought that familiarity for zero benefit. - Self-hosting: the compiler will be written in Fid itself. Standard keywords make its source readable to every contributor.
- Zero cost: keyword spelling has no effect on compile speed, binary size, or runtime performance.
The val/var pair (from Kotlin/Scala/Swift) gives a clean three-keyword binding model with const for compile-time values, and var without an initializer replaces the old pm keyword, backed by the same definite-assignment analysis.
Migration is mechanical: a single ordered find-and-replace converts a whole codebase. See the migration guide for the script and edge cases.