←back to thread

Eurydice: a Rust to C compiler

(jonathan.protzenko.fr)
185 points todsacerdoti | 4 comments | | HN request time: 0s | source
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 #
uecker ◴[] No.46180421[source]
I plan to be writing C for the next decades even for new projects, because I think it is a great language, and I appreciate its simplicity, fast compilation times, stability, and portability.

I am happy if people are excited about Rust, but I do not like it too much myself. Although I acknowledge that it contains good ideas, it also has many aspects I find problematic and which why I do not think we should all switch to it as a replacement for C.

replies(1): >>46180796 #
kace91 ◴[] No.46180796{3}[source]
>it also has many aspects I find problematic

Could you share those?

Not trying to argue, just curious on the perspective of a C veteran, as someone who’s just starting with lower level languages.

replies(2): >>46181009 #>>46183301 #
1. ahartmetz ◴[] No.46183301{4}[source]
C strings (it's almost an exaggeration to say that C has strings) and "just never make any mistakes bro" based memory management come to mind.
replies(2): >>46184971 #>>46185207 #
2. uecker ◴[] No.46184971[source]
We were talking about Rust issues. But yes, C should have a proper string type. But as long as it does not have a better standardized string type, it is possible to define your own (or use a library).
replies(1): >>46185283 #
3. drnick1 ◴[] No.46185207[source]
With LLMs becoming so good at coding, "just never make any mistake" is also becoming easier. I usually write my own code because I don't like the coding style of LLMs, but on more than one occasion now they have proven very useful as code reviewers and bug hunters.
4. ahartmetz ◴[] No.46185283[source]
Absolutely. Even when I preferred C over C++ (a long time ago), it was "but with a string library".