Skip to main content

Not in BT

Features BT deliberately leaves out, and what to write instead.

Types​

AbsentWrite instead
User-defined generic types and functionsThe built-in parameterized types (array<T>, map<K, V>, ...); interfaces; function values.
Type inference (var, let, auto)Name the type: int n = 0;.
Unsigned integers other than byteint or int32, which are signed.
Tuples and multiple return valuesReturn an object.
Nullable scalars and strings (int?, string?)A sentinel value, a separate bool, or a wrapper object.
Flow-sensitive null narrowingCompare with null, then use the value; T? stays T?.
Type aliases—

Declarations​

AbsentWrite instead
Constructors and destructorsA factory function returning an object literal; explicit close methods.
Inheritance, abstract classes, implementsInterfaces (structural) and composition.
Static membersTop-level functions, constants and variables.
Method overloading and function overloadingDistinct names.
Default, optional and variadic parametersNamed arguments with explicit values; an array parameter.
Operator overloadingMethods.
Nested or local functionsTop-level functions.
Access modifiers other than ~~ (package-private declaration or field); everything else is public to files that include the package.
Attributes, annotations, decorators (@)—
Preprocessor and macros—

Expressions and operators​

AbsentWrite instead
Lambdas, closures, anonymous functionsTop-level functions as values; pass context as parameters or object fields.
Bound method values (obj.method as a value)A top-level function taking the receiver.
Ternary c ? a : bA switch expression, or if/else assigning a local.
Bitwise and shift operators (&, |, ^, <<, >>, unary ~)Arithmetic (*, /, %).
Prefix ++x; ++/-- as expressionsx++; as a statement.
printf-style formatting (width, padding, precision)Interpolation ("hp ${hp}") and float_to_string(x, decimals).
Indexing or slicing strings with []string methods (byte_at, slice, chars).
Hexadecimal, octal, binary literals; digit separatorsDecimal literals.
Map literals typed by their destinationA map literal takes its types from its first entry; write entries of the right type, or use new and assignment.
Empty [] and {} literalsnew array<T>(), new map<K, V>().
Reflection beyond typeof(T) (field enumeration, type names, dynamic invocation)—

Statements and control flow​

AbsentWrite instead
do ... whilefor { ...; if (!cond) { break; } }.
Labeled break/continue, gotoFlags, or move the inner loop into a function and return.
try / catch / finally!! { } handlers and && { } deferred blocks.
Throwing non-error valuesthrow new error(code, message);.
Empty statement ;{ }.

Collections​

AbsentWrite instead
Map deletionStore a nullable value or a tombstone flag.
Iterating channels or buffers with for ... inreceive() loops; index loops over a buffer.

Concurrency​

AbsentWrite instead
async / await keywordsEvery call may wait; branch and join make concurrency explicit.
select send armsA helper task that does the send.
Threads, atomics and condition variablesTasks, channels and Mutex.
Thread-local storagePass state explicitly.

Runtime​

AbsentNote
Manual memory management, pointersMemory is freed automatically.
FinalizersExplicit close; && { } cleanup.
Changing a running program in placeThe host recompiles and restarts the program.
Catching trapsTraps end the task; validate before dividing or indexing.

See also​