←back to thread

Eurydice: a Rust to C compiler

(jonathan.protzenko.fr)
185 points todsacerdoti | 9 comments | | HN request time: 0.018s | source | bottom
Show context
apitman ◴[] No.46179418[source]
I use Rust and C at work. I quite enjoy Rust, but I currently have no reason to believe C won't outlive it, by a lot.
replies(8): >>46179466 #>>46179713 #>>46179716 #>>46179780 #>>46180057 #>>46180446 #>>46183271 #>>46183498 #
mustache_kimono ◴[] No.46179780[source]
> I currently have no reason to believe C won't outlive it, by a lot.

My reaction is kind of: "So what?" I really don't care about the relative lives of languages and don't really understand why anyone would. Unless I am wrong, there is still lots of COBOL we wish wasn't COBOL? And that reality doesn't sound like a celebration of COBOL?

IMHO it would be completely amazing if magically something 10x better than Rust came along tomorrow, and I'd bet most Rust people would agree. Death should be welcomed after a well lived life.

To me, the more interesting question is -- what if efforts like c2rust, Eurydice, TRACTOR and/or LLMs make translations more automatic and idiomatic? Maybe C will exist, but no one will be "writing" C in 20 years? Perhaps C persists like the COBOL zombie? Perhaps this zombification is a fate worse than death? Perhaps C becomes like Latin. Something students loath and are completely bored with, but are forced to learn simply as the ancient interface language for the next millennia.

Is that winning? I'd much rather people were excited about tech/a language/a business/vibrant community, than, whatever it is, simply persisted, and sometimes I wish certain C people could see that.

replies(7): >>46179997 #>>46180024 #>>46180421 #>>46180840 #>>46181102 #>>46183027 #>>46184629 #
1. flohofwoe ◴[] No.46180840[source]
I bet that C won't just be around for legacy projects, but also for writing new code for at least the next 30 years.
replies(1): >>46180883 #
2. krapp ◴[] No.46180883[source]
C will end when our entire technological civilization collapses and has to start over from scratch and even then after a century of progress they will invent C again.
replies(1): >>46180933 #
3. Ar-Curunir ◴[] No.46180933[source]
Hopefully not. C is a bad language even for the standard of the times it was invented in.
replies(3): >>46181248 #>>46181497 #>>46183109 #
4. VBprogrammer ◴[] No.46181248{3}[source]
I haven't ever had to do anything serious in C but it's hard to imagine getting it 100% right.

A while back I wrote some C code to do the "short-bread" problem (it's a bit of a tradition at work to give it to people as their first task, though in Python it's a lot easier). Implementing a deque using all of the modern guard rails and a single file unit test framework still took me a lot of attempts.

5. flohofwoe ◴[] No.46181497{3}[source]
C isn't a bad language per-se, it just doesn't have an opinion on most things and I think that's exactly the reason why it survived many higher level (and more opinionated) languages that also already existed when C was created.
replies(1): >>46182970 #
6. uecker ◴[] No.46182970{4}[source]
This is exactly right. The trend is towards comprehensive programming frameworks for convenient programming with batteries included. I hope this trend dies and we focus more on integration into the overall ecosystem again.
7. baq ◴[] No.46183109{3}[source]
C was great... for the PDP-11.

Nowadays, not so much. Computers are multiple orders of magnitude faster, have multiple orders of magnitude more memory and storage and do things multiple orders of magnitude more complex than they used to. Portable assembly still has its uses obviously, but safer/easier/faster alternatives exist in all its niches.

replies(2): >>46183785 #>>46185222 #
8. flohofwoe ◴[] No.46183785{4}[source]
> Portable assembly still has its uses obviously

C is much closer to any other high level language than it is to assembly. 'Portable assembly' might have been true with trivial C compilers of the 70s and 80s, but not with compilers like gcc or clang.

9. drnick1 ◴[] No.46185222{4}[source]
> Computers are multiple orders of magnitude faster, have multiple orders of magnitude more memory and storage

And C is still the best way to talk to the hardware in a portable way.