Inspired by Andrei Alexandrescu’s answer, I started writing a long comment…then decided to recapitulate and answer the question.
I admit I’m not a pusher or an expert in C, D, Go, or Rust. I use C/C++ frequently in coding when I want “bare-metal” speed, or when I want modules to run as services on the back end. Since that’s a stylistic approach, not exactly fundamental- let me qualify to say I do “Integrations” or at least performant interfaces between disparate systems, and I solve some really interesting problems, and face some challenges which are not unique but significant in themselves.
My main contribution here is to question the premise of the question! I don’t mean to nuke it entirely. I think it’s a relevant question, but speaking of replacing C… that reminds me of turning to the pet store when you have just put your dog down at the vet.
So is there a better question to reach for the result looming at the end of this current question?
Integrations seem to be the immediate future (10x years from now lol). Rather than looking to more middleware there is a trend of revolution. In my wildest tech fantasy I’d like to see optical systems and holographic character recognition in place within 5 years. I mean, why not? MIR (Micro Impulse Radar, LLNL) has a clock cycle of 33.3Ghz and could work in an optical system, particularly if that were all it were doing. So speaking of speed and next-gen architecture, regardless of how or when it comes down, the current model of hardware needs to change, because it is causing layers of complexity that are work-arounds rather than solutions. Now that we’ve effectively put mainframes and servers inside desktops, yay team, we actually need to rethink computing.
But you aren’t going to get that response from an industry which is tooled from tip to toe using the existing systems.
And yet one can’t quash evolution. There are evolutions and revolutions present in the aggregate world of languages, and we are more likely to find some small and completely obscure language which effectively solves a real-world problem such as a virtualized system model that represents the quantum leap in computing. In that case, the language that goes forward will not be carefully positioned, elected democratically, or even branded into existence. It will simply be.
2 examples hopefully illustrating a larger point:
These are not the only examples in an era which is progressing to the edge beyond behavioral programming. Event based architecture allowed the evolution of the Reactive paradigm, which is the industry’s word for what I call “behavioral programming” or the precursor to self-aware systems and something that more closely resembles true AI.). To be clear, we are still 2 orders of magnitude away from producing hardware and software that can render any type of true AI. However, we are also pushing on the first of those stages. That push was allowed through Event Based architecture.
What will be next will either require new systems (hardware) or will move forward based on a really poorly performant virtual systems. However, this seems to be more likely the case… and in that case there will be language to serve self-aware objects and the constructs of dynamic functions. All AI will use dynamic functions and programming idioms that neither C, C++, D, Go, or Rust use. One of the chief bottlenecks will be hardware processing of code and language itself, therefore optical systems, laser, and/or radars will be desired- and as I have just said it is likely that a prototype will appear before an entire industry re-tools itself on speculation…
Somewhere between the certainty of a future which is going to happen and what is being discussed here today I really appreciate the efforts to be proactive and replace C. However, I’m not even sure it’s broken, and I would sum it up like Einstein said- you don’t solve the problems of today by following the same logic that got you here to begin with.
Having said that, I like D. And I will learn Go sometime in my career, perhaps some weekend when I’m not doing anything else.
I am not a language guru' but I am a student of the development of social institutions (and language is one of the oldest human institutions) and an approach that is useful for understanding change in the domain of economics may prove of at least some small value when thinking about the role played by different computer languages and the relationship between them.
Peter Thiel is right: competition is for losers!
http://www.wsj.com/articles/pete...
And these languages are not truly competing with each other. I really can't imagine (in part for the reasons that Andrei mentions) that in the typical domain of Go there are many users who have an epiphany and think "well, really, this was all a big mistake and we should have written it all in Rust". And the opposite is also true. Go, as Rob Pike has said, serves a particular purpose, and that's not the purpose of Rust. It really wouldn't make sense for Google to have put those developers not long out of school to work writing in a language whose basic design serves very different needs, and is far from simple, or quick to pick up to a level where you can be writing useful code. Similarly, I doubt anyone at Mozilla had the inclination to write their browser in a language like Go.
D is s little different, because it is more general in purpose. The language itself is quite suitable for writing for embedded systems and some kinds of system programming (the runtime needs some work for some of these cases because that hasn't been the focus to date, but that's a distinct issue). But it's also a pretty good replacement for a language like Python in certain cases, and indeed even at a shop like Adroll, known for its heavy use of Python, D is used by the data scientists because it is productive yet efficient (fast).
In my own domain, which is a particular part of financial markets, I really don't see a real competitor to D for much of what I am doing. That doesn't mean that I won't also use Python for some things, Lua for others, and in time Go might also make sense.
In his speech that is better known today for the pithy saying that "premature optimisation is the root of all evil", Knuth also welcomed the future proliferation of languages, because language is the expression of thought, and different people naturally think differently, and that's also dependent on the problem domain. It's fun for a bit to pit languages against each other, but it's a mistake, in my view, to think that this captures the essential nature of this question, because it doesn't. I think these languages all have a bright future, but that mostly people will use them for different purposes. C will be around for a long time yet.
Probably none of them could replace C because C is intended for low level interface to hardware and data where you don't know things like data types ahead of time. So Go! is out because it is a logic based language that does not have the necessary procedural aspects. D is out because it does not have the low level stuff like bitwise operations, etc. And Rust is too restrictive, in that it does not let you do things that might seem unsafe to the compiler. But Rust has the best chance would guess. All they have to do is add a variety of unsafe labels for circumstances that may be necessary for low level operating systems programming.
The reality is that there is never a reason to come up with a "new" language.
C or C++ are perfectly adequate.
Those who think the memory management is too hard in C or C++ don't have very much imagination. First of all it is not at all hard to simply do your own house keeping. A good programmer sets up variables at the beginning of a function, and cleans them up at the end. Things that have been created are not that hard to delete. But you don't really have to in C or C++ either. You can use memory management libraries if you want. I recall using Lattice C++ with calls like Alloc_Remember() way back in the 1980s. It is not at all hard to add memory management tools or anything else you might want, to C or C++.
The idea we need a new language is more from people who want to make a name for themselves.
And remember that any web language is out by default. Web scripting and design has nothing to do with real programming in the general world. It is very specific and quirky due to the lack of maturity of web browsers.
None of those languages will replace C.
Fans of D, Go, and Rust can have a good old time fantasizing about this subject - but it’s really a waste of time because it simply isn’t going to happen. Here are a few reasons why:
So flame-on if you wish, I’ve got my trusty asbestos suit on - the same one that has served me well for many decades now. And as much as you want to argue, the facts about C that I have pointed out are just that - facts. You can debate facts if you want, but it’s still a fools errand to do so.
:)
First: I don't think anything's going to replace C for quite a while -- In a lot of places C is used, it tends to be a language that's hard to beat -- the "enhancements" the other languages introduce tend to be *contrary* to what makes C the right language -- size of run time, portability, closeness to hardware, absolute control of memory, etc. The only other language that seems suitable to replace C in these domains is Rust, but to make Rust work here, you have to give up a lot of what makes Rust a great successor to C/C++. This means there just isn't reason to switch languages.
However, there are times C is used where it's not uniquely suited, and I'll introduce C++ to compare D/Go/Rust to.
The success of languages have rarely relied on what languages are technically better -- it's largely been about politics, branding, money, what sounds good to the bosses (and not the engineers). This is why Java became such a successful language (whether or not the language itself was worthy of its success).
This explains the lackluster adoption of D -- it's a pretty great language, and most coming from C++ seem to have very high opinions of it. But there's just not the sales and marketing teams behind it to sell it to companies. There's really been no killer apps. Just a few guys who go online and say "D is a pretty cool language." And people are stubborn and this doesn't convince them the same way some $$s can. Despite any technical merit D has, despite how good of a language D is, I don't think we'll see D ever enjoy mainstream success unless something spectacular happens.
This is also why I think Go has the best opportunity. It's got Google behind it. It already has a killer app written in it -- Docker. A lot of companies have also already switched a lot of their code to Go. In a word: Go has quite a few $$s behind it.
Now on to Rust: I think Rust is most technically suited to replace C++/C. I think Rust will be adopted by many -- it does have a major name behind it -- Mozilla, and it's being used in the Servo project. And when/if that ends up being successful, it's a great demonstration of the merit of Rust, and will lend to its adoption by others. Even if it doesn't "beat" Go, I think we'll see it as a very successful language. After all, Python might be more used than Ruby, but Ruby certainly has made a name for itself and enjoys a great deal of success.
That said, there's so much code and momentum behind C/C++, we'll probably not see these languages replaced for a long, long time, although Rust and Go might take a bite out of its market share.
Still have a question? Ask your own!