Language Reference
Full syntax, types, and module reference:
- Var - types, variables, literals, string interpolation, structs
- Preprocessor -
#define and #include (file and plugin)
- Operators - arithmetic, comparison, logical, bitwise, ternary
- Control flow - if/else, while, for, foreach, break, continue, switch/case
- Functions - define, return, recursion, typed params, entry point
- Array - fixed-size typed arrays
- Class - OOP classes with fields and methods
- Object - root class for all user-defined classes
- Exception - built-in error carrier for
try / catch
- Error handling - try/catch/finally, throw
- Modules - Konsol, Math, String, File, Time, List, Map, JSON, Path, OS, Regex, Date, Hash, CSV
- Plugin system
- Plugins - curl, ws, net, sqlite, mysql, pg, redis, zip, crypto, jwt
Notes
- Division by zero throws
MathException - catch with catch (MathException e).
- Arrays are fixed-size; out-of-bounds access throws
ArrayException - catch with catch (ArrayException e). e.code holds the attempted index.
#include "file.ks" is fully supported with transitive includes and include-guard deduplication. See Preprocessor.
- Variables declared inside
main() are properly scoped and cleaned up after main returns.
Math:Random uses srand/rand; not cryptographically secure. Use Math:Seed(n) for reproducible sequences.
String:Mid uses 1-based start index (like BASIC), not 0-based.