News for hackers. Stuff that matters.
Re:Systems Programming with Zig (Book) by gabrielgio on Wednesday October 01, 2025 @09:00AM (#45437183)
As a developer interested in zig it is nice to see books being release, but I'd be a bit resitant to buy anything before zig reaches 1.0 or at least when they settle on a stable api. Both the builder and the std keep changing. Just 0.15 is a huge breakage. Does anyone knows how those changes would affect this book?
Re:Systems Programming with Zig (Book) by turtleyacht on Wednesday October 01, 2025 @01:05PM (#45440171)
Author links to 0.15.1 Zig docs in several places, at least for now.

Outstanding issue on Zig side for 1.0 release: https://github.com/ziglang/zig/issues/16270

Re:Systems Programming with Zig (Book) by zwnow on Saturday October 04, 2025 @04:31AM (#45471706)
With how its going I feel Zig 1.0 wont be a thing until my retirement in 37 years
Re:Systems Programming with Zig (Book) by testdelacc1 on Saturday October 04, 2025 @05:55AM (#45472125)
I’m willing to bet $5 it happens in 4 years or fewer.
Re:Systems Programming with Zig (Book) by ebri on Saturday October 04, 2025 @06:11AM (#45472217)
That’s a pretty low confidence if we measure confidence in dollars willing to risk
Re:Systems Programming with Zig (Book) by testdelacc1 on Saturday October 04, 2025 @06:28AM (#45472292)
It’s 100% of my annual betting budget though!
Re:Systems Programming with Zig (Book) by tialaramex on Saturday October 04, 2025 @09:44AM (#45473275)
Do you have a history we can look at to see how good you are at predicting this for programming languages? Like say, some 2020 predictions you had for languages which would or would not ship 1.0 by 2025 ?
Re:Systems Programming with Zig (Book) by testdelacc1 on Saturday October 04, 2025 @01:38PM (#45475097)
I made a set of predictions for Rust in 2022, nearly all of which turned out to be correct. And I was publicly confident Go and Rust would be massive when they reached 1.0. I was right on both counts.

But I will also admit I don’t follow developments in zig as closely as Rust. I’ve never written any Zig. And in any case, past performance isn’t indicative of future performance.

I could be wrong about this prediction, but I don’t think I will be. From what I’ve seen Andy Kelley is a perfectionist who could work on point releases forever. But his biggest users (tigerbeetle and bun especially) will only be taken seriously once Zig is 1.0. They’ll nudge him towards 1.0. They can wait a few years, but not forever. That’s why I guessed 4 years.

Re:Systems Programming with Zig (Book) by jorangreef on Saturday October 04, 2025 @01:54PM (#45475208)
> But his biggest users (tigerbeetle and bun especially) will only be taken seriously once Zig is 1.0.

TB is only 5 years old but already migrating some of the largest brokerages, exchanges and wealth managements in their respective jurisdictions.

Zig’s quality for us here holds up under some pretty extreme fuzzing (a fleet of 1000 dedicated CPU cores), Deterministic Simulation Testing and Jepsen auditing (TB did 4x the typical audit engagement duration), and is orthogonal to 1.0 backwards compatibility.

Zig version upgrades for our team are no big deal, compared to the difficulty of the consensus and local storage engine challenges we work on, and we vendor most of our std lib usage in stdx.

> They’ll nudge him towards 1.0.

On the contrary, we want Andrew to take his time and get it right on the big decisions, because the half life of these projects can be decades.

We’re in no rush. For example, TigerBeetle is designed to power the next 30 years of transaction processing and Zig’s trajectory here is what’s important.

That said, Zig and Zig’s toolchain today, is already better, at least for our purposes, than anything else we considered using.

Re:Systems Programming with Zig (Book) by testdelacc1 on Sunday October 05, 2025 @12:43AM (#45478901)
I stand corrected. I fear I may lose my $5 now.

If you don’t mind my asking, did TB add support for transaction metadata? I’ve seen this anti-pattern of map<string, string> associated with each transaction. Far from ideal, but useful. Last I checked TB didn’t support that because it would need dynamic memory allocation. Does it support it now or will it in future?

Re:Systems Programming with Zig (Book) by jorangreef on Sunday October 05, 2025 @03:48AM (#45479688)
Haha! You could double down and up the stakes.

It’s not that it would need dynamic memory allocation (it could be done with static), but rather it’s not essential to performance—you could use any KV or OLGP for additional “user data”, it’s not the hard contended part.

To keep consistency, the principle is:

- write your data dependencies if any, then “write to TB last as your system of record”,

- “read from TB first”, and if it’s there your data dependencies will be too.

Re:Systems Programming with Zig (Book) by testdelacc1 on Sunday October 05, 2025 @08:03AM (#45480898)
That makes sense, but it seems to add latency? Let’s say we’re currently reading the transactions from Cassandra with latency t. If TB is the source of truth, but we need an additional read from Cassandra for every transaction, the read latency is strictly worse now. Similarly with writes, especially since you recommend writing to TB last.

If what I’m saying is correct, we won’t actually see any performance benefits, only possible regressions. And if we’re already happy with Cassandra’s record keeping, what does TB add here?

Correct me if I’m missing something though! Like maybe we could rework how we write to Cassandra.

Re:Systems Programming with Zig (Book) by jorangreef on Sunday October 05, 2025 @09:27AM (#45481326)
Fair question!

If you have any contention in your workload, which is typical for OLTP workloads [1], then, per Amdahl’s Law, that portion of the work will dominate, and TB will be orders faster.

For example, if your KV can do high throughput writes (and most can) at low latency then you should be looking at 20-50ms P100s all combined, per 8K transactions, when you’re running at 500K TPS, even with extreme contention up to 90%. Very hard if not impossible to do that if you don’t have TB as part of your stack. At least not with the durability and strict serializability guarantees that TB gives.

[1] Worth watching! https://youtu.be/yKgfk8lTQuE

Re:Systems Programming with Zig (Book) by bnolsen on Sunday October 05, 2025 @11:05AM (#45482035)
Both go and rust had substantial dedicated corp support and dollars behind them. Zig not so much. With that in view its advancement is pretty remarkable.
Re:Systems Programming with Zig (Book) by noshitsherlock on Saturday October 04, 2025 @02:46PM (#45475633)
Wouldn’t you think AI advances in 4 years would make this a safe bet?
Re:Systems Programming with Zig (Book) by therein on Saturday October 04, 2025 @04:04PM (#45476260)
No, unless you're riding the hype train so hard that you are excited to go to colonize Mars thanks to AI advances.
Re:Systems Programming with Zig (Book) by bnolsen on Sunday October 05, 2025 @11:02AM (#45482020)
The language itself won't change much. The standard library is what is still in flux.
Re:Systems Programming with Zig (Book) by Rochus on Saturday October 04, 2025 @04:49AM (#45471802)
Is this really the first Zig book since the development startet in 2016? Maybe the language and library is just too volatile for a book.
Re:Systems Programming with Zig (Book) by wslh on Saturday October 04, 2025 @12:28PM (#45474518)
Or it evolves smoothly at another pace.
Re:Systems Programming with Zig (Book) by osigurdson on Saturday October 04, 2025 @10:12AM (#45473451)
People are doing real companies with Zig (e.g. Tiger Beetle) and important projects (e.g. Ghostty) without the 1.0 backward compatibility guarantee. Zig must be doing something right. Maybe this also keeps opinionated 9-5er, enterprise type devs out of it as well which might be a good thing :).
Re:Systems Programming with Zig (Book) by Rochus on Saturday October 04, 2025 @10:31AM (#45473578)
Are there other notable commercial companies/projects than Tiger Beetle relying on Zig? According to public information, Tiger Beetle are about eight employees with a single customer, isn't it?
Re:Systems Programming with Zig (Book) by jakogut on Saturday October 04, 2025 @10:43AM (#45473664)
Bun.sh uses zig for large portions of native code.
Re:Systems Programming with Zig (Book) by Rochus on Saturday October 04, 2025 @10:58AM (#45473771)
Thanks for the hint. According to public sources, Bun's runtime infrastructure and bindings are written in Zig, but it uses Apple's JavaScriptCore engine written in C++ (i.e. Zig is essentially used in a thin wrapper layer around a large C++ engine). Bun itself apparently struggles with stability and production readiness. Oven (Bun's company) has around 2-10 employees according to LinkedIn.
Re:Systems Programming with Zig (Book) by epolanski on Saturday October 04, 2025 @06:23PM (#45477258)
Been using bun from years, it's as stable as alternatives from a long time.
Re:Systems Programming with Zig (Book) by throwawaymaths on Saturday October 04, 2025 @11:25AM (#45473983)
lightpanda and bun
Re:Systems Programming with Zig (Book) by Rochus on Saturday October 04, 2025 @11:44AM (#45474138)
Lightpanda looks interesting, thanks for the hint. According to public sources, behind the development is a company of 2-10 employees (like Bun). The engine uses parts of the Netsurf browser (written in C) and the V8 engine (written in C++), and - as far a I can tell - is in an early development stage.
Re:Systems Programming with Zig (Book) by katiehallett on Saturday October 04, 2025 @12:25PM (#45474493)
Re:Systems Programming with Zig (Book) by Rochus on Saturday October 04, 2025 @12:57PM (#45474725)
> The main idea is to avoid any graphical rendering and just work with data manipulation

Which makes the engine much smaller and less complex than a "normal" browser.

Re:Systems Programming with Zig (Book) by hawk_ on Saturday October 04, 2025 @05:41PM (#45476964)
Who is that single customer? I'd have thought by now there would be more.
Re:Systems Programming with Zig (Book) by jorangreef on Sunday October 05, 2025 @12:02AM (#45478751)
And there are.

The parent was spreading FUD.

cf. https://news.ycombinator.com/item?id=45475208

Re:Systems Programming with Zig (Book) by osigurdson on Saturday October 04, 2025 @09:44PM (#45478230)
I'm not sure how many customers that Tiger Beetle have but I really hope they are successful. It would be great to see such a quality focused engineering org make it. They are basically doing what many devs really want to do - make the highest quality and fastest stuff possible - instead of banging out random features that usually no one actually cares about. I don't have a use case for their tech right now, but the moment I have a need for anything in the vicinity I'll be checking it out..
Re:Systems Programming with Zig (Book) by jorangreef on Sunday October 05, 2025 @12:18AM (#45478804)
Thanks! Joran, CEO from TigerBeetle here!

We’re doing pretty well as a business already, contrary to Rochus’ comment, which is not accurate.

Our team is 16, we have $30M in investment, and already some of the largest brokerages, exchanges, and wealth managements, in their respective jurisdictions are customers of TigerBeetle.

We have a saying:

“Good engineering is good business, and good business is good engineering.”

At least in TigerBeetle’s experience, the saying is proving true. We really appreciate your support and kind words!

Re:Systems Programming with Zig (Book) by Rochus on Sunday October 05, 2025 @04:58AM (#45480061)
Thanks for the clarifications.

May I ask what made you use Zig instead of e.g. Rust or C++ (or even Ada/SPARK)? I assume Go would be too undeterministic for real-time applications?

Re:Systems Programming with Zig (Book) by bnolsen on Sunday October 05, 2025 @10:55AM (#45481966)
Go doesn't belong in this discussion.its a better java, c#, python and not much more. It doesn't work for 24/7 or for performance sensitive applications.
Re:Systems Programming with Zig (Book) by Rochus on Sunday October 05, 2025 @11:53AM (#45482513)
> Go doesn't belong in this discussion.its a better java, c#, python and not much more. It doesn't work for 24/7 or for performance sensitive applications.

The claim is factually backwards. Go significantly outperforms Java, C#, and Python (~10x faster than Python, lower memory usage than C#), and runs successfully in countless 24/7 production systems including high-throughput APIs and distributed services.

The actual valid concern, which made me question its suitability, is that Go wouldn't be appropriate for TigerBeetle's specific real-time requirements. TigerBeetle is a financial transaction database requiring deterministic, predictable microsecond-level latencies with strict timestamp ordering across a distributed consensus protocol. Go's garbage collector introduces unpredictable pauses that would likely violate these hard real-time guarantees.

Re:Systems Programming with Zig (Book) by wolvesechoes on Saturday October 04, 2025 @03:12PM (#45475839)
I guess almost every single language out there have at least one "real" company using it, so yeah, Zig is still mostly hype and blog post praising its awesomeness.
Re:Systems Programming with Zig (Book) by hu3 on Saturday October 04, 2025 @03:25PM (#45475943)
I disagree, since there's Bun also to exemplify real, popular, tools are being created.

https://bun.com

Re:Systems Programming with Zig (Book) by justinhj on Saturday October 04, 2025 @01:20PM (#45474930)
As a Zig adopter I was rooting for this because even though there is the official documentation and some great community content, it's nice to just kick back and read a well written book. I'm also very happy with other Manning titles; they have built a high level of trust with me.

To answer your question is it too early. My expectation is that the core language, being quite small by design, will not change that much before 1.0. Some things will, especially async support.

What I think we will see is something like a comprehensive book on C++14 . The language is not much changed between now and then, but there will be new sections to add and some sections to rework with changes to the interface. The book would still be useful today.

Not a perfect analogy because C++ maintains backwards compatibility but I think it is close.