Remix.run Logo
▲ tialaramex 11 hours ago

> Because C is very simple (unlike Rust) and works everywhere

That's definitely true. C is a "Worse is better" language and as such it's everywhere. You can knock together a halfway usable C for some crap hardware in a few weeks and then the hardware is saleable because there's a C implementation.

> You can easily take a project from 2 decades ago and port it to a current platform.

Much of the software I wrote two decades ago in C won't even build today. Good luck figuring out why, periodically I try to figure out which weird 2000s era Mac OS hacks don't like a 2026 Linux system and eventually I give up and write modern software instead.

In theory C written in 2006 definitely "just works" on a 2026 Linux machine but in practice real world C is broken and even though I (co)wrote it I don't know why. Also in practice the first serious Rust project I wrote in 2021 I just found it, checked out the oldest working version ("first rough working code" says the log) from git, cargo run, works as expected.

Maybe it's because the C was four times older, but I think it's because in the real world you don't end up writing that mythical portable C code too often.

▲lelanthran an hour ago | parent | next [-]

> Maybe it's because the C was four times older, but I think it's because in the real world you don't end up writing that mythical portable C code too often.

It's because C, over time, went from a bunch of almost compatible implementations, to a standard that differed a little from every existing implementation, to a standard that is updated every decade or so, which is then implemented by a bunch of different products, with enough ambiguity in the standard (UB) that there will be differences between compilers and versions of compilers.

Rust is a single implementation. Always has been.

It's a single product, so you code to the product. The product has no external forcing function, like a language standard, that produces changes every decade. When you write Rust, you aren't thinking "Wait, lets make sure this works on the Watcom compiler too".

If Rust code cannot compile 30 years later, that's a failure on the language, because the single implementation is in full control of compatibility. If C code cannot compile 30 years later, that's not a failure of the language, because the implementation in 30 years has had external pressure forcing changes.

People often forget that Rust is a product, C is a specification.

▲fastaguy88 5 hours ago | parent | prev [-]

I have 'C' code that was written in 1985 that runs today, mostly after moving function parameters from inside the function to inside the argument list.

'C' seems to be a language that makes it easy to write incomprehensible statements, but it's not that hard (or it was not that hard) to write code that is trivial bring up to date. Perhaps it was easier for me because I started with Fortran.

▲fithisux 2 hours ago | parent [-]

Very common.