logoalt Hacker News

prontoday at 10:11 AM1 replyview on HN

> Without ever increasing memory/CPU, you're going to have to squeeze more performance out of the stone (more or less unchanging memory/CPUs).

The memory overhead of a moving collector is related only to the allocation rate. If the memory/CPU is sufficient to cover that overhead, which, in turn help save more costly CPU, it doesn't matter if the relative cost reduced (also, it's not even reduced; you're simply speculating that one day it could be).

> I'm not saying it will be fully gone

That's a strange expression given that the percentage of programs written in languages that rely primarily on a GC for memory management has been rising steadily for about 30 years with no reversal in trend. This is like saying that more people will find the cost of typing a text message unacceptable so we'll see a rise in voicemail messages, but of course text messaging will not be fully gone.

Even embedded software is increasingly written in languages that rely heavily on GC. Now, I don't know the future market forces, and maybe we won't be using any programming languages at all but LLMs will be outputting machine code directly, but I find it strange to predict with such certainty that the trend we've been seeing for so long will reverse in such full force. But ok, who knows. I can't prove that the future you're predicting is not possible.

> It's supported by Google's usage of Rust.

There's nothing related here. We were talking about how Zig's design could assist in code reviews and testing, and therefore in the total reduction of bugs, and you said that maybe a complex language like Rust, with lots of implicitness but also temporal memory safety could perhaps have a positive effect on other bugs, too, in comparison. What you linked to is something about Rust vs C and C++. Zig is at least as different from either one as it is from Rust.

> And the overall error rate still favors Rust.

Compared to C++. What does it have to do with anything we were talking about?


Replies

Ygg2today at 3:56 PM

> That's a strange expression given that the percentage of programs written in languages that rely primarily on a GC for memory management has been rising steadily for about 30 years

I wish I knew what you mean by programs relying primarily on GC. Does that include Rust?

Regardless, but extrapolating current PL trends so far is a fools errand. I'm not looking at current social/market trends but limits of physics and hardware.

> There's nothing related here. We were talking about how Zig's design could assist in code reviews and testing

No, let me remind you:

> > [snip] Rust defends you from common mistakes, but overall for similar codebases you see fewer bugs.

> I understand that's something you believe, but it's not supported empirically we were talking how not having to worry about UB allows for easier defect catching.

> Compared to C++.

Overall, I think using C++ with all of its modern features should be in the ballpark of safe/fast as Zig, with Zig having a better compile time. Even if it isn't a 1-to-1 comparison with Zig, we have other examples like Bun vs Deno, where Bun incurs more segfaults (per issue).

Also don't see how much of Zig design could really assist code reviews and testing.

show 1 reply