←back to thread

Eurydice: a Rust to C compiler

(jonathan.protzenko.fr)
185 points todsacerdoti | 2 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 #
gritzko ◴[] No.46180446[source]
Correct me if I am wrong, but C is the “greatest common denominator” for several decades already. Java, .NET, go, Rust are very much ecosystems-in-themselves. From the practical standpoint, they can not use each other’s code, but they all can use C libs.
replies(1): >>46180833 #
flohofwoe ◴[] No.46180833[source]
Technically it's only the C API that's important, the implementation behind the C API can be written in any language. The downside is though that you still need a language toolchains X, Y, Z to compile the implementations. Transpiling everything to C removes that one dimension from the build process.
replies(1): >>46181206 #
VBprogrammer ◴[] No.46181206{3}[source]
Zig has been in the news a lot recently but I haven't explored it much other than a few tech talks which seemed interesting.

I wonder if this is it's killer feature - compatibility with the C ABI.

replies(1): >>46181398 #
1. flohofwoe ◴[] No.46181398{4}[source]
> compatibility with the C ABI

Almost all non-C language offer that feature. The additional thing of the Zig toolchain is that it can also compile C/C++/ObjC projects without requiring a separate compiler toolchain, e.g. the Zig compiler toolchain is also a complete C/C++ compiler toolchain.

replies(1): >>46181559 #
2. VBprogrammer ◴[] No.46181559[source]
Almost all languages provide a method of calling C generated code for sure. But, as I understand it, this is usually a more tortuous path than straight ABI compatibility.