feat: lower typed programs and interpret IR

This commit is contained in:
2026-10-09 22:47:05 +02:00
parent bc318a29ad
commit 98f3a04daf
20 changed files with 2328 additions and 85 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ write_float proc($T type, output Writer, value T, scientific bool) void ! WriteE
match typeinfo!(T) {
.float: {
buffer [64]mut u8 := undefined
count := 0
count c_int := 0
if sizeof!(T) == 4 {
if (scientific) count = c.snprintf(ptrcast!((&buffer).ptr), c_ulong(buffer.len), "%.8e", value)
else count = c.snprintf(ptrcast!((&buffer).ptr), c_ulong(buffer.len), "%.9g", value)
+16
View File
@@ -0,0 +1,16 @@
# the bootstrap Init currently exposes only io; macOS provides process-lifetime argv storage.
@hide:file
_NSGetArgc c_func() @c_int
@hide:file
_NSGetArgv c_func() @*[*;0]u8
argument_count proc() usize {
return usize(_NSGetArgc()^)
}
#! returns a borrowed, zero-terminated argument; storage lasts for the process lifetime.
argument proc(index usize) ?[*;0]u8 {
if (index >= argument_count()) return null
return _NSGetArgv()^[index]
}