Appendix C: Implementation Limits

This appendix documents implementation-defined limits of the Rue compiler. These limits are normative: a conforming implementation MUST support at least the minimum values specified here. Implementations MAY support larger values.

Programs that exceed these limits are not guaranteed to compile or execute correctly. A conforming implementation SHOULD produce a diagnostic when a limit is exceeded.

Numeric Limits

Integer literals MUST be representable as unsigned 64-bit integers during lexing. This limits literal values to the range 0 to 18446744073709551615 (2^64 - 1).

The following integer types have the specified ranges:

TypeMinimumMaximum
i8-128127
i16-3276832767
i32-21474836482147483647
i64-92233720368547758089223372036854775807
u80255
u16065535
u3204294967295
u64018446744073709551615

Source File Limits

Source file size MUST be representable using 32-bit byte offsets. This limits source files to 4 GiB (4,294,967,295 bytes).

The span tracking system uses 32-bit unsigned integers for byte offsets, which determines this limit.

Array Limits

Array length MUST be representable as an unsigned 64-bit integer. This limits array sizes to 2^64 - 1 elements.

Practical limits on array size are determined by available memory and platform constraints rather than the type system.

Identifier Limits

There is no explicit limit on identifier length. Identifiers are stored as dynamically-allocated strings and are limited only by available memory.

Minimum Guaranteed Limits

A conforming implementation MUST support at least:

ConstructMinimum Limit
Source file size4 GiB
Integer literal value2^64 - 1
Array length2^64 - 1
Function parametersNo fixed limit
Struct fieldsNo fixed limit
Enum variants2^64
Nesting depth (blocks, loops, etc.)No fixed limit

"No fixed limit" means the construct is limited only by available memory, not by an explicit cap in the implementation.

Stack and Memory Considerations

While the language specification does not impose limits on recursion depth or stack usage, practical execution is constrained by:

  • Operating system stack limits
  • Available memory for local variables
  • Platform-specific calling convention limits

Programs requiring deep recursion or large stack allocations SHOULD be designed with these platform constraints in mind.