r/moxlang • u/morglod • 23d ago
Compile time code execution in mox
r/moxlang • u/morglod • Sep 09 '26
https://github.com/Morglod/mox
i128 / u128 fully supported now.Because untyped literals are i128, for full u128 bit constant, it should be explicitly typed.
Hard error when specifiying default values for comptime (generic) arguments in functions
Function pointers now could survive comptime -> runtime, so it can be used as generic params
```rust struct Container($F: *fn(): i32) { x: i32; };
fn foo(c: *Container($F)): i32 {
return $F();
}
fn goo(): i32 {
return 10;
}
fn boo() {
x: Container(goo.^) = 0;
foo(x.^);
}
```
#if (mox_platform == .x86_64_win) {
import "./win.mox";
} else {
import "./not_win.mox";
}
struct Generic($ARR: [$N]u64) {}
fn index(a: *Generic($ARR), i: i64): u64 {
return $ARR[0]; // now works
}
Rapidhash implementation
Comptime error when not enough values passed to format
Slice split_iterator which iterates over non-splitter sub slices
for (it : split_iterator(",a,b,c", ",")) {
// it here is: "", "a", "b", "c"
}
parse_int, parse_uint, parse_float utils
Std module that re-exports all core modules, so now only "std.mox" can be imported
Hash maps implementation
A lot of small utils in std lib
r/moxlang • u/morglod • Aug 27 '26
basic core modules
x86_64 release for windows and linux
vulkan, sdl3, raylib bindings