3 ms·
There will never be a true successor to C since C is "high level assembly." The lack of pointer checking, unsafe casts and non-existent bounds checking aren't a
by hn_submit 13d ago
There will never be a true successor to C since C is "high level assembly." The lack of pointer checking, unsafe casts and non-existent bounds checking aren't an oversight but by design! Assembly doesn't have them so neither does C! There's no reason to whine about it.
The real problem is that people are using C for the wrong reasons. C is for the development of operating systems and low-level code, not applications.
Zig is more modern but anything that does even one iota more of hand-holding or has anything that looks like a guardrail fails the test.
If you want to write applications use Pascal, Java, C#, Swift or Go.
- monocasa 13d agoExcept Rust is actively being used in kernel space and low level embedded systems as well.
- hn_submit 13d agoIt's useful, but systems programming languages shouldn't be used to create applications in the first place. We're trying to solve a problem that shouldn't be solved. We're continuing and even confirming the usage of systems programming languages for application development.
- everforward 13d agoI don’t think this delineation is that clear, unless by “application” you mean the app tier of a 3 tier app. Postgres and Nginx make sense in system programming languages; they’re extremely performance sensitive and that granular level of control offers them features. Interpreters are sort of the same, they interact with the OS a ton, it makes sense to work in the same language as the OS. I do generally agree for the app tier of a web app. I wouldn’t build a CMS in Rust, but I also wouldn’t build a reverse proxy in Python.
- hn_submit 13d agoWriting an operating system kernel in C is valid usage since there's a great deal of thought going into it and it almost never changes. EVERYTHING ELSE is invalid usage no matter how performance critical people claim their application is. These are just excuses for people to use a grossly unsafe language to get that last 2% of performance whilst costing the world trillions in lost productivity and security breaches.
- RossBencina 13d agoAn operating system kernel is the last place you want an unsafe language, if you can help it.
- boomlinde 13d agoWhat are the requirements and design constraints of an application? Please give a general answer that applies to all applications.
- hn_submit 13d agoAnything that's not an operating system kernel.
- boomlinde 11d agoYou didn't answer nor apparently read my question. You can just answer it in whatever terms you consider some piece of software to be an application when you say "systems programming languages shouldn't be used to create applications in the first place."
- tcfhgj 13d agowhy shouldn't they? humanity consumes more resources than is sustainable, and systems languages can help to reduce resource consumption.
- monocasa 13d agoRust is also a great language for app code. I reach for it now in places I used to use python.
- PaulDavisThe1st 13d agoIs a digital audio workstation or a "AAA" game, with their timing constraints, unbounded computational loads and general demanding performance requirements closer to "an application" or "operating systems and low level code" ?
- hn_submit 13d agoAn application since it's not an operating system kernel.
- PaulDavisThe1st 12d agoso you're suggesting that developers of these types of applications are making a mistake by using C++ ?
- slopinthebag 13d agoi dunno, people are using rust effectively to build applications too. and apple has started using swift in the kernal. i do agree that applications are probably best built in fast garbage collected language. but it also seems like go, java, C#, etc have other downsides that push people towards things like zig or rust even for apps. it also depends on what you mean by "apps". is a server an app? what about an actual native cross-platform desktop application? does go, c#, or java have a good paradigm for that? what if you want to use an oss language not tied to a big tech company? you start running out of suitable languages pretty dang fast. you could name any application type and i could probably give you reasons why you might want to build it in a "systems" language instead of a high level one.
- davemp 13d agoHave you written anything low level in Zig? If anything, Zig is lower level than C. A lot of the “high level assembly” parts of C are actually compiler extensions and not from the C spec. libc is even worse.
- hn_submit 12d agoC wasn't meant to fully replace low-level languages like Assembly. Context switching still isn't possible in C (nor in Zig). And most C library calls are actually Unix system calls. Malloc() is an operating system call and not a library call. Yes, they made it a library call later on to facilitate usage in other operating systems but it was originally an integral part of the Unix OS.