Live data from Hacker News

Rust to C compiler – 95.9% test pass rate, odd platforms

fractalfir.github.io

211–220 of 264 posts

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#211
post #204

Earlier quoted context omitted.

Decades ols books in C most certainly is even useful in modern C++23 because you need to interact with other libraries written in C89. When a lot of modern CS concepts wwre first discovered and studied in the 70s, there's no point arguing that old books are useless. Honestly there may be sections of old books that are useless but in the whole they are still useful.

We're talking about learning C/C++ from scratch which makes no sense to do by using a decades old book because it wouldn't teach you any modern features. Also we're not talking about computer science.

You do not need to know about modern features to write code in C. This is part of computer science.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#212
post #190

Earlier quoted context omitted.

My copy of The C++ Programming Language for C++98 is still useful today, as is copy of The C Programming Language for C89. The idea that these books are no longer useful is absurd. Modern compilers still support those versions and the new versions are largely extensions of the old (although C++11 changed some standard library definitions). The only way you could think this is if you have zero knowledge of these langu…

> The only way you could think this is if you have zero knowledge of these languages. Exactly. For context see my original comment above about C/C++ books being paid.

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.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#213
post #193

Earlier quoted context omitted.

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?

I know a guy who used to love Rust and his cannot stand it. The hype wore off in his case.

Autocorrect seems to have made a typo worse here. It was supposed to be now, not his.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#214
post #188

Earlier quoted context omitted.

https://endoflife.date/rust

Are you asking for LTS releases? https://ferrocene.dev/en/

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.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#215
post #135

Earlier quoted context omitted.

Not true on RISC-V. That's full of undefined behaviour. But anyway this is kind of off-topic. I think OutOfHere was imagining that this somehow skips the type checking and borrow checking steps which of course it doesn't.

What's all that undefined behavior? Closest I can think of is executing unsupported instructions, but you have to mess up pretty hard for that to happen, and you're not gonna get predictable behavior here anyway (and sane hardware will trap of course; and executing random memory as instructions is effectively UB on any architecture). (there's a good bit of unpredictable behavior (RVV tail-agnostic elements, specific…

Accessing non-existent CSRs is another big one, which also means you can't probe for features.

There's loads more though. Just search for "reserved" in the ISA manual.

Of course a Rust to C compiler is not going to hit any of these. I was just pointing them out.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#216
post #135

Earlier quoted context omitted.

What's all that undefined behavior? Closest I can think of is executing unsupported instructions, but you have to mess up pretty hard for that to happen, and you're not gonna get predictable behavior here anyway (and sane hardware will trap of course; and executing random memory as instructions is effectively UB on any architecture). (there's a good bit of unpredictable behavior (RVV tail-agnostic elements, specific…

Accessing non-existent CSRs is another big one, which also means you can't probe for features. There's loads more though. Just search for "reserved" in the ISA manual. Of course a Rust to C compiler is not going to hit any of these. I was just pointing them out.

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 a necessary property for an open ISA as there's nothing preventing a vendor from adding random custom garbage in encoding space they don't use.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#217
post #74

I am still waiting for any of the alternative Rust front- or backends to allow me to bootstrap Rust on alpha, hppa, m68k and sh4 which are still lacking Rust support. Originally, the rustc_codegen_gcc project made this promise but never fulfilled it.

> to allow me to bootstrap Rust on alpha, hppa, m68k and sh4 Do you actually use all four of those platforms, or is this an arbitrary threshold for what you consider a complete set of platform support?

I am actively maintaining all of these within Debian.

Plus, there is a very vibrant community around the Motorola 68000 and SuperH CPUs thanks to the Amiga, Sega Dreamcast and many other classical computer systems and consoles.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#218

Earlier quoted context omitted.

They're still common (except for alpha) platforms in some market segment specific corners of embedded development. So, maybe for those purposes? Though, the trend I'm seeing a lot of is greenfield projects just migrating their MCUs to ARM.

> Though, the trend I'm seeing a lot of is greenfield projects just migrating their MCUs to ARM. That’s what I would expect, too. The Venn diagram of projects using an old architecture like alpha but also wanting to adopt a new programming language is nearly two separate circles. The parent comment even included HPPA (PA-RISC) which almost makes me think they’re into either retro computing or they have some arbitrary…

> The parent comment even included HPPA (PA-RISC) which almost makes me think they’re into either retro computing or they have some arbitrary completionist goal of covering all platforms.

Yes, retro-computing is a thing. Wouldn't it be nice to have Rust support on these platforms as well?

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#219
post #120
post #74

I am still waiting for any of the alternative Rust front- or backends to allow me to bootstrap Rust on alpha, hppa, m68k and sh4 which are still lacking Rust support. Originally, the rustc_codegen_gcc project made this promise but never fulfilled it.

"m68k-unknown-linux-gnu" was merged as a Tier-3 target for Rust, wasn't it? [0] [0] https://github.com/rust-lang/compiler-team/issues/458

Yes, it was me that did the work on the Rust side. It doesn't work yet though as progress on the LLVM side is very slow.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#220
post #74

I am still waiting for any of the alternative Rust front- or backends to allow me to bootstrap Rust on alpha, hppa, m68k and sh4 which are still lacking Rust support. Originally, the rustc_codegen_gcc project made this promise but never fulfilled it.

Did they abandon that goal? Last I heard it was still under development.

Well, the promise was that rustc_codegen_gcc would reach its goals very quickly which is why several people dismissed projects such as gccrs.

But it turns out that rustc_codegen_gcc still hasn't delivered and it seems the project has fallen asleep.

Post reply on HN