Production pass: floats, GC, type checking, and tooling

Adds floats, bitwise ops, UTF-8 strings with methods, try/catch,
closures, generics validation, a compile-time type checker, a
mark-and-sweep GC, source-level debug info, constant folding, and
the repl/fmt/package-manager commands.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
allexanderbergmns
2026-08-25 14:29:15 +02:00
parent b0a4da7e2f
commit 9b22be48a5
27 changed files with 3638 additions and 166 deletions
+58
View File
@@ -47,3 +47,61 @@ const op_shas = u8(40)
const op_sdel = u8(41)
const op_slen = u8(42)
const op_skeys = u8(43)
const op_slice = u8(44)
const op_push_f = u8(45)
const op_native = u8(46)
const op_and_b = u8(47)
const op_or_b = u8(48)
const op_xor = u8(49)
const op_shl = u8(50)
const op_shr = u8(51)
const op_not_b = u8(52)
const op_try = u8(53)
const op_throw = u8(54)
const op_catch_done = u8(55)
const op_closure = u8(56)
const op_call_closure = u8(57)
const op_argc = u8(58) // push the current frame's arg count
const op_load_dyn = u8(59) // pop idx, push stack[bp + idx]
const op_varargs = u8(60) // <named:i64> <dst:i64> — collect args[named..argc-1] into an array at local dst
const op_str_method = u8(61) // <name:str> <argc:i64> — call a string method (s.len(), s.contains(x), ...)
// native builtin ids (keep in sync with vm/opcodes.v)
const native_abs = 100
const native_min = 101
const native_max = 102
const native_pow = 103
const native_sqrt = 104
const native_floor = 105
const native_ceil = 106
const native_round = 107
const native_rand = 108
const native_rand_int = 109
const native_int = 110
const native_str = 111
const native_float = 112
const native_type = 113
const native_split = 114
const native_join = 115
const native_contains = 116
const native_starts_with = 117
const native_ends_with = 118
const native_trim = 119
const native_lower = 120
const native_upper = 121
const native_pop = 122
const native_insert = 123
const native_remove = 124
const native_sort = 125
const native_clone = 126
const native_reverse = 127
const native_index_of = 128
const native_args = 129
const native_getenv = 130
const native_setenv = 131
const native_exit = 132
const native_time = 133
const native_sleep = 134
const native_read_file = 135
const native_write_file = 136
const native_eprint = 137