This commit is contained in:
nub31
2026-02-27 22:20:32 +01:00
parent e512650440
commit 73ecbf8e9b
10 changed files with 163 additions and 90 deletions

View File

@@ -10,4 +10,6 @@ popd
pushd program
dotnet run --project ../../compiler main.nub ../math/.build/out.nublib ../core/.build/out.nublib
popd
popd
./program/.build/out

View File

@@ -1,6 +1,11 @@
module print
module core
extern func puts(^u8 text)
export extern func malloc(size: u64): ^void
export extern func free(size: ^void)
export func print(text: string) {
extern func puts(text: ^u8)
export func print(text: string)
{
puts(text.ptr)
}

View File

@@ -1,17 +1,9 @@
module main
struct Pos {
x: i32
y: i32
}
func main(): i32
{
test({ x = 23 y = 23 })
return 1
core::print("Hello, world")
let ptr = core::malloc(64)
core::free(ptr)
return 0
}
func test(x: Pos): void
{
}