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

I never had a problem with a commercial company producing compilers.
The problem I have today is Embarcadero wants a thieve's ransom for their latest Delphi compiler.
If I ever need to write 64-bit binaries, there is always Lazarus.
 
Last edited:
I never had a problem with a commercial company producing compilers.
The problem I have today is Embarcader wants a thieve's ransom for their latest Delphi compiler.
If I ever need to write 64-bit binaries, there is always Lazarus.

When I started Common Lisp many of the commercial compiler vendors wanted runtime license frees.

IMHO this was a major factor in setting Lisp back.
 
What is killing C is compilers abusing undefined behavior for "muh optimizations"
Compiler writers need to get their act together and stop treating C like Fortran.
 
The languages themselves were fine. I think for me it was because they were each heavily governed by a single commercial company (Borland, Microsoft). This kind of creeps me out. And JavaScript was... well JavaScript.
It is kinda offtopic here, but as a pythonist since 2002, having built (and still building) huge things in it — cue in the mandatory "python is not a programming language" opinions —, I am way more concerned about the "governance" about these "new and more modern" languages.

Like it or not, I despise having a CoC and as much as I like python, I'm keeping an eye on other languages that might have the potential of eventually replacing it. If this political nonsense around it (and you could tell the same about Rust) doesn't go away, normal, consciously thinking people will just desert it over time when a better alternative appears. As much as I love its syntax and the simplicity/effectiveness, I just cant take the politics of it being forced on me. A programming language should be about the language and technology, and not politics and feefees. I guess we just can't have that though, can we.

Mojo was one of my contenders for another language that has a syntax I like but having looked at their community lately, they seem to be focusing on satisfying corporate customers — probably because there is more money to be made there. And in my opinion, it is exactly what leads to forcing a CoC on the community, because companies will back out from behind projects if those don't bend the knee. Also I just recently discovered Vala, which seems interesting to me, only I don't have the time to try out new languages, got way too much work to do.

Just my opinions, take it as you wish, get as offended as you like.
 
It is natural for youngsters to be enthusiastic about new things instead of having to learn old things. Maybe one day they will want to hang on to the things they know well and not see the need for new things.

I don't see Rust as a big enough improvement to justify a migration at present. I'll let others be the early adopters and see how the situation evolves.
Remember that C & Pascal were once the new kids on the block and the old timers wanted to continue using Fortran & PL/I and what not! Even earlier, there were people arguing that real programmers use assembly languages! New languages succeed or fail not solely on their merit but based on how many people end up using them, which is a function of whether they are a good fit for the programs of a given era, any “killer apps” written in them (as unix was or use of javascript in browsers), free compilers/interpreters, enthusiasm, lack of the same for older languages, support, whether “influencers” of the era praise and use them, politics, etc. etc. Also market conditions. I think Lisp certainly suffered after the second AI winter. So did Prolog. And the new AI uses Python!

Rust has certainly gained the mindshare and more & more programs are being written in it.
 
Ubuntu 25.10 plans to swap GNU coreutils for Rust


Efforts are afoot to replace the GNU coreutils with Rust ones in the version after next of Ubuntu, 25.10 – which also means changing the software license.

The next version of Ubuntu, 25.04 "Plucky Puffin," isn't here yet – but a significant change is taking shape for the release after that, which will be 25.10. That is when Canonical and friends will replace the current core utilities – from the GNU project and implemented in C – with the newer uutils suite, which is written in Rust.
 
I don't know, but I read that some FreeBSD developer suggested to rewrite some parts of FreeBSDs base into rust.
Generally Rust tends to be a little bit slower in the runtime than C/C++ is due to safe memory checking.
Sadly that option cannot be disabled in Rust.
 
As a decades-long ASM coder, I took amusement from the hysteria over GOTO type statements.
At the ASM level conditional jumps are a fact of life.
I just want to get work done, and not have to fight with the arcane sections of the language.
I am comfortable in C, but have zero reason to use it.
 
Hey, can you link to that, please?

Knock yourself out:
 
Knock yourself out:
Wow, now this is solid, technical information instead of uninformed political camp crap.

This really looks like something one can point to and say, "If you don't like Rust, try solving these real-world issues in C, and submit the patches". As Linus Torvalds would say, "Talk is cheap,show me the code!".

Probably the most surprising thing I saw in there is the userland portion of the wifi stack! Exactly the stuff that people have been complaining about in other threads! It actually had me thinking, "Is memory safety the reason that /etc/wpa_supplicant.conf is so uncooperative in FreeBSD???" 👿
 
one can point to and say, "If you don't like Rust, try solving these real-world issues in C, and submit the patches"
Easy. Done. FreeBSD is written in C which solves real-world issues daily.

Its currently the other way. The Rust guys have to solve issues using Rust and submit the patches. So far, in Linux they have been working on the binding layers for the last 3 years and not actually solving any issues.

