Earlier quoted context omitted.
It is not terribly hard to generate C code that does not use undefined behavior.
Maybe. But when carefully investigated, the overwhelming majority of C code does in fact use undefined behaviour, and there is no practical way to verify that any given code doesn't.
Rust to C compiler – 95.9% test pass rate, odd platforms
231–240 of 264 posts
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#232Earlier quoted context omitted.
It is, but it is still tiny compared to C/C++. And many people also do not like it.
There are two categories of people who don’t like Rust: 1. C/C++ developers who are used to C/C++ and don’t want to learn Rust. 2. Go developers who claim Rust is too difficult and unreadable. Which one is you?
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#233Earlier quoted context omitted.
Fair point on CSRs, though I'd count that as a subset of unsupported/not-yet-specified instructions; pretty sure all of the "reserved"s in the spec are effectively not-yet-defined instructions too, which'll have equivalents in any architecture with encoding space left for future extensions, not at all unique to RISC-V. But yeah, no try-running-potentially-unsupported-things-to-discover-what-is-supported; essentially…
Yeah I guess the difference is once an instruction/CSR has been defined in x86 or ARM the only two options are a) it doesn't exist, and b) it's that instruction. In RISC-V it can be anything even after it has been defined. Actually... I say that, but they do actually reserve spaces in the CSR and opcode maps specifically for custom extensions so in theory they could say it's only undefined behaviour in those spaces a…
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#234Earlier quoted context omitted.
It really is not that complicated. You just use -llibrary when linking and it links.
Oh I never realized I was supposed to install -dev packages, I thought I had to compile myself.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#235Earlier quoted context omitted.
Are you unable to use search engines: https://www.learn-c.org/ There are so many free learning resources for these languages that it is ridiculous to say that you need books to learn them. The books are great, but non-essential. If you insist on reading books, there is an ancient invention called a library that you can use for free.
What C standard does that website describe?
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#236Earlier quoted context omitted.
Are you unable to use search engines: https://www.learn-c.org/ There are so many free learning resources for these languages that it is ridiculous to say that you need books to learn them. The books are great, but non-essential. If you insist on reading books, there is an ancient invention called a library that you can use for free.
What C standard does that website describe?
The main exceptions that you actually would want to use would be the ability to declare variables anywhere in a block and use single line // comments from C++ in C99. Most C programmers do not even know about most of the things added in newer C standards beyond those and perhaps a handful of others.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#237Earlier quoted context omitted.
I was not asking for that. I was answering your question. You asked for evidence of rust releases being abandonware. I gave it to you. Someone else trying to ameliorate Rust releases does not change this reality.
Well “abandonware” is a strange way to call that because nothing is actually abandoned.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#238Earlier quoted context omitted.
C and C++ are two different languages. They are versioned by years. Rust technically does not have versions. The rust tools have versions. Basically all versions of C are binary compatible with each other. I suggest you actually learn and use C rather than asking questions since you are never going to ask the right things to understand how it works without having firsthand experience.
> C and C++ are two different languages. They are versioned by years. That sounds like Rust editions.
The only reason you see people grouping the two languages together is due to history. They are both derivatives of an ancient prestandard form of C called K&R C. They both have different standards committees who had different ideas about how to move forward from K&R C. The result is that C compilers were extended to support both, and that extension continues to this day despite the divergence between the two languages. The C standards committee accepted some of the changes the C++ committee made to K&R C, although the C++ standards committee does not reciprocate by accepting changes made by the C standards committee. This is making them increasingly different languages.
Try to spend time learning how other things work instead of posting replies that attempt to reinterpret everything people tell you through a Rust lens whenever someone is kind enough to answer your questions like you are doing here. It is like asking people how Chinese works and then telling them “English does it this way”. The “nothing matters but ” mentality that causes that is going to annoy a large number of people from whom you would otherwise be able to learn.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#239Earlier quoted context omitted.
Do a web search for rdrand and systemd.
> Do a web search for rdrand and systemd. RDRAND always returning all-FF is exactly the kind of thing that's an obvious bug, not a plausible-but-wrong result.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#240Earlier quoted context omitted.
> edit2: networking, signal processing, automotive, learning about industry protocols and devices of any sort... I admit there is many great products that are written in C that aren’t going anywhere any time soon, notably SQLite, but there is no reason to write new software in C or C++.
There's tools that can prove the absence of runtime errors in industrially-useful subsets of C. Frama-C, RV-Match, and Meta's Infer come to mind. That code is then usable in about anything because so much of it is written in or can call C. Until Rust has that combo, there's still a reason to use C. Personally, I'd use both Rust and C with equivalent code. The Rust types and borrow checker give some extra assurance th…
https://www.absint.com/astree/index.htm
By the way, C has a formally verified C compiler: