Castyo
Just zig casting library
Install / Use
/learn @RaulVictor-m/CastyoREADME
Castyo
Castyo is a library that is supposed to help with zig casting situation by providing easier functions for casting in between numeric types, while its going to make a lot of decisions for you and the casting is not going to be as explicit as zig intended it to be, it will definetely make casting less verbose and more user friendly, which is going to help alot for prototyping.
Situation
Well the library is not ready just yet, but you are already able to do any numeric conversion with only one single function like "U64(n)/I32(n)" or "F32(n)", and as a bonus everything that works for integers also works for Vector(x, numeric).
How to
The best way to understand and use this library is to just go to the code and look at the tests there you will find a few examples on how the library should work but for gist of it you can rely on these example:
var result: i64 = 10;
const TestEnum = enum(i8) {
test1 = 10,
test2 = -10,
};
const n1: u64 = 10;
const n2: i128 = -20;
const n3: f64 = 10.306;
const n4: f64 = -10.306;
const n6: i8 = -1;
const n7: f64 = 2.5;
const n8: f64 = 2.5 * F64(n6);
result += I64(n1) + I64(n2);
result += I64(n3) + I64(n4);
result += I64(n7) + I64(n8);
try std.testing.expect(result == 0);
try std.testing.expect(U32(TestEnum.test1) +% U32(TestEnum.test2) == 0);
Installation
As far as installation is concerned there is no secret to it, just download src/castyo.zig and use it in you project as you please.
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
