This commit is contained in:
nub31
2025-08-18 16:56:20 +02:00
parent 860e1fd0e4
commit f80be58fed
5 changed files with 73 additions and 153 deletions

View File

@@ -1,11 +1,17 @@
CFLAGS = -g
NUBC = ../src/compiler/NubLang.CLI/bin/Debug/net9.0/nubc
bin/out: src/main.nub
dotnet build ../src/compiler/NubLang.CLI/NubLang.CLI.csproj -c Release
../src/compiler/NubLang.CLI/bin/Release/net9.0/nubc src/main.nub
out: $(NUBC) main.nub
$(NUBC) main.nub
run: bin/out
bin/out
$(NUBC):
dotnet build ../src/compiler/NubLang.CLI/NubLang.CLI.csproj
run: out
out
clean:
rm -r bin-int bin
@rm out 2>/dev/null || true
@rm out.a 2>/dev/null || true
@find . -name "*.o" -type f -delete
@find . -name "*.s" -type f -delete
@find . -name "*.ssa" -type f -delete

View File

@@ -1,49 +0,0 @@
// c
extern func puts(text: cstring)
// raylib
extern func InitWindow(width: i32, height: i32, title: cstring)
extern func CloseWindow()
extern func WindowShouldClose(): bool
extern func BeginDrawing()
extern func EndDrawing()
extern func ClearBackground(color: Color)
extern func DrawCircle(centerX: i32, centerY: i32, radius: f32, color: Color)
struct Color
{
r: u8
g: u8
b: u8
a: u8
}
struct Vector2
{
x: f32
y: f32
}
struct Vector3
{
x: f32
y: f32
z: f32
}
func main(args: []cstring): i64
{
InitWindow(800, 600, "Hello from nub!")
while !WindowShouldClose()
{
BeginDrawing()
ClearBackground(struct { r = 55 g = 55 b = 55 a = 255 })
DrawCircle(400, 300, 50, struct { r = 255 g = 255 b = 0 a = 0 })
EndDrawing()
}
CloseWindow()
return 0
}