News for hackers. Stuff that matters.
Re:Announcing Rust 1.20 by burntsushi on Thursday August 31, 2017 @07:18PM (#15144828)
To clarify, Rust has its own ABI, just like C++ has its own ABI. And just like C++, you can expose a C ABI if you want by defining special functions. In C++, it's an `extern "C" { ... }` block, and in Rust, it's a `extern "C" fn foo() ...` function declaration. You can see an example here: https://github.com/rust-lang/regex/tree/master/regex-capi

Adding C++ ABI support is a significant effort.

Re:Announcing Rust 1.20 by oscargrouch on Friday September 01, 2017 @05:23AM (#15147138)
> To clarify, Rust has its own ABI, just like C++ has its own ABI. And just like C++, you can expose a C ABI if you want by defining special functions. In C++, it's an `extern "C" { ... }` block, and in Rust, it's a `extern "C" fn foo() ...` function declaration.

Ohh, Now i got it. But its pretty good thing to have anyway. C ABI is the lingua franca anyway to communicate to any language, even C++.

> Adding C++ ABI support is a significant effort.

Ok. So if has its own ABI, im sure it would be a pretty hard undertaking to be compatible with C++.

I was guessing if maybe Rust had managed to squeeze and reuse the C++ ABI.. but sure, giving Rust is not that much alike C++ this would probably be a bad decision for small gains.

Thanks for clarifying.