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
+5 -1
View File
@@ -15,6 +15,7 @@ pub fn link(paths []string, out string) ! {
mut strings := []string{}
mut symbols := map[string]int{}
mut relocs := []obj.Reloc{}
mut lines := []obj.LineInfo{}
for p in paths {
o := obj.read(p)!
base := code.len
@@ -28,6 +29,9 @@ pub fn link(paths []string, out string) ! {
for r in o.relocs {
relocs << obj.Reloc{ offset: r.offset + u32(base), name: r.name, kind: r.kind }
}
for l in o.lines {
lines << obj.LineInfo{ off: l.off + u32(base), line: l.line }
}
}
// resolve relocations
for r in relocs {
@@ -47,7 +51,7 @@ pub fn link(paths []string, out string) ! {
for name, entry in symbols {
fns << obj.BinFn{ name: name, entry: entry }
}
obj.write_bin(out, obj.Bin{ fns: fns, strings: strings, code: code })!
obj.write_bin(out, obj.Bin{ fns: fns, strings: strings, code: code, lines: lines })!
}
fn intern_str(mut table []string, s string) int {