stratts | 3 months ago | on: Migrating the main Zig repository from GitHub to Codeberg
stratts's comments
stratts | 4 months ago | on: Keep Android Open
Personally I feel much more safe and secure downloading a random app from F-Droid, than I do from Google, whose supposed watchful eyes have allowed genuine malware to be distributed unimpeded.
stratts | 8 months ago | on: Zig breaking change – Initial Writergate
This would involve removing async/await as keywords from the language.
stratts | 9 months ago | on: Self-hosted x86 back end is now default in debug mode
Most of Zig's safety, or lack thereof, seems inherent to allowing manual memory management, and at least comparable to its "C replacement" peers (Odin, C3, etc).
stratts | 9 months ago | on: Self-hosted x86 back end is now default in debug mode
SDL3 has both a native Zig wrapper: https://github.com/Gota7/zig-sdl3
And a more basic repackaging on the C library/API: https://github.com/castholm/SDL
For QuickJS, the only option is the C API: https://github.com/allyourcodebase/quickjs-ng
Zig makes it really easy to use C packages directly like this, though Zig's types are much more strict so you'll inevitably be doing a lot of casting when interacting with the API
stratts | 9 months ago | on: Show HN: Zli – A Batteries-Included CLI Framework for Zig
const now = ctx.flag("now", bool); // type-safe flag access
This is type-safe, but only at run time. Since your flags are (or could be) known at compile time, it would be nice to have this throw a compile error if the type is invalid.Or even better - fully lean into comptime and generate a struct so you can use field access without specifying a type:
const now = ctx.flag.now;stratts | 2 years ago | on: LÖVE: a framework to make 2D games in Lua
At the top of your build.zig, import the raylib build.zig inside raylib's /src folder (exact path will depend where you've cloned raylib)
const raySdk = @import("raylib/src/build.zig");
Use the imported addRaylib() function to build raylib, then link to the exe and add include path var raylib = raySdk.addRaylib(b, target, optimize, .{});
exe.addIncludePath(.{ .path = "raylib/src" });
exe.linkLibrary(raylib);
After that, you should be fine to just use @cImport to use raylib within your project const ray = @cImport({
@cInclude("raylib.h");
});
pub fn main() void {
ray.InitWindow(800, 450, "raylib [core] example - basic window");
...stratts | 2 years ago | on: LÖVE: a framework to make 2D games in Lua
Both Raylib and Zig include all dependencies too, so I was able to build a single 700kb .exe from Linux, copy that to my Windows machine, and it just worked immediately without any issues. Pretty amazing.
It's a double hit of latency, and for bonus points, the commit messages won't load at all if your browser is slightly out of date