feat: restructure repo, borrow checker, expanded stdlib

- Reorganize repository to Rust-style layout:
  compiler/bootstrap/  compiler/selfhost/  compiler/tests/
  library/std/  library/runtime/  tests/  tools/
- Add buxs/ Windows-compatible project root
- Add borrow checker tests and implement:
  - Alias analysis (double mutable borrow detection)
  - Use-after-move detection for own T
- Expand standard library:
  - Std::Os: Args, Env, Cwd, Chdir
  - Std::Time: NowMs, NowUs, SleepMs
  - Std::Process: Run, Output
  - Std::Io: PrintInt64 (fixes 32-bit truncation bug)
- Add examples: os_time.bux, process.bux
- Fix PrintInt to use int64_t in C runtime
This commit is contained in:
2026-06-05 20:08:17 +03:00
parent a45a2ecd49
commit 9c6b516453
75 changed files with 581 additions and 79 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ make dev
The output is a single binary: `buxc` (bootstrap compiler in Nim).
The self-hosted compiler `buxc2` is built from `src_bux/*.bux` sources via:
The self-hosted compiler `buxc2` is built from `compiler/selfhost/*.bux` sources via:
```bash
make selfhost
```
@@ -140,7 +140,7 @@ bux/
│ ├── hir_lower.nim # AST → HIR lowering
│ ├── c_backend.nim # HIR → C code generation
│ └── ...
├── stdlib/ # Standard library
├── library/ # Standard library
│ ├── Std/
│ │ ├── Io.bux
│ │ ├── Array.bux
@@ -186,7 +186,7 @@ cat build/main.c
| Error | Cause | Fix |
|-------|-------|-----|
| `stdlib directory not found` | `buxc` can't find `stdlib/` | Run from project root or set correct path |
| `stdlib directory not found` | `buxc` can't find `library/` | Run from project root or set correct path |
| `duplicate symbol 'bux_alloc'` | Multiple stdlib modules declare same extern | Only declare in one module |
| `C compilation failed` | Generated C has errors | Check `build/main.c` for issues |