Keywords - The Nitrate Programming Language

Nitrate keywords are predefined, reserved identifiers that have special meanings to the compiler. They can't be used as identifiers in your program. The following table lists the keywords in the Nitrate programming language. The usage and semantics of keywords is outside the scope of the lexical structure specification.

Keywords

KeywordDescription
subsystemDefines a namespace with optionally annotated dependencies
importImport an external symbol
pubDesignates public visibility
secDesignates private visibility
proDesignates protected visibility
typeType alias (meaning is context-dependent)
letDeclare a stack-allocated variable
varDeclare a heap-allocated variable
constRead-only variable (meaning is context-dependent)
staticMeaning is context-dependent
structDefine an ordered composition of fields and methods
regionDefine a packed composition of fields and methods
groupDefine an unordered composition of fields and methods
classDefine an unordered composition of fields and methods
unionDefine a superposition of other types
opaqueOpauqe type
enumDefine a set of named constants
fstringMark a string as a format string
withAssign named attributes
fnFunction (meaning is context-dependent)
noexceptNo exceptions are thrown
foreignImported symbol is implemented in a different language
impureFunction is not pure
tsafeFunction is thread-safe
pureFunction is pure
quasipureFunction is pure if and only if its returned value is not used
retropureFunction is pure if and only if its the only item preventing it arguments from being unused
crashpointCode is a crash point
inlineRequest for inlining
unsafeHere be dragons
safeSafe code
volatileI don't know what I'm doing with this
promiseFunction contract specification
ifControl flow
elseControl flow
forControl flow
whileControl flow
doControl flow
switchControl flow
caseControl flow
defaultControl flow
breakControl flow
continueControl flow
retReturn statement
retifSyntax sugar for: if (cond) { ret val; }
retzSyntax sugar for: if (!cond) { ret val; }
retvSyntax sugar for: if (cond) { ret; }
formConcurrent iteration
foreachFor-each loop
tryException handling
catchCatch exception
throwRaise exception
__asm__Inline assembly
voidAbsence of thing
undefUninitialized value
nullSatan's pet lizzard
trueBoolean true
falseBoolean false

Formal Definition

<keyword> ::= "subsystem" | "import" | "pub" | "sec" | "pro" | "type" | "let" |
              "var" | "const" | "static" | "struct" | "region" | "group" |
              "class" | "union" | "opaque" | "enum" | "fstring" | "with" |
              "fn" | "noexcept" | "foreign" | "impure" | "tsafe" | "pure" |
              "quasipure" | "retropure" | "crashpoint" | "inline" | "unsafe" |
              "safe" | "volatile" | "promise" | "if" | "else" | "for" |
              "while" | "do" | "switch" | "case" | "default" | "break" |
              "continue" | "ret" | "retif" | "retz" | "retv" | "form" |
              "foreach" | "try" | "catch" | "throw" | "__asm__" | "void" |
              "undef" | "null" | "true" | "false"