Remix.run Logo
▲ qweqwe14 2 days ago

Rust will take over all these niche languages anyway. Yes, Rust is a viable replacement for C and C++ in the long term. Zig is just trying to be a middle ground, which we've established doesn't work. Zig is particularly irrelevant compared to Rust in the LLM era.

▲lukaslalinsky 2 days ago | parent | next [-]

That's overly confident. When I see Rust code, I'm immediately reminded of Scala and how it was supposed to take over the JVM world, but did not, and Kotlin, a much simpler language, is getting more and more popular. You might claim that LLMs have no problem with that kind of language complexity, but people still need to review stuff. I have no doubt that Rust will reach C++ level of popularity, but that still leaves a lot of space for other low-level languages.

▲14113 2 days ago | parent | next [-]

Scala "failed" for two reasons: Firstly, (like Haskell) it quickly exceeded its weirdness budget, and cultivated a community that embraced and sustained that weirdness. Secondly, a number of prominent individuals publicly expressed political views that made it hard for engineers in "mainstream" organisations to loudly promote Scala.

I think Rust is doing much better on both fronts. It has always been a more pragmatic language than Scala, and the way it is developed supports that, rather than pushing the weirdness budget higher. The overall political lean of the Rust community is also more amenable to support in mainstream institutions + companies.

▲pjmlp 2 days ago | parent | prev [-]

Those advocating for the take over always forget, every single time, that they are a guest language, those developing the underlying platform have zero interest into taking their desires into account.

These even applies to C++, born on UNIX out of C, and regardless of rants, it is 100% obvious to me that there wasn't a single UNIX platform that would care to use C++ instead of C on its core implementation.

▲chicagobuss 2 days ago | parent | prev | next [-]

Middle ground? How do you figure??

Zig is so clearly not trying to do anything rust is doing, I don't really understand how you could come to this conclusion.

Zig is "I want to tell the computer exactly what to do."

Rust is "I want to write code that protects me from myself"

▲anttiharju 2 days ago | parent | prev | next [-]

Zig's C compiler is super handy for cross-compiling Rust

▲lossolo 2 days ago | parent | prev | next [-]

> Zig is particularly irrelevant compared to Rust in the LLM era.

This. If we continue on this LLM/AI trajectory, and you're not constrained by your platform to use a specific language, why would you choose C or Zig or C++ over Rust? You won't be reading or writing the code yourself, LLMs will, and they benefit from a strong type system that catches a lot of issues, meaning fewer tests are needed.

▲nickmonad 2 days ago | parent [-]

Why can’t the LLMs avoid the memory issues entirely?

▲hansvm 2 days ago | parent | next [-]

"why?" is an interesting question. My best attempt at an explanation is that they have a poor sense of layout, especially in more than one dimension. That hidden time axis makes 1D problems like concurrency or memory fundamentally 2D+, and the results are then piss-poor unless I do a lot of the heavy lifting in the design. For that matter, they still frequently F it up and tell me it's perfect even with otherwise solid agentic patterns which can one-shot all kinds of other tasks, violating the spec I wrote to protect the agent from itself.

I don't have any justification for that explanation other than anecdotes. I will say that LLMs are typically quite bad at avoiding those memory issues, whatever the reason might wind up being.

▲dnautics 2 days ago | parent [-]

I had the llms write an incredibly complex CV pipeline in zig through several iterations a and failed ideas and the only time it segfaulted was when I accidentally compiled it with avx intructions and deployed on a non-AVX machine

▲hansvm 2 days ago | parent [-]

What made memory management challenging in that application?

▲dnautics a day ago | parent [-]

It's running as a shared library under the BEAM so it better not leak or the OOM killer will come after me.

▲hansvm a day ago | parent [-]

But what made "better not leak" challenging? I ask because it looked like you were positioning "incredibly complex CV pipeline in Zig" as a counterpoint to my claim that LLMs are bad at memory management. I still think they're bad at it, but I'm interested in evidence to the contrary, so I'd love to know why your application rises to the level of something I should expect an LLM to struggle with. I've seen (have in prod right now actually) relatively simple ideas not much more complicated than resetting an arena each request, which would paper over a lot of memory-management sins even with quite bad models. I'm curious if that's why the LLM did well or if there's something else going on.

▲gf000 2 days ago | parent | prev | next [-]

In the general case, there can be cases where it's simply straight up undecidable. (Think of a while loop going for as long as it finds a counterexample to insert your unsolved math problem of your choice) and call a free after. Sure, it's a very contrived example but similar "basically impenetrable barriers" do happen.

But the more common case is simply that each line of code gets some limited "thinking", whether it's inside the model's weights, a thinking block, or a whole turn. Only repeated turns can reason for arbitrary depths, so it's just not necessarily a good use of any of these buckets to spend on something we have a good and efficient algorithm for. Plus any of the former are stochastic which may accidentally ignore true issues (just like humans).

▲14113 2 days ago | parent | prev [-]

Because LLMs are statistical. They can, with a given probability, avoid memory issues, but cannot prove the non-existance of memory issues in the way that that borrow checkers and other formal methods can.

▲Fervicus 2 days ago | parent | prev | next [-]

> Zig is just trying to be a middle ground, which we've established doesn't work

We did?

▲mglvsky 2 days ago | parent | prev | next [-]

Are all programming languages which initially to be ergonomic to humans (Rust included) irrelevant in the "LLM era"?

▲raincole 2 days ago | parent [-]

All the programming languages that didn't already have enough inertia when Claude Code came out will be irrelevant.

▲mglvsky 2 days ago | parent [-]

But... but... they said about so powerful AGI/ASI, and turns out it needs "inertia"/support data and cannot improvise via any isoteric language or write directly machine code.

Poor AI

/s

▲raincole 2 days ago | parent [-]

Yeah, I think AI-generated assembly/machine code will be more and more common. The human-oriented programming language popularity ranks will be pretty much "fixed" from 2025 onwards.

No /s

▲vazark 2 days ago | parent | prev | next [-]

Not really, Zig takes the exact opposite stance as Rust for correctness.

Rust is the language defending itself against human mistakes whereas Zig promises the dev/agent total freedom by eliminating implicit interactions. That makes zig more readable/approachable without needing large amounts of context.

▲pjmlp 2 days ago | parent | prev [-]

Except for rewriting LLVM it depends on for its compiler implementation.

AI is also a great tool for C and C++ development, especially when writing English to C/C++ compilers.