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

Some have mentioned the US government recommendation to use Rust but here's a reminder that there were a few other languages also mentioned. C#, Go, Java, Python, and Swift.
I quite liked Go myself.
Garbage-collected languages are considered memory-safe too. Either way, NASA uses C and has strict guidelines for writing safe and correct code (safe in multiple ways, not just memory). They put people, stations, satellites and more in space and they don't need Rust or enforced memory safety for that, so the fact that the government is pushing for memory-safe languages and primarily Rust is a bit shady.

I like Java by the way
 
While there is no formal research on speed of programming languages there is a table that Google published that lists energy usage. It looks pretty equivalent to speed from a few datapoints.
While the data in that table is absolutely correct and accurate, it has to be taken with a HUGE caveat: It applies to one specific testing setup, and a particular set of test applications. For other programs, the results will vary by large factors (of 2 or 10). So for example the difference between C, C++ and Rust (in that table a range up to 1.34) could easily be wiped out by different coding idiom (or style guide), or a different set of problems to be solved. Just the contrast between programs that are memory intensive versus integer operation intensive can change these results.

Another important thing to remember: For the cost of one software engineer, one can operate somewhere around 100 servers (depending on the exact cost structure, that number is between 10 and 1000). So investing lots of programming time into speeding up programs by a few percent is usually foolish. This is why I had a python program run for a day on 10K servers in parallel: It's cheaper to do that than to rewrite a large piece of code in a language that runs roughly 75 times faster, since the rewrite would take me a year.

Anecdote about this is in this old post: While in general Java code is roughly 2x or 3x slower than C/C++, this is not always true, as I have carefully measured in my mis-spent youth.
 
My first ever experience with a garbage collector was something I wrote back in the early 80s on an oric 1 micro which was an early british 6502 micro. The program took a load of data points mapped to a grid and constructed a contour map, and printed the contours out on the oric mini-plotter. I was making a map of a large survey area and had 4 orics running in parallel, each one calculating the contour map for a different grid square, there were about 100 squares that needed contouring. I can't remember exact times now but each square took something like 5 minutes to produce a contour map for, which is why I was using multiple machines in parallel if I was ever to hope of getting the job done in any sort of reasonable time span. This was for a geophysical magnetometry survey. Anyway... I divided up the field data, stuck it on different casettes, and started the four machines running, doing their stuff and printing out the maps. I noticed something strange happening. Every ten minutes or so, one of the machines would stop printing dead in the middle of a map, and just sit there for about five minutes doing nothing, and then start up again. I knew it hadn't crashed, because you could hear a particular signature background digital noise on the buiilt-in speaker when it was running. I had no idea what was causing the hangs.

So I trawled through the books, magazines etc that I had lying around. I found out the basic interpreter had something called a garbage collector, and that every now and again when the interpreter had enough garbage to collect it would halt all other processing and sit there solely doing garbage collection. This was on a 2 MHz 6502 (or was it 1 MHz... can't remember) with 48 kbytes of RAM. It was as slow as hell. Reading a bit more, I learned that if I called a particular rom entry point I could force garbage collection to occur early rather than wait for the interpreter to decide it needed to be run. So I changed the code to force the garbage collector to run right after printing each individual map. And that stopped the 5-minute hangs from happening.

This was all so that the basic interpreter could support a model where the programmer didn't have to worry about memory management...
 
While the data in that table is absolutely correct and accurate, it has to be taken with a HUGE caveat: It applies to one specific testing setup, and a particular set of test applications. For other programs, the results will vary by large factors (of 2 or 10). So for example the difference between C, C++ and Rust (in that table a range up to 1.34) could easily be wiped out by different coding idiom (or style guide), or a different set of problems to be solved. Just the contrast between programs that are memory intensive versus integer operation intensive can change these results.
Which means that picking a language for optimal gaming performance is actually surprisingly important. Basically, pick the appropriate tool for the task. And that does run counter to the earlier statement:

How relevant is gaming performance to the overall computer industry?

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.
 
Which means that picking a language for optimal gaming performance is actually surprisingly important.
Is anything other than C++ used for serious high-performance games? WoW apparently uses C and C++: https://us.forums.blizzard.com/en/wow/t/was-wow-really-written-in-cobol/833712/2

I'm thinking PCVR for high-perf and can't imagine choosing anything other than C++; however I'm not sure what Unity engine does (I've seen less-than-stellar performance in all Unity games across platforms; it being a popular choice makes me think they default to something higher-level).
 
