Skip to content
Dazzle
Search
Ctrl
K
Cancel
Dazzle on GitHub
Select theme
Dark
Light
Auto
Menu
Start here
Why Dazzle
Install Dazzle
Your first Dazzle program
Playground
Tour
The tour
Errors as values
Ownership and RAII
Safety without a borrow checker
Modules and imports
C and C++ interop
Macros
Types, generics and traits
The standard library
Tooling and error messages
Compared with
Bugs C++ lets through
Dazzle vs C++
Dazzle vs Carbon and cpp2
Dazzle vs Rust
Dazzle vs Zig
Specification
Overview
0. How to read this document
1. Design principles
2. Lexical structure
3. Projects, modules, and imports
4. Visibility
5. Types
6. Value semantics: ownership, copy, move, drop
7. Declarations
8. Generics
9. Errors and absence
10. Statements and control flow
11. Operators
12. Metaprogramming
13. Reflection
14. Memory and allocators
15. C++ interoperability
16. Code generation
17. Compiler architecture and toolchain
18. Decisions log
19. Roadmap
20. Appendix: grammar sketch
21. Changelog
Design decisions
All decisions
0001 Default type of an unsuffixed float literal
0002 Attribute syntax
0003 May a `&T` be stored in a struct field?
0004 `own` field with no `Drop`
0005 Function overloading
0006 Is `^Trait` one pointer or two?
0007 Keep the `!T` sigil?
0008 Error propagation style
0009 Macro invocation syntax
0010 Allocator passing
0011 Concurrency
0012 Hot reload
0013 Is `machine` native syntax or a macro?
0014 Generics: monomorphize or emit C++ templates?
0015 May `?` wrap a pointer or reference?
0016 Implicit `&T` → `^T` widening, and what a raw pointer may do
0017 `^T` → `&T`
0018 `collect`
open
0019 `ignore` in two positions
open
0020 `or unreachable` in a release build
0021 How `Iterate::next` spells one signature for both item kinds
0022 Is a slice writable through an immutable binding?
0023 Where do `Ord`, `Add`, `Iterate` and `Format` live before the stdlib?
0024 Array literals, and reaching an enum variant without naming its type
0025 Can a `&T` be read as a `T`?
0026 Copying a `T` inside a compile-time branch
0027 One operator, two right-hand sides
0028 `break` with a value
0029 An associated type per implementation
0030 `Error.location` is a `^T`
0031 How is a trait implemented, and where?
0032 Struct inheritance
0033 `move` on a copyable value
0034 `mut fn`
0035 Reading a `&T` as a `T` — the open half of 18.25
0036 Using a `T?` when both outcomes continue
0037 Read-only pointers, and what C's `const T*` becomes
0038 How C's unscoped enums and `#define`s come in
0039 How is a `cstr` made?
0040 A C type whose definition its header does not show
0041 What a C `union` becomes
0042 How a `for` binding holds its element
0043 How a `case` binding holds the payload
0044 Assigning to a `&mut T`
0045 A union variant that is an existing struct
0046 State that lives for the whole program
0047 The standard allocators
0048 Compile-time conditionals, and where a location comes from
0049 Evaluation order, and pointers as numbers
0050 Slices, text and bytes, and moving out of raw memory
0051 How `for` gets an iterator from a container
0052 A union variant that owns something
0053 `T` where a `T?` is wanted
0054 Traits an enum has without an `impl`
0055 The standard library's math
0056 Variadic parameters
0057 Where a module's imports are declared
0058 Whether a dependency's names reach the modules that depend on this one
0059 What reflection describes, and how a field carries metadata
0060 An attribute the compiler does not know
0061 How an `if let` binding holds the value
0062 Shared ownership, and handles that may be empty
0063 Integer overflow
0064 `Rc<Derived>` where an `Rc<Base>` is wanted
0065 How `std` reaches the operating system
0066 Generic methods
0067 Random numbers
0068 Files and paths
0069 Characters in UTF-8 text
0070 Sorting
0071 Text operations
0072 Arguments passed by name
0073 Library formatting
0074 When macros expand
0075 How a macro is written
0076 Hygiene, for declarations
0077 Where macros live
0078 Methods on unions
0079 Diagnostics in an expansion
0080 Formatting as macros
0081 The collections pass
0082 Formatting a pointer
0083 SlotMap and Key in std
0084 The C heap through an import of stdlib.h, and no alloc or free builtins
0085 Struct layout is the C++ compiler's, in declaration order
0086 Projections take their depth range as a required argument
0087 The orphan rule counts a trait's type arguments
0088 The module carrying a recipe owns the header's types
0089 Implicit argument conversions through ImplicitAs
0090 A recipe can build a library with its own CMake
0091 Ties: checked reference invalidation, and memory placed by the compiler
0092 How does a function say the text it returns points into nothing that dies?
0093 Views are borrowed: no bare str, slices or cstr, and no view outside a reference's places
0094 Safe code has no undefined behaviour: closing the holes ties leave
0095 A String keeps short text in place, and a view inside an element dies with the array
Project
Where Dazzle stands
Benchmarks
Contributing
Backlog
Dazzle on GitHub
Select theme
Dark
Light
Auto
`own` field with no `Drop`
Error.
It is always a leak and the fix is mechanical (
§6.5
)