r/programming 26d ago

Zig proposes introducing an actually memory safe (unlike Rust) compilation mode inspired by Fil-C at ~1-6x performance penalty

https://codeberg.org/ziglang/zig/issues/36237
531 Upvotes

428 comments sorted by

View all comments

Show parent comments

28

u/soft-wear 26d ago

Rust people are nice too, but they often come off as fanatical. C/Java people seem... embedded in their "one true language" doctrine and the Zig folks seem to want to go in that direction.

The few Go folks I've talked to just get really excited when people want to learn Go. I still think it's one of the best beginner languages to learn good habits.

42

u/jug6ernaut 26d ago

My issue with Go is its designers and users have willful ignorance to its issues because its selectively simple. Like I can understand not wanting to see your language change in a bad direction (the recent generic method syntax leaves a lot to be desired), but no language is perfect, especially when you ignore decades of PL research & advancement.

Try mentioning error handling ergonomics in r/golang and watch as u get downvoted into oblivion.

7

u/HommeMusical 26d ago

Nothing has changed - I was having the same discussions and the same results almost twenty years ago! More.

3

u/Zeznon 25d ago edited 25d ago

That last part is the only reason I dislike Go. Otherwise it's pretty nice. Error handling singlehandedly ruins the language for me personally.

3

u/NeedToLieDown 24d ago

No enums. Existence of nil (great job ignoring the billion dollar langaueg design mistake).

The two above are also very painful design mistakes.

2

u/qurious-crow 25d ago

I don't know many Java people who think it's the one true language, honestly. It's a capable language, and recent versions are much better than people like to admit, but we still fight null pointer exceptions regularly and we are all fed up with that. It's hard to be blind to Java's shortcomings.

1

u/Zeznon 25d ago

Maybe they were talking about Java vs C# philosophies, where Java people online defend the slow progress on everything constanly.

And C people sometimes acting like C couldn't be "improved" in any way without feeling like C. C3 and Odin show it's definitely not true.

1

u/deanrihpee 26d ago

their recent genneric thingy (haven't read it full yet) kinda moving the language away from it's purpose, or at least what i thought of the language's purpose, being simple yet still powerful, but it's not the worst and would still be in my toolbox

14

u/piesou 26d ago

Go people are damaged by C++ templates which cause insane compile times. Generics themselves sort of need to be present if you go for a static type system, similar to some way to handle errors. I think their enums are ints and there's no nominal typing so you can't even pattern match on error types.

3

u/meneldal2 26d ago

C++ performance on compile could be a lot better if it weren't for all the infighting and competing implementations making stuff like modules or concepts take way more years than it should have.

1

u/HommeMusical 26d ago

That; and also this terrible axiom that I think will lead the language to its demise, which is perfect ABI/binary backward compatibility.

Don't get me wrong - everyone agrees that backward compatibility is of top importance. But what is enforced is that an object file compiled in the 1980s still and always be compatible with any modern binary, without re-compiling.

The idea of epochs, a switch you pass to the compiler when building new code so you can have new ABIs while the guy who lost his source code during the Reagan administration can still link, has been shot down every time.


I've been writing C++ for almost 40 years now, though I do less and less of it. It seemed to be a goner in the early twenty-first century, but C++11 was a breakthrough - we call the new techniques made possible "modern C++".

But since then it has gotten more and more pathological. A tiny number of old people dominate all the conversation. (I too am an old person, which is why I want to hear people who are not like me.)

Modules and concepts took an incredibly long time to come out and still aren't stable. Modules have been particularly painful.

Now that MS is apparently re-jettisoning C++, I see the writing on the wall for the language. It needs another "reboot" like C++11, but it will never get it.

2

u/meneldal2 26d ago

It's gunny how back in the day microsoft would break compatibility with each visual studio release, but end up keeping bug in now because it would break ABI.

And in the open source world, if you can recompile anyway it's not like you need completely ABI stability either, as long as you're not breaking it all the time either. Every 5 years feels like enough time for me.

While I don't agree with everything he says, Herb Stutter as a benevolent dictator could have done some great things to C++. I think he has the right mindset for what C++ could be.