4 ms·
"Zig is aggressively pursuing its goal of overthrowing C as the de facto language for system programming." If there's one truth I've learned in my decades of d
by ken 8y ago
"Zig is aggressively pursuing its goal of overthrowing C as the de facto language for system programming."
If there's one truth I've learned in my decades of dealing with computers, it's that you can't beat C at being C.
Before now, I'd never heard of Zig in particular, but I can think of several other languages that have tried or are currently trying. A lot of people seem to think they can make something a little better than C, in some ways, and that will be enough. I doubt that even C18 itself, if it were invented from scratch today, would be able to unseat another systems programming language.
Everybody forgot about Worse-is-Better: "Unix and C are the ultimate computer viruses". Any language which isn't more 'viral' than C (in terms of being ported, and attracting users) has no chance. You're starting tiny, and growing less quickly.
- pjmlp 8y agoWe could, back when using C meant having to enjoy access to an UNIX computer center.
- audunw 8y ago> If there's one truth I've learned in my decades of dealing with computers, it's that you can't beat C at being C. Have you ever seen a language that has made a serious attempt? The last few years, the only significant one I know of is Rust. But it's not really a C replacement. C is essentially fancy assembly. Rust is conceptually quite advanced. Zig is one of very few languages I've seen that makes a serious attempt at being a better C. No garbage collection, no fancy borrowing checker, but quite a few improvements/features that actually matter to low-level/embedded programming. My use-case is microcontrollers, and I've tried a few different new languages for fun. Zig is the first one where I actually came out of it wanting to use it for real. The only problem is it's still not finished.
- abainbridge 8y agoHave you got an example of a C replacement that was actually better than C, got as far as Zig and is now abandoned? I can't think of one. I've been look for a better C for 15 years and Zig is the best candidate I've found. I don't think DasbetterC counts, since it is a side effort to the greater goals of D.
- pjmlp 8y agoTurbo Pascal, Object Pascal and Modula-2 would be such examples. Their sin was not being bundled with an OS, originally distributed with source code by a symbolic price.
- lpu4o74p 8y agoWirth didn't produce anything usable before Oberon (which is garbage collected, so outside of the C niche.)
- abainbridge 8y agoInteresting choices. They're all very old. I feel we must have learned something since the 1970s that could be used to improve a systems programming language. I don't really want to restart a flame war that was extinguished decades ago but Kernighan's critique of Pascal (http://www.lysator.liu.se/c/bwk-on-pascal.html http://www.lysator.liu.se/c/bwk-on-pascal.html) is an interesting read today - if only because it reminds me how much simpler things were back then - no mention of memory safety or multi-threading. I have no knowledge of Object Pascal and Modula-2, so won't comment.
- pjmlp 8y agoKernighan's critique was very biased and he focused on plain ISO Pascal on purpose to get his point across. Cleverly not mentioning that many issues were fixed on ISO Extended Pascal and other dialects. Also that back then outside Bell Labs, most C compilers were actually dialects of the real thing, like Small C and RatC. So it was not like C wasn't without its portability issues outside UNIX. As for memory safety and multi-threading, check Concurrent Pascal and Solo OS from Per Brinch Hansen.
- Verdex 8y agoA couple of things have changed though. LLVM exists, we are being flooded by parser frameworks that make that whole business much more pleasant than the lex/yacc days, the llvm and Regehr blogs both spelled out some info on undefined behavior that previously people either didn't understand or refused to believe, the size of software engineering has grown to include many different niches, computer architectures have by and large grown more homogeneous (and where they're different you aren't going to be exploiting their power with lowest common denominator C), memory hierarchies aren't flat and it's becoming the determining factor in program speed, etc. It's not obvious what needs to come next, which is the only reason that C is still here. Most likely several languages are needed to fully replace it. And our industry is starting to feel that out now. D, Go, Rust, Jai, Zig, P, C# low level primitives. Things are changing. Even C++ seems to want to be a different language with some of it's latest developments.
- sevensor 8y ago> "Zig is aggressively pursuing its goal of overthrowing C as the de facto language for system programming." I think it's fine to have aspirational but unrealistic goals. > If there's one truth I've learned in my decades of dealing with computers, it's that you can't beat C at being C. You can't, but as the realm of computing expands, it makes space for new languages. There's a lot of room in the space adjacent to C. We have embeddable languages -- schemes, lua, even Python to some extent. We have languages like Zig, Rust, and D, that can compile to object files that look as if they came from C. And we have other languages that generate C, like lisps and ocaml have done for 20 years now. C doesn't have to be a language anybody writes, to be a language that everybody uses.