2. DQ Programming Language
This chapter is the complete DQ language reference, organized from basic syntax to platform access. Each topic introduces its concepts, then describes syntax, type rules, lifetime constraints, and examples in the same chapter.
If DQ is new to you, begin with Getting Started to install the compiler and run a program. This reference describes DQ 0.93.16. DQ is still under development, so match the documentation to your compiler version.
Most code blocks illustrate declarations or statements in their surrounding
context; examples containing func *Main() are complete programs unless they
explicitly import companion files. Copy a complete program into a .dq file
and run it with dq-run filename.dq. Assembly examples identify their target.
Contents
- Basic Syntax
- Basic Types and Conversions
- Variables, Constants, References, and Scope
- Expressions and Operators
- Literals and Integer Promotion
- Statements and Control Flow
- Functions
- Character and String Types
- String Functions
- Text Formatting
- Arrays and Slices
- Enumerations
- Structures and Unions
- Pointers
- Objects and Properties
- Memory Management and Autofree
- Exceptions and Error Handling
- anyvalue
- Modules and Packages
- Attributes
- Compiler Directives
- C Interoperability
- Assembly Functions