Raylib 6.2 ported to Zig, with every example checked against C (now running in the browser too) A developer has ported raylib 6.2 to Zig, checking every example against the original C version and running the library in the browser via WebAssembly. The port is a direct C-to-Zig translation that calls libc functions such as fopen, fread and memcpy through extern declarations rather than using Zig's optionals, error unions and allocators, and commenters criticized it as "C code written with Zig keywords" that could teach bad habits. js // stdio FILE handling via opaque pointer const FILE = anyopaque; extern fn fopen c const u8, c const u8 ? FILE; extern fn fclose ? FILE c int; extern fn fseek ? FILE, c long, c int c int; extern fn ftell ? FILE c long; extern fn fread ? anyopaque, usize, usize, ? FILE usize; extern fn fwrite ? const anyopaque, usize, usize, ? FILE usize; extern fn fprintf ? FILE, c const u8, ... c int; extern fn fgets c u8, c int, ? FILE c u8; extern fn feof ? FILE c int; extern fn sscanf c const u8, c const u8, ... c int; const SEEK SET: c int = 0; const SEEK END: c int = 2; …directly calling into clib doesn’t look very Ziggy to me Also tbh, what’s the point. The code is pretty much a straight translation from C to Zig without taking any advantage of Zig’s language features optionals, error results, allocators, etc etc… , I’m sure Claude could do better… Also… hrmpf look at all those C string.h and memory.h functions… if strcmp &dp.name, "." = 0 and strcmp &dp.name, ".." = 0 { const pathLength = snprintf &path, MAX FILEPATH LENGTH, "%s/%s", basePath, &dp.name ; if pathLength < 0 or pathLength = MAX FILEPATH LENGTH { TraceLog LOG WARNING, "FILEIO: Path longer than %d characters %s... ", @as c int, MAX FILEPATH LENGTH , basePath ; } else if IsPathFile &path { if filter == null or strstr filter, FILE FILTER TAG ALL = null or strstr filter, FILE FILTER TAG FILE ONLY = null or IsFileExtension &path, filter { = memcpy @ptrCast files.paths files.count , @ptrCast &path , @intCast pathLength ; files.count += 1; } } else { if filter = null and strstr filter, FILE FILTER TAG DIR ONLY = null or strstr filter, FILE FILTER TAG ALL = null { = memcpy @ptrCast files.paths files.count , @ptrCast &path , @intCast pathLength ; files.count += 1; } if scanSubdirs ScanDirectoryFiles &path, files, filter, expectedFileCount, scanSubdirs ; } This is built for me and my team as a learning exercise for zig I don’t think you’re doing yourself a favour with this approach. This is C code written with Zig keywords, not Zig code. E.g. you’re kinda missing the forest for the trees and you might just learn bad habits from this codebase.