amber-lang / amber-lang/amber-docs
Language features page
- Lingua principale
- TypeScript
- Stelle
- 13
- Fork
- 18
- Merge medio
- 11h 1m
- PR unite (30g)
- 4
Descrizione
Example content:
```
# Language Features
## Type System
- **Primitives**: `Null`, `Text`, `Num`, `Bool`.
- **Arrays**: Generic `Array` for ordered collections.
- **Union Types**: `A | B` enables values of multiple possible types.
- **Inference & Generics**: Types are inferred from context; functions can be generic and specialized at compile‑time.
## Functions
- **Type‑specialized variants** (monomorphization) for performance.
- **Overloading** by distinct type signatures.
- **Optional parameters** with default values.
- **Reference parameters** allow in‑place modification of arguments.
- **Variant caching** avoids recompilation of identical specializations.
## Variables and Scope
- `let` creates immutable bindings, `var` creates mutable ones.
- Lexical block scope; inner blocks can shadow outer variables.
- Top‑level bindings are module‑wide globals.
## Expressions and Statements
- **Expressions** produce values (e.g., literals, function calls, arithmetic).
- **Statements** perform actions (assignments, control flow, imports).
- The language distinguishes value‑producing expressions from effectful statements.
## Literals
- **Text**: double‑quoted or single‑quoted strings.
- **Numbers**: integer and floating‑point literals.
- **Booleans**: `true` and `false`.
- **Null**: `null`.
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.