Language overview
Meta: this is the "mental model" page. Don't repeat material from the topic pages — just plant the seeds (immutability + CoW, prototype objects, schema-driven types, null tracking) so the rest of the guide has hooks to hang things on.
Design philosophy
- familiarity over theory
- ergonomics over syntactic purity
- expressiveness over performance
- safety over surprises
- "a leaf in the wind" — low cognitive overhead so brainpower stays on the glued-together product
What's distinctive
- types and root functions come from a GraphQL schema, not handwritten declarations (GraphQL interop)
- prototype-based objects (
type Foodeclares both a type and its constructor) (Objects (type)) - multi-field selection:
user.{name, posts.{title}}becomes one query (Objects (type)) - null tracking in the type system (
String≠String!) (Types and nullability, Flow-sensitive typing) - optional parens for zero-arg calls — fields and methods feel the same (Fields:
pubandlet) - directives instead of comment pragmas (Directives)
- directory-level modules — split files however (Modules and imports)
How a Dang program is shaped
- a file is a sequence of declarations and forms (the start rule is
Dang; see Grammar notes) - declarations are hoisted and order-independent within a file/directory
pubexposes a name;letkeeps it private (both are visibility keywords on field declarations)assert { ... }is built in — high-level testing without a framework (Standard library reference, Errors:try,catch,raise)
Runtime model in one paragraph
Meta: pitch this as "values are immutable; methods on types look mutating but return a forked copy." That single line saves a lot of confusion later in Mutation and copy-on-write.
What's not in the language
- no inheritance (only
implementsfor interfaces — see Interfaces and unions) - no metaprogramming / macros