Live data from Hacker News

TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

tigerbeetle.com

131–140 of 213 posts

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#131

Earlier quoted context omitted.

Zig feels like a better C with modern tooling. It is a tool that works for me. Rust feels like a better C++ with modern tooling. I am a tool that works for it.

Most people stop feeling like they are fighting with rust a few months into using it. The borrow checker is something that becomes second nature and you still use the same techniques that would please the borrow checker outside of rust because it's generally better program structure in many cases and avoids bugs. If you want to do something that you know us correct that rust normally doesn't allow, just use unsafe. I…

>Most people stop feeling like they are fighting with rust a few months into using it. The borrow checker is something that becomes second nature

People keep saying that, but I've also seen many who've used Rust for years, in big projects, say the opposite: it gets slightly better as you learn to oblige the borrow checker instictively, but it remains always a kind of annoyance and a friction.

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#132
post #102

Earlier quoted context omitted.

Zig feels like a better C with modern tooling. It is a tool that works for me. Rust feels like a better C++ with modern tooling. I am a tool that works for it.

> It is a tool that works for me. Is it? Or is it a tool that won't bug you when you make a mistake? Programmers tend to, as Djikstra noted[1] confuse ease of programming with allowing unforced errors. [1] https://en.wikiquote.org/wiki/Edsger_W._Dijkstra#1970s

>Is it? Or is it a tool that won't bug you when you make a mistake?

I don't want tools to bug me EVER. This includes when I make a mistake.

When I want a tool's opinion, I'll ask for it - through a linter, a static analysis tool, etc.

>Programmers tend to, as Djikstra noted[1] confuse ease of programming with allowing unforced errors

And how long had Djikstra worked as a professional programmer?

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#133

Joran from TigerBeetle here! Zig has changed my life, and our team, by making TigerBeetle possible. It's been an incredible journey these past 5 years, and excited that we can now pay it back (and forward!) to the Zig Software Foundation, also matching with my friend Derek Collison and Synadia in doing so. Thanks to Andrew for creating something beautifully special for the world in Zig, and to all the Zig core team a…

I’d be really curious to know if there have ever been major snags being such an early adopter of a language (relative to comparable language options)?

Zig has been great. If anything we could merge critical features (e.g. io_uring, @prefetch builtin and others) into Zig in days or hours instead of years. In hindsight, Zig exceeded expectations, and the quality was exceptional to begin with.

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#134

> In all these things, what impressed me most was Zig’s approach to safety when working with the metal. Not in terms of an on/off decision, but as a spectrum. Not aiming for 100% guarantees across 1 or 2 categories, but 90% and then across more categories. Not eliminating classes of bugs, but downgrading their probability. All while preserving the power-to-weight ratio of the language, to keep the language beautifull…

Why is 90% enough?

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#135

Joran from TigerBeetle here! Zig has changed my life, and our team, by making TigerBeetle possible. It's been an incredible journey these past 5 years, and excited that we can now pay it back (and forward!) to the Zig Software Foundation, also matching with my friend Derek Collison and Synadia in doing so. Thanks to Andrew for creating something beautifully special for the world in Zig, and to all the Zig core team a…

How would you onboard a software engineer who doesn't know zig if you were to do so? Learning tips?

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#136
post #26

Earlier quoted context omitted.

Zig is orders of magnitude more pleasant and enjoyable to use than Rust.

I strongly disagree. I can see why you would want to use Zig, especially if you absolutely need complete low level code and only care about pretty decent memory safety (which is valid in many scenarios). But if those don't apply Rust is much nicer. Stuff like string manipulation is almost as painful as it is in C.

I strongly agree with your statement overall, but not in details.

Regarding string manipulation, Zig has slices and comptime-checked `printf`, so that makes string handling _massively_ more ergonomic than in C. But, yeah, managing the lifetime of the printf-ed is a pain in the back, and Rust is _massively_ more ergonomic there, if managing individual string allocations is what you want to do. (though one cool thing that Zig makes easy is comptime asserting that stack-allocated buffer has the right size for the given format string).

But, I do find Zig surprisingly ergonomic overall! For example, I have two Rust crate for writing glue code utilities, xflags (argument parsing) and xshell (shelling out). For TigerBeetle, I wrote equivalents:

