←back to thread

Eurydice: a Rust to C compiler

(jonathan.protzenko.fr)
185 points todsacerdoti | 6 comments | | HN request time: 0s | 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 #
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 #
1. 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 #
2. uecker ◴[] No.46181009[source]
Mostly the advantages a listed for C: stability, portability, simplicity, fast compilation times could all in reverse also be considered disadvantages of Rust. I am also not a fan of monomorphization, not of static linking, and not of having many dependencies out of a large uncurated pile of many projects. I also think Rust is not pragmatic enough. Overall though, my main issue is complexity of the language which I think goes in the wrong direction - this may be ok if the alternative is C++, but if you prefer C to C++ then Rust is equally unappealing. At the same time I think the advantages of Rust are exaggerated. I still agree memory safety is important, I just think Rust is not an ideal approach.
3. ahartmetz ◴[] No.46183301[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 #
4. 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 #
5. 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.
6. ahartmetz ◴[] No.46185283{3}[source]
Absolutely. Even when I preferred C over C++ (a long time ago), it was "but with a string library".