Atoll follows Rust-style naming across source programs, compiler concepts, and runtime APIs.
| Declaration | Convention | Example |
|---|---|---|
| Function or method | snake_case |
byte_length |
| Local or parameter | snake_case |
retry_count |
| Module | snake_case |
http_client |
| Struct, enum, trait, alias | PascalCase |
HttpRequest |
| Enum variant | PascalCase |
NotFound |
| Constant | SCREAMING_SNAKE_CASE |
MAX_RETRIES |
| Generic parameter | short uppercase or PascalCase |
T, Item |
| Decorator | lowercase snake_case |
@noinline |
Built-in types
Scalar and string built-ins are lowercase:
int, float, bool, char, byte, the fixed-width numeric names,
string, and substring.
Byte sequences use the composite forms []byte and [..]byte. The old
nominal bytes type has been retired even though it remains in the legacy
style document.
Nominal composite built-ins use PascalCase, including List, Map, Set,
Option, and Result. Sugar such as []T, [..]T, T?, and T!E does not
change those underlying names.
Acronyms
Treat an acronym as one word: HttpClient, IoError, parse_url, and
xml_to_json.
Predicates
Prefer is_, has_, or can_ when the prefix makes a boolean member read
like a question: is_empty, has_items, can_edit.
Naming diagnostics
The semantic naming lint reports non-fatal warnings as ATOLL7002 and includes
a replacement suggestion.
The lint is on by default. @allow(naming) on a declaration keeps its name as
written, and ATOLL_LINT_NAMING=0 turns the pass off for a whole run. Naming
remains the project convention even when the pass is off.
Current coverage
The pass checks:
- top-level functions;
- structs, enums, error types, traits, aliases, and error unions;
- inline and
implmethods; - enum and error variants;
- constants.
The current warning walk does not yet diagnose fields, parameters, local
bindings, generic parameters, module names, models, or schemas. Those names
should still follow the table above; absence of ATOLL7002 is not an alternate
style rule.
Leading underscores are permitted before each supported casing, so internal
names such as __split_list and _HttpState retain their marker without
changing the casing of the meaningful part.
Suppression
Use @allow(naming) when a declaration must mirror an external spelling.
@allow(naming)
fn JSON_parse(input string) string {
return input
}On an enum or error type, the suppression also covers its variants. On an
impl, it applies to methods that do not carry their own decorator list.
The current AST does not retain declaration decorators on aliases or constants, so their naming warnings cannot yet be locally suppressed. Rename them or disable the opt-in pass for that build. This is an implementation boundary, not a recommendation to use inconsistent alias or constant names.
Migration
The current implementation differs from details in the legacy style document:
the diagnostic is ATOLL7002, the pass is on by default, the no-inline decorator is @noinline, byte sequences
use []byte or [..]byte, and nominal composite built-ins remain
PascalCase. This specification follows the parser, semantic lint, and
installed stdlib.