News for hackers. Stuff that matters.
Re:GCC Rust Approved by GCC Steering Committee by ithkuil on Monday July 11, 2022 @02:42PM (#32060028)
Why do libraries not work across compilers of the compilers are implementing a standard? Are they perhaps not really implementing a standard?
Re:GCC Rust Approved by GCC Steering Committee by steveklabnik on Monday July 11, 2022 @02:47PM (#32060101)
Simply having a document called "a standard" doesn't mean that:

1. the standard covers everything you wished it would cover

2. every implementation implements the standard, with no bugs

3. the standard doesn't itself contain incoherent or contradictory things

Standards are a tool, not magic interoperability sauce.

Re:GCC Rust Approved by GCC Steering Committee by pjmlp on Monday July 11, 2022 @06:14PM (#32062738)
Hence the existence of standard certification for compilers as business.
Re:GCC Rust Approved by GCC Steering Committee by tialaramex on Monday July 11, 2022 @07:45PM (#32063700)
Like the Goldman Rep says in The Big Short, "If you offer us free money, we ARE going to take it..."
Re:GCC Rust Approved by GCC Steering Committee by pjmlp on Tuesday July 12, 2022 @01:08AM (#32065868)
I bet Ferrocene will also happily take part of that money.
Re:GCC Rust Approved by GCC Steering Committee by FrankHB on Wednesday July 13, 2022 @06:15AM (#32080761)
There are simply lacking of such strong requirements in language standards. C/C++ even have the specific "linkage" concept to abstract the binary details under the source form away. And you may know, many libraries are distributed by binaries.

The standards implying binary compatibility rules are about ABI (application binary interface), which usually depend on the ISA (instruction-set architecture) or the OS (if any) being used. You cannot have the unique one once there are multiple ISAs/OSes supported. Even when you only want to rely on some external "exchanging" representations not tied to specific ISAs, there are already plenty of candidates: CLI, JVM, WebAssembly... Plus there are more than one executable (and mostly, runtime loadable) image formats widely used (PE/COFF, ELF, Mach-O ...). You will not have the unique combination, and any attempts to ensure it "work across compilers" in that way will likely finally just add a new instance not fully compatible to existing ones, making it more fragile.

Re:GCC Rust Approved by GCC Steering Committee by nickitolas on Tuesday July 12, 2022 @10:01AM (#32070078)
Standards are often incomplete, or full of "implementation specific" behaviour, since AIUI standards often end up catering to implementations, instead of the other way around (For example C/C++ standards, you can read a plethora of blog posts about the experience of people trying to contribute to them, and some of the hurdles are related to how strongly tied to existing implementations they are). That means you can often have 2 "standards compliant" compilers that are wildly different. Another reason is compiler extensions. Sometimes a compiler is "standards compliant", but also implements a superset of the standard (Sometimes by default, sometimes under a flag) which means code gets written for that "superset" instead of according to a "standard" (for example, the linux kernel and gcc extensions to C).
Re:GCC Rust Approved by GCC Steering Committee by jcranmer on Monday July 11, 2022 @08:16PM (#32063958)
Typically, some library features contain things that require cooperation with a specific compiler to work correctly. Consider something like std::is_standard_layout in C++, or java.lang.Object in Java, or std::panic::catch_unwind in Rust.
Re:GCC Rust Approved by GCC Steering Committee by sicp-enjoyer on Monday July 11, 2022 @04:12PM (#32061166)
They typically do, unless they are wrapping C libraries or making platform specific API calls.