"Is memory safety the reason that /etc/wpa_supplicant.conf is so uncooperative in FreeBSD???" 👿
No because we use the same wpa_supplicant, written in C, which is fairly spot on in Linux.
The issue you are running into isn't due to user-land wpa_supplicant but more likely the complexity of drivers, lack of documentation for the hardware and lack of help from hardware vendors. User-land Rust won't help this (kernel-land Rust won't either to be fair if the driver is still lacking full hardware support).

I wonder whether FreeBSD also plans a swapping of coreutils in the next major | minor release.
FreeBSD doesn't use coreutils. Thus the uutils won't be a drop-in replacement. It does use the MIT license though rather than GPL.

Remember that C & Pascal were once the new kids on the block and the old timers wanted to continue using Fortran & PL/I and what not!
I suppose the difference is that they were adopted very rapidly (admittedly there wasn't much competition back then). Rust has been around for over a decade now and people are still just in the talking / wrapping C libraries stages.
 
benchpmc is interesting with the slower memory safety checking mention. I'm fine with the why, but does a pmc benchmark exist like that that's not Rust? I'm not familiar with pmcstat or how it outputs.
 
Easy. Done. FreeBSD is written in C which solves real-world issues daily.
So, where are YOUR patches? Does FreeBSD actually support AC wifi at this point thanks to them? Show me your code, buddy.

No because we use the same wpa_supplicant, written in C, which is fairly spot on in Linux.
The issue you are running into isn't due to user-land wpa_supplicant but more likely the complexity of drivers, lack of documentation for the hardware and lack of help from hardware vendors.
If BSD straight-up copied the wpa_supplicant code, written in C, from Linux, how come Linux is so much better at handling wifi?

People who actually do the development of the FreeBSD OS, they are in a much more credible position to decide if Rust even makes sense as a tool to solve the problems that are mentioned in the mailing list.
 
So, where are YOUR patches? Does FreeBSD actually support AC wifi at this point thanks to them? Show me your code, buddy.
Easy. Done. wpa_supplicant already supports AC wifi (written in C). What you are waiting on is drivers. As I described above, the wait for these is not due to language choice. More like FreeBSD doesn't have such support from companies like Intel.

The Linux drivers for wifi are currently all in C, like pretty much the entire kernel. We are waiting on our Linux abstraction layer to be finished for iwlwifi(4), so we can use the same drivers written by Intel (for Linux). We are ~75% there. Rewriting it in Rust we are 0% there ;)

If BSD straight-up copied the wpa_supplicant code, written in C, from Linux, how come Linux is so much better at handling wifi?
Drivers.

wpa_supplicant calls into the wifi stack. If this is limited, why do you think this userland program can magically use functionality that the underlying stack doesn't have?

People who actually do the development of the FreeBSD OS, they are in a much more credible position to decide if Rust even makes sense as a tool to solve the problems that are mentioned in the mailing list.
They decided against it. If you read through that mailing list thread, you will see the rebuttals against Rust.

I agree, the developers are credible. The project is much more methodical as to what will work and what won't. This is why we like FreeBSD and which is also why Linux is spraying Rust around their kernel and FreeBSD isn't.

But this has all been discussed before in that other thread. Rust is fine but a homogeneous codebase is often better.
 
Which is bullshit, I have Intel wifi cards. FreeBSD has perfectly working drivers, and Linux still handles exact same wifi hardware better than FreeBSD. How come the wpa_supplicant is uncooperative even with drivers that are well-known to work? Maybe it's not the drivers?

The problems I've been having only crops up when I switch wifi hotspots. The wifi driver can work fine - once I force wpa_supplicant to cooperate with the details of the new hotspot. And this is a chore that requires a Computer Science degree and a few hours of research on my Android phone every time.

We are waiting on our Linux abstraction layer to be finished for iwlwifi(4), so we can use the same drivers written by Intel (for Linux). We are ~75% there. Rewriting it in Rust we are 0% there ;)
So, what's the holdup if we're 75% of the way there?

BTW, I did read the mailing list, and have seen rebuttals.

And it has me thinking, if C is a Turing-complete language (meaning code can be written to implement any algorithm in C), why are devs saying that some things are impossible in C?

Well, consider the Towers of Hanoi puzzle. In Ruby (which is also Turing-complete, just like Rust and C), it's a one-liner if you know how to write it. In C, it's a couple dozen LOC.
 
I have Intel wifi cards. FreeBSD has perfectly working drivers, and Linux still handles exact same wifi hardware better than FreeBSD.
No it doesn't. They don't support AC or (in many cases) roaming... You just said earlier in the thread! You do understand that a driver can "work well" but still not support every feature of the hardware correctly right? They do lack a few features, some of which you are clearly running into and blaming the wrong part of the operating system.

How come the wpa_supplicant is uncooperative even with drivers that are well-known to work? Maybe it's not the drivers?
No. Its the drivers. AC support literally isn't complete within them. Read through the code. If by uncooperative you mean other things, then see next point:

