Live data from Hacker News

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

tigerbeetle.com

201–210 of 213 posts

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

#201
post #119
post #109

Earlier quoted context omitted.

Put Claude code on top of it and now you have prototypes of what you have in mind written pretty much instantly and they are suitable for reshaping into production later if needs to.

I'd be curious if there is additional tooling needed for this, as Zig is a moving target in terms of language/features. I know of _ways_ to do this, but has anyone done this successfully with a RAG+version locked docs or something like that?

In my comment I meant Rust, not Zig, apologies I didn’t make it clear enough!

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

#202
post #18

Earlier quoted context omitted.

Not a recent movie, but it was mentioned in Shooter, a Mark Wahlberg film from way back when

2007 is way back when territory? :utf8_shocked_emoji:

Yes I suppose it's not! My time sense in recent decades is very fugitive :)

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

#203

Earlier quoted context omitted.

Zig makes a lot of small choices that pile up to push you towards safety/correctness in your code. No hidden allocations is a big one. If something allocates you have to explicitly give it an allocator. This makes tracking allocations much simpler. Combined with the test allocator you can also detect memory leaks. Allocators also simplify memory management patterns. For example, it's trivially ease to use an arena. T…

Thanks for the response. I look forward to seeing how the type system evolves. - No hidden allocations: Other languages already provide abstractions for this. Are hidden allocations really a significant issue in modern systems languages, even when managing memory manually? This concern is distinct from memory leaks or general memory safety problems. - Allocators: It's easy to use an arena in C++ or C. - defer keyword…

To be fair we are pushing up against the limits of my experience here. I'll do the best I can to address your points, but someone more experienced could probably do a better job.

I don't think explicit use of allocators is distinct from memory leaks/safety. In Zig you will always know with 100% certainty that something is allocating memory. Making it easier to track what needs to be freed. This isn't always the case with C/C++. Also, as I said before, thanks to the way allocators work, Zig can provide a testing allocator which actively helps detect memory leaks. Their may be tools to help with this in languages like C/C++, but in Zigs case it's build right into the testing framework (which is also provided by the language).

To your point about arenas, or other memory management techniques, it's not that they aren't possible in other languages. Obviously they are. But I think it's safe to say that the default memory management mechanism in C/C++ is malloc/free. This leads a lot of people down the path of lots of little allocs that all have to be tracked and paired with a call to free. In Zig, by design, any method that can allocate should take an allocator as an argument (or you pass one when the struct is created and it uses it, but this style is falling out of favor with the community). This pushes developers towards alternative methods of memory management, encouraging them to not just fall back on mallow/free. Arenas, fixed buffers, and other mechanism aren't just possible in Zig, they are first class citizens.

I think there is a huge different between "defer" being part of the core language and being part of an extension. By being relegated to an extension it's usage is naturally going to be greatly reduced. The only two other languages I can think of that have this feature are Odin and Go, and Go is garbage collected.

Yeah, in Zig you're directly manipulating pointers. That's just how the language is designed. It tries to make it safer, but it doesn't eliminate it, because it's not trying to. If you think this is a bad thing, that's fine. I'm not going to try to change your mind on that point.

For nullability, everything you describe is opt in, and tool specific. It is baked into the type system in Zig the same way it is in Rust. It's just handle in (imo) a simpler and more straightforward way.

Zig's errors as value approach isn't that much different from Rust's in spirit, and I think both Zig and Rust outclass anything in C++ in this regard. It's an option in C++, but mandatory in Rust and Zig, which I think is where the real power comes from.

Ultimately, if you prefer Rust I'm not trying to change your mind. I was just trying to address your question. I don't think any of Zig's individual choices haven't been made in other languages, but I think the way Zig composes them all produces something novel and intriguing. All these little choices push developers in the right direction at every turn. Zig is still young, and it has plenty of rough edges to sand down, but I'm interested to see where it goes.

Like I said previously, I think in the long run will see the average safety/correctness of Zig programs be on par with Rust's. I think the two will just fill different niches.

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

#204

Earlier quoted context omitted.

