Language specification
This chapter covers the following topics:
Syntax
- Basic syntax
- code comments
- whitespace
- splitting lines using
|
- String literals: escape sequences, character literals
Type system
- Data types
- primitive types:
byte,pair,int,bool - type aliases using
type - function pointers
- primitive types:
- Arrays: static versus dynamic arrays, guidance for resizing arrays
- Generics: defining and using parameterized types
Execution model
- Expressions: literal values, operators, Euclidean division, function-like operators such as
to_byte(x) - Statements: assignment, function call,
return,loop/drop/lift,if, the debuggerbreakstatement - Variables: local variables,
funcparameters,modulemembers,classmembers,view var - Functions:
modulefunctions,classfunctions, assembly functions (chombitandintrinsic)
Program structure
- Modules
- Classes: member functions, inheritance, class operators (
asandclass_id()) - Name rules and conflicts: name scopes and qualifiers, "counterparts" such as a
classandmodulewith the same name
Memory management
- Data blocks:
datablocks, labels using@, and polymorphic data - Storage directives:
located at,inset, Caret types - Unsafe operator: performance optimizations that bypass compiler checks, with potential risks if used incorrectly