Solved Is Rust now killing C++ and eventually C with it ?

I think ralphbsz point is that gaming performance, compared to the computing industry as a whole, is not as relevant when choosing a language. In other words, choosing a language based on gaming performance is not as relevant.
I think that's a good way to put it, I didn't think of that.

In which case, I do agree. I do think that it would be generally a waste of time to try and implement a game engine in another language just because the dev likes it. Instead, I think it would be better to try to implement a game using the same language as the game engine/API. Yeah, hardware is powerful enough to take on anything these days, but it's probably better to avoid making it do extra work (of language translation) if you want to prioritize performance in the game.

As in, one can probably implement the Furmark benchmark in any language, and it will melt the 4090 NVidia GPU for you no problem. ;) Some languages may be a better fit for implementing Furmark than others, though, simply because the resulting compiled binary will do a better job of melting the GPU down for you.
 
C or C++ will never be languages that are used by many.
That said, if you were to measure all the machine code that runs on computers and then measure the language used to generate the machine code. It wouldn't be surprising if around 90% of all machine code that runs is compiled C or C++ code.

Take languages like python, it's an interpreter that is probably written in C with a lot of libraries that are mostly made in C or C++. Python is almost 100% C or C++ code.

Writing code for larger projects, involves a large investment of time. There's a lot to think about and there are already things in Rust where you can see that they've rushed the language forward.
C++ has also made mistakes but managed to work out most of them, since backward compatibility must also work, they cannot destroy the language.
About very 5 good compilers exists for most C++ developers, C has hundreds. Only LLVM can compile Rust code.

Rust will probably take developers from C# mostly, maybe java but I don't think that it is going to affect C or C++. And there are other new languages that may grow in popularity.

C++ in right hands is an extremely effective language and now with AI they are able to produce huge amount of functionality.
 
