feat: add stdlib IO and extern function support

- Add stdlib/io.c with PrintLine, Print, PrintInt, PrintFloat, PrintBool, ReadLine
- Support extern function declarations (functions without body)
- Generate C forward declarations for extern functions
- Map Bux type names (String, int, etc.) to C types in codegen
- Update build system to copy all stdlib files
- Hello World example works: prints 'Hello, Bux!'
This commit is contained in:
2026-05-30 22:56:03 +03:00
parent 8e74215378
commit 782aaa729d
5 changed files with 123 additions and 19 deletions
+1
View File
@@ -126,6 +126,7 @@ type
HirModule* = object
funcs*: seq[HirFunc]
externFuncs*: seq[HirFunc] # Functions declared with extern (no body)
structs*: seq[tuple[name: string, fields: seq[tuple[name: string, typ: Type]]]]
enums*: seq[tuple[name: string, variants: seq[string]]]
consts*: seq[tuple[name: string, typ: Type, value: HirNode]]