I left the "mostly" in my comment because custom allocators is one area where Rust as an ecosystem is still in need of some work, and I'm aware of that - hell, in part because of TigerBeetle's blog posts on the subject. Everything you're describing is a stylistic preference, though - and doesn't contribute to bloat , which is what the parent comment was implying. If your program is bloated, that's on you to clean up…

Look, I'm working on an async I/O engine, not unsimilar to Tokio. I started running benchmarks only to realize that I'm significantly faster than Tokio. Go, which is a garbage collected language with preemptive scheduling, is also faster than Tokio on these benchmarks. And Tokio is fast, I'm not claiming it's not. Rust developers program in terms of traits, and borrow checker behaviours. That's fine if you want enter…

> I started running benchmarks only to realize that I'm significantly faster than Tokio.

In single threaded, sure. To my knowledge you're not faster in multi-threaded contexts.

> Rust developers program in terms of traits, and borrow checker behaviours.

You don't have to do that, though. People have experimented with other approaches besides what you see in e.g tokio.

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

#205

Earlier quoted context omitted.

Thanks for the response. I look forward to seeing how the type system evolves. - No hidden allocations: Other languages already provide abstractions for this. Are hidden allocations really a significant issue in modern systems languages, even when managing memory manually? This concern is distinct from memory leaks or general memory safety problems. - Allocators: It's easy to use an arena in C++ or C. - defer keyword…

To be fair we are pushing up against the limits of my experience here. I'll do the best I can to address your points, but someone more experienced could probably do a better job. I don't think explicit use of allocators is distinct from memory leaks/safety. In Zig you will always know with 100% certainty that something is allocating memory. Making it easier to track what needs to be freed. This isn't always the case…

[deleted]

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

#206

Earlier quoted context omitted.

Thanks for the response. I look forward to seeing how the type system evolves. - No hidden allocations: Other languages already provide abstractions for this. Are hidden allocations really a significant issue in modern systems languages, even when managing memory manually? This concern is distinct from memory leaks or general memory safety problems. - Allocators: It's easy to use an arena in C++ or C. - defer keyword…

To be fair we are pushing up against the limits of my experience here. I'll do the best I can to address your points, but someone more experienced could probably do a better job. I don't think explicit use of allocators is distinct from memory leaks/safety. In Zig you will always know with 100% certainty that something is allocating memory. Making it easier to track what needs to be freed. This isn't always the case…

I'm curious to see how Zig approaches the hard problems and hopeful it produces something remarkable enough to make me jump ship (like Rust has for some of my projects).

I'm not trying to change your mind either; I'm just trying to understand the enthusiasm around Zig. There's a lot of it! To this day, I still don’t see what hard problems it would help me solve (that other languages make solving easier). At least for me, there’s little novelty or technical intrigue in that sense for any "systems" problem I've worked on.

- Explicit use of allocators: In my experience, hidden allocations rarely cause memory leaks. The real issues are forgetting to free memory, freeing the wrong pointer or managing overlapping objects. Some systems I’ve worked on also use different allocators or representations for the same types (e.g., for succinct encoding). Stronger type systems and optional automatic memory management make life easier when available.

- Arenas: malloc and free are as first-class as any other allocation mechanism in C. In C++, using alternative allocator types takes a bit more finesse. It’s an opt-in model rather than the default but still a relatively light lift.

- defer: I agree that its use would be significantly reduced but it’s easy to opt into. Many languages provide similar functionality either natively or through libraries, including Rust, C++, Python, C#, Java, D and Swift. Even C has this through GNU extensions (for fun, check out how far the Linux kernel takes this concept).

- Pointers: I love pointers but what helps performance more is explicit typing, stronger provenance and alias analysis.

While I'm not specifically advocating for Rust here, I don’t believe the average safety or correctness of a Zig program will match that of Rust. Rust is memory-safe by design, whereas Zig is not, and Rust also provides elegant solutions to several genuinely hard problems from memory management to events to scalable concurrency and an expressive type system.

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

#207

Earlier quoted context omitted.

