2024-09-18 03:38:49 -05:00
|
|
|
acs := @use("acs.hb")
|
2024-11-24 10:18:09 -06:00
|
|
|
allocators := @use("alloc/lib.hb")
|
2024-11-24 14:58:14 -06:00
|
|
|
hashers := @use("hash/lib.hb")
|
2024-09-18 03:38:49 -05:00
|
|
|
string := @use("string.hb")
|
|
|
|
log := @use("log.hb")
|
|
|
|
memory := @use("memory.hb")
|
|
|
|
buffer := @use("buffer.hb")
|
|
|
|
math := @use("math.hb")
|
|
|
|
random := @use("random.hb")
|
2024-10-14 12:54:53 -05:00
|
|
|
file := @use("file_io.hb")
|
2024-11-03 16:31:53 -06:00
|
|
|
dt := @use("dt.hb")
|
2024-11-17 14:29:32 -06:00
|
|
|
process := @use("process.hb")
|
2024-11-27 06:41:51 -06:00
|
|
|
sleep := @use("sleep.hb")
|
2024-11-03 16:31:53 -06:00
|
|
|
|
2024-12-16 07:22:03 -06:00
|
|
|
// todo: replace with comptime message (for zero cost)
|
2024-11-03 16:31:53 -06:00
|
|
|
panic := fn(message: ?^u8): never {
|
|
|
|
log.error("Error: Panic Called, Message:\0")
|
|
|
|
if message == null {
|
|
|
|
log.error("None\0")
|
|
|
|
} else {
|
|
|
|
log.error(message)
|
|
|
|
}
|
|
|
|
die
|
2024-12-16 07:22:03 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
$unsigned_int := fn($T: type): bool {
|
|
|
|
return T == uint | T == u8 | T == u16 | T == u32
|
|
|
|
}
|
|
|
|
|
|
|
|
$signed_int := fn($T: type): bool {
|
|
|
|
return T == int | T == i8 | T == i16 | T == i32
|
|
|
|
}
|
|
|
|
|
|
|
|
$integer := fn($T: type): bool {
|
|
|
|
return unsigned_int(T) | signed_int(T)
|
|
|
|
}
|
|
|
|
|
|
|
|
$float := fn($T: type): bool {
|
|
|
|
return T == f32 | T == f64
|
|
|
|
}
|
|
|
|
|
|
|
|
$primitive := fn($T: type): bool {
|
|
|
|
return integer(T) | float(T) | T == bool
|
|
|
|
}
|
|
|
|
|
|
|
|
$float_bytes := fn($T: type): type {
|
|
|
|
if T == f64 return uint else if T == f32 return u32
|
2024-11-03 16:31:53 -06:00
|
|
|
}
|