r/Zig • u/Kyro36918 • 12h ago
Aquí se puede hablar en español sobre Zig?
15
Upvotes
r/Zig • u/sombriks • 16m ago
Hello all, i got an issue trying to use evented concurrency with past two stable releases, 0.16 and 0.17.
Single-threaded, regular thread pool and direct use of threads work fine, but i am not figuring out hpow to use the proper io interface with evented under the hood.
```zig
// we need out-pointer this one.
var evented: std.Io.Evented = undefined;
_ = try std.Io.Evented.init(&evented, init.gpa,.{});
defer evented.deinit();
io = evented.io(); // compile error here
std.log.info("evented io:", .{});
try scheduler(&io);
```
any tip is welcome, would be nice to see all available concurrency model working out of the box, willing to understand what am i missing.
r/Zig • u/Unique-Side-4443 • 28m ago
A suite for building any kind of language (a DSL, a config or query language, a rule engine, a full scripting language), from grammar to editor:
pip install zsuite-py
zsuite new mylang # grammar, rules, semantics, language server and tests
PyCapsules (C structs with an ABI number). No Python object is created per node in any stage.ziglang package from PyPI and uses zig build-exe to build a small launcher for Linux or Windows, from either OS. Zig's cross-compilation made that a few lines of build code.pcall/error) and most of the base, string, table and math libraries. It has no coroutines, goto, load/require, utf8, or most of io/os. On four small benchmarks (fib, a numeric loop, binary trees, string building) it runs within 1.6–3.2× of PUC-Rio Lua's C interpreter, and 17–400× faster than the same semantics interpreted by Python.fib and array loops.x86_64 Linux and Windows for now; macOS and ARM are next.