Is anything other than C++ used for serious high-performance games? WoW apparently uses C and C++: https://us.forums.blizzard.com/en/wow/t/was-wow-really-written-in-cobol/833712/2

I'm thinking PCVR for high-perf and can't imagine choosing anything other than C++; however I'm not sure what Unity engine does (I've seen less-than-stellar performance in all Unity games across platforms; it being a popular choice makes me think they default to something higher-level).

Unity is generally an engine for C# games.
 
Is anything other than C++ used for serious high-performance games? WoW apparently uses C and C++: https://us.forums.blizzard.com/en/wow/t/was-wow-really-written-in-cobol/833712/2

I'm thinking PCVR for high-perf and can't imagine choosing anything other than C++; however I'm not sure what Unity engine does (I've seen less-than-stellar performance in all Unity games across platforms; it being a popular choice makes me think they default to something higher-level).
Java is used for Android/iphone gaming apps....
 
Java is used for Android/iphone gaming apps....
I wasn't considering phones for high-end gaming :p But I imagine the language of choice is whatever works the easiest with the platform (like Android with Java; Swift for iOS, although a quick search showed Objective-C was prior and like C)
 
Java is used for Android/iphone gaming apps....
Kind of. Many of them (especially ports from other platforms) tend to just be a small Java shim, initializing an OpenGL rendering context and then jumping straight into the C++ via the AndroidNDK. (NativeActivity lets you bypass Java entirely but this is quite tricky because some APIs in Android are only exposed (as stable / supported) as Java).

Though of course, this could be inertia or cyclic reasoning. "Better C++ middleware so lets write games in C++. And now more games are C++ so lets write new middleware for C++". So the slightly weird cycle continues.

(I'm not a big Android developer, I only kind of noticed this because occasionally I like to port some old mobile games to *nix. I see all the Java<-->C++ bindings cruft and ask myself if it is really worth it...)
 
Years ago I sat in on an an interesting lecture from the head of the sony uk games software lab, about their work developing games for the playstation. He said they used a lot of assembler for the console games, to squeeze every bit of performance out of the chips. Unlike PC games, they keep the hardware unchanged over the longer term and instead progressively refine the software. I don't know if they still work that way today. He said it was a quite different market from pc gaming, the economics are quite different, they basically sell the console hardware at below cost price, and recover all the money from sales of the software.
 
I hope i wont get into any kind of problem :D
rust.webp
 
Garbage-collected languages are considered memory-safe too. Either way, NASA uses C and has strict guidelines for writing safe and correct code (safe in multiple ways, not just memory). They put people, stations, satellites and more in space and they don't need Rust or enforced memory safety for that, so the fact that the government is pushing for memory-safe languages and primarily Rust is a bit shady.

I like Java by the way

Yes, but NASA also put out this abomination called cFS (core flight software) which even by their own internal audit was labeled as "a poor implementation of a good idea". Of course I threw it out the nearest airlock and wrote my flight software in c++. But yes, NASA is C heavy and also a lot of space systems are FPGA based because they are generally more resistant to upset events.
 
What else do most people use personal computers for? It's either doing work from an app, or high-end gaming; web browsing is done on phones :p
if speaking in generalities across the whole population of lusers, then I guess so...but some of us literally live in front of our 16 core SMP. 64Gbyte. petabyte RAID, dual monitor. workstations. tasks include: designing simulations, rapid application prototyping in python3, embedded systems and network topology design and simulations, lots of "browsing", digital signal analysis/processing ,etc.
 
The major impetus for adoption is coming from the US government. And probably from other western governments.

Impetus from the US is likely to decrease rather a lot. From what I have heard the Trump administration has made significant (illegal) layoffs. I wouldn’t be surprised if Congress goes along with this and closes down such a meddlesome bureaucratic agency.
 
No. But any thread about rust sooner or later rusts trough, breaks down, and needs to be towed.
Are we there yet?
I think he wants to say that we should stop posting into this thread as it grows bigger and bigger in size, and consumes eventually disk drive space.
 
As long as they accumulate value and information, all is fine. The disk space is not the problem. As long as we all behave, we can discuss this. All I am doing is reminding you all to behave. OK?
 
Back
Top