C++ in right hands is an extremely effective language and now with AI they are able to produce huge amount of functionality.
Same as a sharp knife. It does many good things in the right hands, and it can do terrible things in the wrong hands. And then you can tie them to the ceiling fan, with long strings, switch it on and rush out of the room (that's the AI scenario (I know I have a sick mind before coffee)).

Just like the knife, C/C++ does not belong in every hand, and in every place. There are, however, places where it is needed. As one professor told us, you can cut your steak with a crewdriver. It'll work, kind of, but it won't be pretty. And here comes the point - when you can do something in an elegant way in C/C++ that would require big efford in other languages, it may be even less likely to have bugs. So I would say the area we need to cover in programming is growing, and it will have space for some new languages. We can't do everything in C/C++, we can't do everything in Rust, but there is room for everyone.
 
This whole discussions about Rust reminds me a bit of what we had in the mid 90s, when C++ became popular:

"C++ is THE language! Everything now has to be done with C++, only!! Anything else is dead!!!"
And it's not so long ago you risk to be stigmatized as a caveman from outer space just by mentioning you're not doing all programming exclusively object oriented, only, but dare to say you sometimes may use ..."functions". 🤪🤮

Short time later we've seen similar things when Java was new:
"This is great! Finally all dreams of all programmers come true: no hardware dependencies at all whatsoever anymore!! Just only one programming language. All source code will run on any machine!!"
I remember such discussions like:
"...but you need kind of a VM to run it - "
"YES!! YES!!!"
"- and this will cost a lot of performance."
"Of no importance. Machines soon will become so fast, it doesn't matter anymore."

Well...looking back I think we don't need to go into details of this, again. As many others here could bring more details, even more warstorys like that to topic.
Summarize all the hype that's also made with AI I could take the short cut and say:
"We don't need no Rust anymore. We don't need no HL at all, anymore. Let the AI produce assembler code directly!" 😎😁

But that's not my point.
My points are:
Don't be too enthusiastic everytime when something new appears. Listen to 'greybeards'. If experience tells you anything then it's: there is no jack of all trades, and never will. Wait a bit, and you'll see sooner or later it gets into perspective. Everything always does.
Then it's good you still have options you not threw overboard, rashly.

And above all: You all seem to see the technical points, only.
The question of if Rust was the better language is not the only, not even the most important point.
Think about it:
We are sitting on an open source project most parts (I read 90% somewhere) is written - and working - in C.
Most is done by volunteers.
Think also about the social aspects:
Where is the larger pool - now and in the future - you may recruit volunteers from?
C, or Rust, a language cleary not for noobs, you can read everywhere about how hard it is to learn?
 
"C++ is THE language! Everything now has to be done with C++, only!! Anything else is dead!!!"
Short time later we've seen similar things when Java was new:
"This is great! Finally all dreams of all programmers come true: no hardware dependencies at all whatsoever anymore!! Just only one programming language.
Isn't that humans nature ?
Everyone gets hyped, and after the hype cools down, everyone starts to see the bigger picture.
If not, C/C++ would be really dead, I guess.

Fun fact, C is still alive, and more lively than the outside world can imagine.
C++, too, of couse...
 
Isn't that humans nature ?
Everyone gets hyped,
No. Not me. And others neither.
A scientific structured human being more mature than a twelve year old with some self control, and a bit of life experience always stays sceptical.

A hype is a media phenomenon, and it always has its cause in something shall be sold, works always the same way:
While of the new thing only the pros are promoted only the downsides of the existing things are highlighted.
The addition causes more distinction than just to look at one side, only. That's contagious, causing an avalanche making anybody look foolish who refuses to also be carried away. And that's another booster of a hype: To shut up critical voices, weaken them, make them look 'old foolish', as they were preserving standstill of progress. Again you need to look cool headed at it to see: They simply don't run stupidly with the flock, but keep asking questions. That's not the same as preventing progress.

One needs a bit of experience, self control, and self esteem not being washed away when the flock start running into one direction. Being carried away needs no effort, is always easy, and often even fun. But one always needs to remind yourself: Not seldom afterwards comes the hangover. Ask yourself: Are you cattle, or a civilized human being, perhaps even claiming to think scientificly? Face the facts: In reality there is nothing having only pros.

This ain't not effortless. Even if you feel alone you are not.
Besides you may not suffer the hangover not seldom those 'old foolish party-poopers' are afterwards the ones needed to help cleaning up the mess with their experience - if there is enough left, that can be fixed.
That's why some step onto the brakes: To keep avoidable damages as small as possible.
Which again is not the same as preventing progress, but getting reasonable progress.
🥸
 
So I would say the area we need to cover in programming is growing, and it will have space for some new languages. We can't do everything in C/C++, we can't do everything in Rust, but there is room for everyone.
Yes, I think that almost all that are using C or C++ is because they do not have any alternative.
At the same time, I think there has been a lot of inflation in new languages.
 
Kassler first post is as much a misguided AI post as I've ever read.
Why?
If code is written in C++, developers need to master a lot themselves, the freedom of the language forces it.

The developer must understand different patterns. Something that many other languages build into the language itself.

AI picks up patterns quickly and C/C++ code in particular must in principle be written according to patterns rather than the domain.
Writing code like you write a novel or fiction book should not be done in C++, C++ code should look more like a phone book.

That's exactly the type of code that AI picks up quickly.
For example, the style hungarian notation works really good with AI
 
The developer must understand different patterns. Something that many other languages build into the language itself.
Understanding different patterns is a good thing because not every pattern is suitable for every case.
The second part restricts you to patterns that the language supports.

If one accepts as a truth "not every pattern is suitable for every case" then by implication "a language that restricts the patterns to ones that are built in is a language not suitable for every use case"


If code is written in C++, developers need to master a lot themselves, the freedom of the language forces it.
This freedom makes life worth living, gives one a chance to learn new things. Not all things need to be "mastered"; one can be conversational in a lot of different languages (I'm talking about Spanish, French, Russian, etc) but decide to be truly fluent/native speaker only a couple.

In the end, programming languages are simply tools. Like all tools, one needs to choose the correct tool for the specific job and looking at new tools is never a waste of time.
 
>Rust will kill <language>
>C/C++ is dead and will be replaced by <language>

Oh, I sure have heard that one before
 
And that's another booster of a hype: To shut up critical voices, weaken them, make them look 'old foolish', as they were preserving standstill of progress.
I absolutely agree, and that is a foolish decision human hyped beings tend to make.

One needs a bit of experience, self control, and self esteem not being washed away when the flock start running into one direction. Being carried away needs no effort, is always easy, and often even fun. But one always needs to remind yourself: Not seldom afterwards comes the hangover.
Yes, but if a big sum of money is one the table, I do not think that many people can resist the fun.
Take the yuzu emulator as a case.
It was a hobby project, then people started to pay money to get game X, Y working proberly on PC, not aged consoles, because Nintendo is just braindead regarding that fact.
In the end they made millions, until they got absolutely careless, making the whole project a money cash trap.
The person who pays more gets feature, game X,Y to play.
I am not sure whether one person can 100% resist something, even with given experience once realizing that you are already trapped.
 
Depends, but sure, yes.
But the real question is:
Do you let a hype carry you away?
Usually no, because a hype almost always represents something for me that is not thoroughly thought about/of, resulting in a big mess afterwards.
It lets you forget about the real things, and only carries you into a real mess.
Not to mention the time spend with it, where it usually could be invested in more meaningful things.
 
Not all things need to be "mastered"; one can be conversational in a lot of different languages (I'm talking about Spanish, French, Russian, etc) but decide to be truly fluent/native speaker only a couple.
Programming "languages" should really be called programming notation as they are far far simpler and quite limited compared natural languages. While most people can not master more than a couple of natural languages, this is not the case with PLs. But "mastering" a PL is not the same as mastering programming. The latter is much harder.
 
  • Like
Reactions: mer
Short time later we've seen similar things when Java was new:
"This is great! Finally all dreams of all programmers come true: no hardware dependencies at all whatsoever anymore!! Just only one programming language. All source code will run on any machine!!"
I remember such discussions like:
"...but you need kind of a VM to run it - "
"YES!! YES!!!"
"- and this will cost a lot of performance."
"Of no importance. Machines soon will become so fast, it doesn't matter anymore."
I do remember seeing that kind of conversation about Java around late 1990s/early 2000s. Yeah, the conversation was mostly loudly promoting Java as the next 'best thing since sliced bread'. But around 2005, the arguments about technical downsides did become more visible.

Conversations about technical downsides of Java actually have persisted about as long as the promotional noise before it. But right now, LibreOffice, Obsidian Notes, and UML modeler packages actually do depend on Java, and it doesn't seem to matter too much, because the hardware (at least the recent stuff, like my Ryzen 5000 series) IS actually powerful enough so that the required JavaVM doesn't get in the way of actually running the damn software's features.

Seems like the Rust hype has not yet reached its blind and mindless 'Rust is great, everything else can go to hell!' peak. At some point that will happen, things will start going to hell, that will force Rust proponents to finally notice and acknowledge the downsides, and actually fix them or learn to live with them.
 
Rust is much lower risk than Java, though. No garbage collection that assassinates large heaps. No just-in-time compilation that is somehow magically doing the right thing. No jerk vendor in control. Suitable for in-kernel work at least in theory. Has a printf equivalent early on. And of course faster.

So I think the failure of Java doesn't necessarily translate to an eventual failure of Rust.

Doesn't mean Rust is not hyped of course.
 
Seems like the Rust hype has not yet reached its blind and mindless 'Rust is great, everything else can go to hell!' peak. At some point that will happen, things will start going to hell, that will force Rust proponents to finally notice and acknowledge the downsides, and actually fix them or learn to live with them.
Two areas that I think will be more and more problematic is the ease of the cargo system. If something is easy it will be used but whats easy short term might not be easy long term.
Adding a lot of external logic without carefully knowing what you add is very dangerous.
Number two for me is more a personal thing but important when projects scales to huge amounts of code. There are a lot of abbreviation in rust. If rust abbreviates then developers that use it also abbreviates or at least it is more natural to do that. Navigation in code is very very important for large projects and code that have a lot abbreviated names is harder to navigate in.

There is also code that looks like message chains. Don't now how rust developers normally manage that but message chains makes code a lot harder to refactor if they are misused.
 
That said, if you were to measure all the machine code that runs on computers and then measure the language used to generate the machine code. It wouldn't be surprising if around 90% of all machine code that runs is compiled C or C++ code.
Big computer users measure this. And your statement is false. Depending on environment, the bulk of all code can easily be Java, Typescript, Python, or other languages.

Take languages like python, it's an interpreter that is probably written in C with a lot of libraries that are mostly made in C or C++. Python is almost 100% C or C++ code.
Ultimately, you're correct, as the most common Python compiler/interpreter is CPython, which is itself written in C/C++. Note that Python is both compiled and interpreted!

But claiming that Python code is actually C code is pretty pointless: The performance characteristics of Python code depend very little on the programming language the underlying compiler/interpreter, and much more on how the code itself is written. And yes, I've written Python programs that run for multiple days on clusters of 10,000 computers, and I have put in time optimizing their performance.
[/QUOTE]
 
Kind of a silly topic, eventually, but it is still interesting to see how far Rust has come.
I am a big C fan, and C++ was my go-to language for 9 years so, I would not be happy if Rust just overtakes C++ position.
As I searched the web today, I found that Bjarne Stroustrup called for assistance/help, for making the language more memory-safe ?
I do not really know how to interpret this, but if C++ really dies, does C also die ?
The American government, cybersecurity experts, etc claim that C/C++ is the source of many memory corruptions, exploits, etc, due to their unsafe memory handling, and everyone should move to memory-safe alternatives like python, C#, Rust, etc ?
Sure, there can be memory errors, but is the source not to 99% always the user ?

What does everyone think about it ?
I mean, if everyone ditches C/C++ no one will make new standards, upgrades, etc, right ?
Bjarne is very out-of-touch, probably has always been. He always gives me that feeling of the "how do you do, fellow kids" meme. He and the C++ commitee or whoever is responsible for the language adopt all kinds of unholy and god-forsaken language features and throw them all into C++, half-baked. An example is the new modules feature, which is nice and better than headers I guess but it could have been much better.

That being said, Rust has a fair share of improvements over C++, but also has its downsides and annoyances. Rust adoption is very artificial, promoted by corporations and even governments, and it will not kill C or C++ at the very least in the next decade if ever. Rust will live as an alternative to C and C++, an extra choice for those who want it. Even if everyone wanted to get rid of C-like languages, there's no way that will happen in the near future because all software infrastructures are tied to software and libraries written in C or C++.

Mandatory memory-safety with a borrow checker comes with the downside of hindering the developer's freedom. Bugs are inherent to software and it's our job to fix them or prevent them from existing in the first place. You have all kinds of bugs, from logical bugs to memory errors to misuse of pointer and index arithmetic, to multithreading bugs and so much more. If we design languages and systems where it's impossible to make any kind of bug we become imprisoned and lose all the power that a language can provide.

Thread-safety is something that sounds nice on paper but imposes a very specific way of spawning and managing threads and retrieving information, handling exceptions and errors, etc. I very much prefer to have full freedom to design this how I want instead of having to do whatever cryptic way this modern language wants me to. C++ multithreading is nice, and I also like Java multithreading (as long as I use lambdas instead of runnable classes). This problem is similar to Rust's memory safety problem.
 
Back
Top