This commit is contained in:
nub31
2025-06-27 15:55:32 +02:00
parent d9027d6751
commit 19c309c494
20 changed files with 159 additions and 232 deletions

8
example/compile.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
object_files=$(dotnet run --project ../src/compiler/CLI/CLI.csproj src/main.nub src/c.nub)
echo $object_files
mkdir -p bin
gcc -o bin/out $object_files

Binary file not shown.

View File

@@ -1,43 +0,0 @@
namespace main
struct Human {
name: cstring
}
export func main(args: []cstring): i64 {
// let human: Human
// human = alloc Human {
// name = "member"
// }
// c::puts(human.name)
// c::puts("literal")
// let x: cstring
// x = "variable"
// c::puts(x)
// let y: func(cstring)
// y = c::puts
// y("proxy")
// func(){ c::puts("anon") }()
// let z: func()
// z = func() { c::puts("anon variable") }
// z()
c::printf("%d\n", "test".count)
// c::puts("test")
return 0
}

6
example/src/main.nub Normal file
View File

@@ -0,0 +1,6 @@
namespace main
export func main(args: []cstring): i64 {
c::puts("test")
return 0
}