* https://github.com/tigerbeetle/tigerbeetle/blob/main/src/std...

* https://github.com/tigerbeetle/tigerbeetle/blob/main/src/she...

What I found is that the Zig version is significantly easier to implement and to use, for me. In Rust, those domains require macros, but in Zig it's all comptime. And memory management is relatively easy --- flags live until the end of the program, shell is just using shell-scoped arena. I am contemplating rewriting my personal scripts at https://github.com/matklad/config/tree/master/tools/gg to Zig for that reason. Though, Zig not being 1.0 _is_ a problem in that context --- I touch my scripts only rarely, and I don't want to be on the hook for upgrades.

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#137
post #68
post #63

Earlier quoted context omitted.

I think most folks would agree that Rust is an "acquired" taste. You need to kneel to the borrow-checker and develop something like a Stockholm syndrome before you find the language delicious.

I'd guess that in 99% of cases, if the borrow checker is a problem for you in Rust then you are likely not ready yet for C or Zig, particularly when you need to work in a team where mainatainability by others is critical. There are some cases the borrow checker requires you to go through hoops for but I see that as a win for adding friction and raising visibility of weird patterns. And yes, there are cases that can't…

Well said! Having a mental borrow checker running in background certainly helps a lot when coding in Zig. What also helps is that Zig safety checks generally catch lifetime bugs at runtime nicely. E.g., undefined memory is set to `0xAAAA`, which, if interpreted as a pointer, is guaranteed to be invalid, and fail loudly on dereference.

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#138

Earlier quoted context omitted.

Zig feels like a better C with modern tooling. It is a tool that works for me. Rust feels like a better C++ with modern tooling. I am a tool that works for it.

This is what people don’t understand. Zig and Rust are not competitors. Rust is a better C++ but C was the good part of C++.

> C was the good part of C++

This is certainly a very controversial opinion. The two languages should not really be compared or grouped together, not for at least the last 15 years, but probably much longer. Modern C++ features have been developed specifically to address all sorts of things that most C++ developers want fixed from the "C" part of the language's history.

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#139
post #135

Joran from TigerBeetle here! Zig has changed my life, and our team, by making TigerBeetle possible. It's been an incredible journey these past 5 years, and excited that we can now pay it back (and forward!) to the Zig Software Foundation, also matching with my friend Derek Collison and Synadia in doing so. Thanks to Andrew for creating something beautifully special for the world in Zig, and to all the Zig core team a…

How would you onboard a software engineer who doesn't know zig if you were to do so? Learning tips?

Thanks! I write about this briefly in the blog post, but the more detailed answer is there's no need: Zig's grammar is simple/explicit/powerful enough that they pick it up themselves in a weekend. Learning Zig is just not something we need to talk about with new hires, and we hire systems programmers from all backgrounds.

To be clear, we do invest in months of onboarding in terms of understanding the TigerBeetle code base. For example, matklad has recorded nearly a hundred hours' worth of IronBeetle episodes [0].

But I just noticed at one point that people were joining our team and never having any trouble with Zig. The question was just never being asked. Essential simplicity is a great benefit!

[0] https://www.youtube.com/playlist?list=PL9eL-xg48OM3pnVqFSRyB...

Re: TigerBeetle and Synadia pledge $512k to the Zig Software Foundation

#140
post #135

Joran from TigerBeetle here! Zig has changed my life, and our team, by making TigerBeetle possible. It's been an incredible journey these past 5 years, and excited that we can now pay it back (and forward!) to the Zig Software Foundation, also matching with my friend Derek Collison and Synadia in doing so. Thanks to Andrew for creating something beautifully special for the world in Zig, and to all the Zig core team a…

How would you onboard a software engineer who doesn't know zig if you were to do so? Learning tips?

I personally learned Zig by reading https://ziglang.org/documentation/master/ and stdlib source code once I joined TigerBeetle. enums.zig and meta.zig are good places to learn, in addition to usual suspects like array_list.zig.

(though, to be fair, my Rust experience was a great help for learning Zig, just as my C++ knowledge was instrumental in grokking Rust)

Post reply on HN