Hacker News new | ask | show | jobs
by Zakis1 15 days ago
Agreed unfortunately, if Zigs whole selling point is meant to be a "nicer C" (and a much nicer DX than Rust because no fighting the borrow checker etc) - does that really matter in a world where an LLM is writing the code? I am not going to be fighting the borrow checker, the LLM is.

And as always, the response you'll hear is: but AI sucks/hallucinates/could never replace me etc... Just look at the progress LLM'S have made in the past few years, and extrapolate that to the next 10 or 20 years. I don't see how Zig makes sense if this is the trajectory the industry is going.

3 comments

> Just look at the progress LLM'S have made in the past few years, and extrapolate that to the next 10 or 20 years.

First of all, past trend doesn't predict the future.

And if it did, then the answer would be nothing will matter in 20 years. Not just "no programming language," but nothing.

What does nothing matter mean thou ? The extrapolation is very plausible outcome thou
https://xkcd.com/605/

No one can predict the future least of all humble extrapolation line.

Everything we do is about anticipation, from cooking to walking to driving. You maybe thinking 100% or nothing
Yeah, but those (cooking, walking) rely on prior experiences.

We don't have prior experiences that can tell us with certainty that LLMs will or will not replace humans entirely.

Projecting that LLMs will become a singularity is the same as saying processor's clock speed will double every year. They do double, they don't.

Sun will always rise in the east until it engulfs us.

Why's everybody obsessed with the popularity contest?

Rust is a great language with some great killer features.

It does not need consistent propaganda preaching how it's a better choice than "insert other language".

Every system programmer is aware of Rust and it's pros. Doesn't mean it's a language that fits the use case, project, constraints and even preferences. It's not just about generating code, it's also about reading it and maintaining it.

Thus some people just prefer alternatives, be it C, C3, Odin, Zig, Jai or whatever else there is.

You said it yourself, it's selling point is "nicer C", so it's for people that don't want to write Rust or C++ but a nicer C.

> It does not need consistent propaganda preaching how it's a better choice than "insert other language".

Indeed. There is an irrational urge in some folks to become language-missionaries. Usually such folks have gained expertise in that specific language and want to protect and expand their turf. There is a wide-range of software usecases requiring a variety of tools and no one language fits all.

Amusing side-note. xai was all-in on rust for their ai-stack back in 2023. But now, spacex controlled xai is apparently coding ai in C - perhaps with the attitude that if a language is good enough to control rockets it is good for ai.

I think it's like this. People think differently. Someone finds a language that really fits the way they think, and it feels wonderful, and they feel like they've been let out of prison into this wonderful new freedom. And they, being empathetic humans, want other people to have the same experience, and they think that others will have the same experience if they just try this wonderful language. So they become language missionaries.

But what they miss is that other people think differently than them. Other people will feel let out of prison by a different language.

Beautifully put and I agree, with one nuance:

There are multiple ways to think about how to write software, and that number really is not as high as various language proponents want us to believe. They aim at 50-100 but I'd say we got maximum 20, if not 6-7.

Point being: stuff is starting to converge IMO. It's not endless exciting diversity. "How to write software" (and adjacently: what PL to use) is just a boring multi-dimensional math problem at its root.

Why would *any* programming language matter when LLMs can just directly output binaries from a sufficiently detailed spec ;)

And specifically, why would Rust be a better choice than C or Zig when the LLMs get good enough to just write memory safe code in unsafe languages (they are already pretty good at finding memory safety bugs).

IMHO for code generation, different things start to matter (like fast build times, while 'convenient highlevel abstractions' become less important).

Writing memory safe code in unsafe languages requires global reasoning, which LLMs are terrible at. The whole point of a type system or a borrow checker like Rust's is to thread the requirements for safety throughout the program syntax in a way that makes it possible to spot problems locally. That's why LLMs tend to be rather good at writing Rust.
> Writing memory safe code in unsafe languages requires global reasoning

If you learn how to use arena allocators and in general use modern techniques, you don't need global reasoning to write correct memory management code pretty much never.

If your code is a RAII and abstraction maze, then yes, you will probably need global reasoning, but that's not the case with Zig.

Arena allocators are great for certain use cases, but they don't provide any solutions to memory unsafety; they don't do anything for use-after-free, they don't do anything for buffer overruns, they don't address any sources of undefined behavior, and they don't do anything for thread-safety, which is a requirement for memory safety.
The billion dollar “if”
Not all code can be expressed well by an arena allocator.
Writing anything safe code in any language that doesn't have that safety built in requires global reasoning. That's why LLMs aren't better at writing rm-rf/-safe code in Rust.
> when the LLMs get good enough to just write memory safe code in unsafe languages

There is, and always will be, a huge difference between "because a LLM said so" and "here is a proof this is memory safe".