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
+17 -11
View File
@@ -149,7 +149,7 @@ func Main() -> int {
| **Methods** | `extend` blocks for struct methods |
| **Interfaces** | `interface` + `extend` for trait-like behavior |
| **Error Handling** | `Result<T,E>`, `Option<T>`, and the `?` operator |
| **Standard Library** | `Io`, `Array`, `String`, `Map`, `Fs`, `Mem`, `Set`, `Path`, `Math`, `Task`, `Channel` |
| **Standard Library** | `Io`, `Array`, `String`, `Map`, `Fs`, `Mem`, `Set`, `Path`, `Math`, `Task`, `Channel`, `Os`, `Time`, `Process` |
| **Backend** | C transpiler (self-hosting + bootstrap) |
| **Strings** | Raw multi-line backtick strings (`...`), C-string interop |
| **Gradual Ownership** | `@[Checked]` + `&T`/`&mut T` borrow checking |
@@ -166,18 +166,22 @@ func Main() -> int {
```
bux/
├── src/ # Bootstrap compiler (Nim)
├── src_bux/ # Self-hosting compiler source (Bux)
├── _selfhost/ # Self-hosting build artifacts
├── stdlib/ # Standard library (.bux + .c runtime)
│ └── Std/
├── Io.bux, String.bux, Array.bux, Map.bux
├── Fs.bux, Mem.bux, Set.bux
├── Path.bux, Math.bux
── Task.bux, Channel.bux
├── compiler/ # Compiler source code
│ ├── bootstrap/ # Bootstrap compiler (Nim)
├── selfhost/ # Self-hosting compiler source (Bux)
│ └── tests/ # Compiler unit tests (Nim)
├── library/ # Standard library
├── std/ # Standard library modules (.bux)
├── Io.bux, String.bux, Array.bux, Map.bux
├── Fs.bux, Mem.bux, Set.bux
── Path.bux, Math.bux
│ │ └── Task.bux, Channel.bux
│ └── runtime/ # C runtime files (runtime.c, io.c)
├── tests/ # Language integration tests
├── examples/ # Example programs
├── tests/ # Unit tests (Nim)
├── tools/ # Additional tooling
├── docs/ # Documentation
├── buxs/ # Windows-compatible project root
├── README.md
├── PLAN.md # Roadmap to self-hosting
└── Makefile
@@ -204,6 +208,8 @@ make test-examples
make clean
```
> **Windows users:** Use the `buxs/` directory as your project root to avoid path conflicts.
---
## Documentation