Goal
Implement all 23 builtin functions in the interpreter runtime.
Current State
interpreter/src/runner/builtin/mod.rs only implements 5 of 23:
Implemented
- Print, Input, Len, LastWord (broken - calls exit(1)), Sum
Missing Builtins
Number - convert to number
Range - generate range list
Trim - trim string whitespace
Sqrt - square root
Timer - timing function
Max - maximum of two values
Mod - modulo operation (may overlap with % operator)
Min - minimum of two values
Round - round float
Floor - floor float
Ceil - ceiling float
Zig - run Zig code inline
StrUpper - uppercase string
StrReverse - reverse string
StrLower - lowercase string
Allocator - allocator function
ConvertString - string conversion
All of these fall to _ => Value::Void which silently does nothing.
Goal
Implement all 23 builtin functions in the interpreter runtime.
Current State
interpreter/src/runner/builtin/mod.rsonly implements 5 of 23:Implemented
Missing Builtins
Number- convert to numberRange- generate range listTrim- trim string whitespaceSqrt- square rootTimer- timing functionMax- maximum of two valuesMod- modulo operation (may overlap with % operator)Min- minimum of two valuesRound- round floatFloor- floor floatCeil- ceiling floatZig- run Zig code inlineStrUpper- uppercase stringStrReverse- reverse stringStrLower- lowercase stringAllocator- allocator functionConvertString- string conversionAll of these fall to
_ => Value::Voidwhich silently does nothing.