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:
@@ -0,0 +1,34 @@
|
||||
module Std::Os {
|
||||
|
||||
extern func bux_argc() -> int;
|
||||
extern func bux_argv(index: int) -> String;
|
||||
extern func bux_getenv(name: String) -> String;
|
||||
extern func bux_setenv(name: String, value: String) -> int;
|
||||
extern func bux_getcwd() -> String;
|
||||
extern func bux_chdir(path: String) -> int;
|
||||
|
||||
func Os_ArgsCount() -> int {
|
||||
return bux_argc();
|
||||
}
|
||||
|
||||
func Os_Args(index: int) -> String {
|
||||
return bux_argv(index);
|
||||
}
|
||||
|
||||
func Os_GetEnv(name: String) -> String {
|
||||
return bux_getenv(name);
|
||||
}
|
||||
|
||||
func Os_SetEnv(name: String, value: String) -> bool {
|
||||
return bux_setenv(name, value) == 0;
|
||||
}
|
||||
|
||||
func Os_GetCwd() -> String {
|
||||
return bux_getcwd();
|
||||
}
|
||||
|
||||
func Os_Chdir(path: String) -> bool {
|
||||
return bux_chdir(path) == 0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user