3 ms·
> But how would you link a library written in Rust to a Virgil program? Or vice versa? Sounds like that's Rust's problem, or maybe Virgil's? Why is it C's prob
by Turing_Machine 5y ago
> But how would you link a library written in Rust to a Virgil program? Or vice versa?
Sounds like that's Rust's problem, or maybe Virgil's? Why is it C's problem?
If Rust is going to "replace C" for systems work, as the more grandiose claims would have it, it's going to have to replace all of C.
It's not like writing a POSIX-like system is that hard. It's a lot of work, sure, but it's been done multiple times, by unpaid volunteers at that.
This complaint basically boils down to "We can't/won't/haven't reimplemented this low-level stuff in our whizzy new language, and that's somehow C's fault".
- valleyer 5y agoYour argument reads like: you shouldn't need to run Rust programs unless _the entire operating system_ is first rewritten in Rust. I doubt you really mean that, though...
- Turing_Machine 5y agoNo. More like "You shouldn't whine about the C infrastructure unless you're planning to replace it with something better."
- kaba0 5y agoC is only used for FFI because it provides a well-defined, stable interface for function calls that can be easily implemented by another language.
- hoseja 5y agoThe article argues against every word of this statement.
- Turing_Machine 5y agoThe article is wrong.
- dzaima 5y agoC definitely doesn't provide a well-defined stable interface. Specific ABI definitions might, but there are 176 of those, and implementing all of those in another language is decidedly not what I'd call "easy".
- Turing_Machine 5y agoIt's been done multiple times, by small teams of unpaid volunteers. "Easy"? Depends on your definition of "easy". Doable? Absolutely. But complaining won't get it done.
- dzaima 5y agoIn most cases, I'd think those small teams support like a max of 5 ABIs, out of the 176. Of course it's "possible". Of course, complaining about it won't get it done. But I can easily envision an alternate universe with the same OS & CPU architecture variety, that has the effort required for doing this be ten times smaller, and I don't see it being utterly pointless to ponder the viability of that if only just for fun (which the swearing in the article hints to me it is). I, as an author of a small language implementation, would really prefer to not need to implement more than one C FFI ABI, much less 176. I'd meet somewhere in the middle, but 176? nah.
- thatsnotc 5y agoC provides an API, not an ABI. The compiler provides a mapping from the stable, (relatively) portable, well-defined API -> the unstable, non-portable, ill-defined ABI of the host system.
- ansible 5y ago> If Rust is going to "replace C" for systems work, as the more grandiose claims would have it, it's going to have to replace all of C. ... and people complain all the time about Rust fanatics talking about rewriting everything in Rust.
- Turing_Machine 5y agoYeah, they do talk about that a lot. They talk a lot about a lot of things. They just don't ever do any of them.