The problems I've been having only crops up when I switch wifi hotspots. The wifi driver can work fine - once I force wpa_supplicant to cooperate with the details of the new hotspot.
Since wpa_supplicant is the same tool as what is working fine with other drivers and with Linux, suggests that the roaming support from the driver layer isn't in place to notify wpa_supplicant to reassociate. Remember that wpa_supplicant is just the userland counterpart, it is only as good as the stack below it. Likely lots of the required events, interrupts, etc are not in place. Our drivers are great but not perfect and nowhere *nearly* as developed and maintained as on Linux.

So, for your roaming issue. Notice on this TODO page we have "fix roaming". Many of our drivers lack it (power management and hostap are other examples commonly lacking). No amount of tweaks in wpa_supplicant will fix that and neither will rewriting it in Rust.

And this is a chore that requires a Computer Science degree and a few hours of research on my Android phone every time.
Oh right. Just a bit more time learning about wpa_supplicant solves it. Just be glad that we aren't using Linux where IWD is probably right around the next corner and we will need to re-learn everything again. If you don't want to use the underlying tool directly, perhaps you can find a GUI that interacts with the wpa_supplicant control socket for you?

So, what's the holdup if we're 75% of the way there?
Man power. Wifi is complex and we have relatively few developers on it. Bjoerne Zeeb was taken on by the foundation to get much of it in (Intel driver layer) and was also working on the Raspberry Pi wifi driver too if I recall

Some updates from Bjoern. He has a lot to get through but work is getting done.


And it has me thinking, if C is a Turing-complete language (meaning code can be written to implement any algorithm in C), why are devs saying that some things are impossible in C?
Can you give any specifics? The only thing I can think of is that memory correctness can't be verified. Turing completeness doesn't make that a necessity.

Well, consider the Towers of Hanoi puzzle. In Ruby (which is also Turing-complete, just like Rust and C), it's a one-liner if you know how to write it. In C, it's a couple dozen LOC.
Some languages are more succinct, sure. Means very little though. Even Rust is very much a more suitable language to use in a kernel than Ruby.
 
Why do apps have to code for memory safety vs the OS doing it?
The OS can't really do it. Sure it can use the MMU hardware, mprotect(2) / detect accesses outside of the process but imagine the following:

Code:
{
  int somearray[10] = {0};
  int explode = 0;
 
  somearray[10] = 1; /* out-of-bounds write */
  /* explode is now 1! */
}

This undefined behavior the OS can't track. The out-of-bounds somearray access causing the explode variable to be set is valid as far as the OS can see (and on most platforms will work, padding / alignment issues pending).

Easy enough to fix in C++ and Rust (and C). Just use a vector/vec with checked array access (or a generics library in C). But these don't pass across language boundaries. The OS written in C and its APIs can't understand what a vector/vec is. Likewise, Python, Java and all other languages can *only* use C as the lingua franca "glue". Python can't call Rust directly. So "memory safe" languages can't interact. The only solution would be a i.e 100% Rust OS. RedoxOS is promising for this reason.
 
The OS can't really do it. Sure it can use the MMU hardware, mprotect(2) / detect accesses outside of the process but imagine the following:

Code:
{
  int somearray[10] = {0};
  int explode = 0;
 
  somearray[10] = 1; /* out-of-bounds write */
  /* explode is now 1! */
}

This undefined behavior the OS can't track. The out-of-bounds somearray access causing the explode variable to be set is valid as far as the OS can see (and on most platforms will work, padding / alignment issues pending).

Easy enough to fix in C++ and Rust (and C). Just use a vector/vec with checked array access (or a generics library in C). But these don't pass across language boundaries. The OS written in C and its APIs can't understand what a vector/vec is. Likewise, Python, Java and all other languages can *only* use C as the lingua franca "glue". Python can't call Rust directly. So "memory safe" languages can't interact. The only solution would be a i.e 100% Rust OS. RedoxOS is promising for this reason.
You realize that you have just fessed up to the shortcomings of C and the very reason that devs are considering Rust?

This is a very good, easy-to-understand explanation.

Can you give any specifics? The only thing I can think of is that memory correctness can't be verified. Turing completeness doesn't make that a necessity.
From the mailing list (Actually the very message that this thread linked to!), one of the things mentioned as "Impossible to do in C" is

* fusefs tests. Absolutely impossible to do in C. I considered Rust, but went
with C++ so they could live in base. They are too closely coupled to
fusefs(5) to live out-of-tree.
https://github.com/freebsd/freebsd-src/tree/main/tests/sys/fs/fusefs

I did read the rest of the conversation.

So, for your roaming issue. Notice on this TODO page we have "fix roaming". Many of our drivers lack it (power management and hostap are other examples commonly lacking). No amount of tweaks in wpa_supplicant will fix that and neither will rewriting it in Rust.
Yeah, I guess my issue is basically "Roaming". Isn't it the job of wpa_supplicant to automate it, like everybody else already does? Even if it's ultimately not the fault of the FreeBSD wpa_supplicant implementation, roaming is an important aspect of wifi usage at all, and does deserve to be automated.
 
Back
Top