To be fair we are pushing up against the limits of my experience here. I'll do the best I can to address your points, but someone more experienced could probably do a better job. I don't think explicit use of allocators is distinct from memory leaks/safety. In Zig you will always know with 100% certainty that something is allocating memory. Making it easier to track what needs to be freed. This isn't always the case…

I'm curious to see how Zig approaches the hard problems and hopeful it produces something remarkable enough to make me jump ship (like Rust has for some of my projects). I'm not trying to change your mind either; I'm just trying to understand the enthusiasm around Zig. There's a lot of it! To this day, I still don’t see what hard problems it would help me solve (that other languages make solving easier). At least for…

Oh shit, I totally forgot about comptime lol. To be fair it doesn't really have anything to do with memory safety, but I think it's part of what contributes to the excitement. Instead of a macro system you can just write Zig that executes at compile time. Cool idea. I think Johnathan Blow is doing something similar in Jai, it actually may have been the inspiration for Zig's comptime.

I honestly don't think Zig is doing anything big and flashy, or highly revolutionary, the same way Rust (or even a project like Mojo) is. The stated goal was essentially to produce a modern C that pushed developers towards writing reliable software. I think it's hard to explain the enthusiasm because it's kind of greater then the sum of it's parts in some ways.

There's other stuff we haven't talked about here too, outside memory safety. It has incredible interopt with C, and the Zig build system is ridiculous. I don't know any other build tool that has the ability to handle cross platform builds for not only itself, but also C, in the way Zig does.

To be honest, I think a little of it might be the backlash to Rust as well. Portions of the Rust community (not all of it of course) are down right exhausting. And treat memory safety like it's some kind of moral imperative. I think there is a group of people who aren't enthused by Rust, and annoyed by the vocal minority of the community, that are glad to have something that is more suited to their sensibilities.

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

#208
post #191

Earlier quoted context omitted.

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++.

Nah, C should be nuked, C++ is TypeScript for C, Microsoft was right that C was done on Windows, unfortunely they had a change of heart and eventually decided to support up to C17.

> C++ is TypeScript for C

In what way?

Typescript is really just an optional type system for javascript. I don't see the analogy with C/C++.

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

#209
post #75
post #11

In performing an assessment of which ecosystem and PL to use to develop our high-integrity automation software for mission-critical applications, we assessed Rust, Zig, and Ada/SPARK. Rust had the support behind it from a big corp., a passionate developer community, and some adoption by significant entities, but none with cyber-physical systems. And it has been interesting to see some developers leaving Rust for Zig…

https://ferrocene.dev/en/ is a Rust toolchain which has achieved some certifications for mission critical applications similar to Ada/SPARK.

Adacore is doing great work. They have a Rust compiler, but the static analysis and formal verification is not quite there for the Rust toolchain and it does not have any where near the legacy for high-integrity, mission-critical apps. Not that it is not heading that way, but for us it is not there by a longshot to select it for our product.

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

#210
post #20
post #11

In performing an assessment of which ecosystem and PL to use to develop our high-integrity automation software for mission-critical applications, we assessed Rust, Zig, and Ada/SPARK. Rust had the support behind it from a big corp., a passionate developer community, and some adoption by significant entities, but none with cyber-physical systems. And it has been interesting to see some developers leaving Rust for Zig…

>leaving Rust for Zig for the sheer enjoyment of using it instead. What do people find more enjoyable?

Enjoyment is part objective and a lot subjective. Mitchell Hashimoto who wrote Ghostty in Zig speaks about it here: https://youtu.be/YQnz7L6x068?si=VtH2FEAuW-SiFPHr&t=1415

I started with 6502 assembly and PET Basic in 1977, so for me, Zig is simpler, and jives more with me than Rust. OTOH, I chose Ada/SPARK for our product for the high-integrity, mission-critical aspect of our automation software. I programmed in Pascal back in 1988, and it has the same syntax, which I always found verbose and boring, but it is clear and structured and the concepts to achieve this level of high assurance are not too difficult. For ultiimate fun, I program in J/APL and now mainly BQN, so I am not a fan of verbosity!

I would have been more attracted to Rust if it had kept ML-like syntax from OCaml and not the Algol-like curly braces of C/C++.

Post reply on HN