Live data from Hacker News

GCC Rust Approved by GCC Steering Committee

gcc.gnu.org

121–130 of 300 posts

Re: GCC Rust Approved by GCC Steering Committee

#121
post #88

Earlier quoted context omitted.

Right, but what about "free as in beer"?

If I buy you a beer, that's free beer for you.

Which, unless you're my friend, prompts the questions "what else is in this beer" and "what's in it for you." I believe that to be a deliberate choice in the "free as in beer" analogy.

Re: GCC Rust Approved by GCC Steering Committee

#123
post #80
post #72

Earlier quoted context omitted.

Yes, hence having its own column on cppreference, or a special flavour of bitcode for watchOS. In what concerns Apple, I think they mostly care about the C++ support needed to keep LLVM going, the C++14 based dialect for Metal Shading Language, and the subset used across IO and DriverKit. For everything else there is Objective-C and Swift. Then Google apparently drop off clang after the ABI break votes didn't went th…

Yep, the perma-frozen ABI decision sounded the death-knell for C++. Basically the committee committed collective hara-kiri with that decision. Thou Shalt Not Progress! It's so extraordinarily, mind-bogglingly stupid. But I guess it is time for the ageing C++ queen to pushed out of the mortal coil and let Princess Rust grab her long-overdue system crown.

Princess Rust has no proper throne on the kingdom of binary libraries.

Re: GCC Rust Approved by GCC Steering Committee

#124

What is the benefit of having multiple compilers for programming languages? Is there a scenario where a GCC compiled rust program would do something that an LLVM one can't do? Doesn't this cause fragmentation in the rust ecosystem? P.S.:I understand that people can work on any project they want. And I don't have the right to tell them not to. I'm just curious about the technical reasons for having multiple compilers.

There's also political/legal considerations: The modern GCC codebase is derived from the egcs codebase, which forked off the original GCC codebase because the developers of GCC at that time didn't want to prioritize faster development speed:

https://gcc.gnu.org/wiki/History

Thus, a new strain of development can attract people who want to do things differently, and reduce tensions all around.

On the legal front, it's unlikely, but sometimes there's legal problems with continuing to use a certain codebase.

Re: GCC Rust Approved by GCC Steering Committee

#125
post #6

Earlier quoted context omitted.

Multiple implementations of a standard help shine light into dark corners.

Indeed, but I think they should first create a standard?

Having another implementation first actually helps create a good standard, by highlighting things that are implementation-specific assumptions.

Re: GCC Rust Approved by GCC Steering Committee

#126
post #65

Earlier quoted context omitted.

Rust already has stable standards. There's Rust editions 2015 (1.0), 2018 (1.31.0), and 2021 (1.56.0).

Unfortunately that's not quite the same thing as a standard in the sense that is meant here. A 'standard' is a written document that explains how the language should work. A standard that just says "the compiler is correct if it compiles code the way that rustc 1.xy does" is technically unambiguous in that it provides a procedure by which a compiler author can check their work, but leaves quite a bit on the table and…

Correct.

With an ideal standard document that describes the language, someone could build a compiler for the language from scratch and it should behave correctly. See https://en.wikipedia.org/wiki/Programming_language_specifica...

Some example standards:

C: https://www.open-std.org/jtc1/sc22/wg14/

ECMAScript (Javascript): https://tc39.es/ecma262/

C++: https://isocpp.org/std/the-standard

Scheme: https://schemers.org/Documents/Standards/

Ada: http://www.ada-auth.org/standards/ada12_w_tc1.html

For Rust, Ferrous Systems is working on the Ferrocene Language Specification to formally document the Rust subset that Ferrocene will use.

https://ferrous-systems.com/blog/ferrocene-language-specific...

https://ferrous-systems.com/ferrocene/

Re: GCC Rust Approved by GCC Steering Committee

#127
post #103

What is the benefit of having multiple compilers for programming languages? Is there a scenario where a GCC compiled rust program would do something that an LLVM one can't do? Doesn't this cause fragmentation in the rust ecosystem? P.S.:I understand that people can work on any project they want. And I don't have the right to tell them not to. I'm just curious about the technical reasons for having multiple compilers.

Doesn't GCC support more architectures than LLVM? Wasn't that the issue a while back with the Rust dependency that a cryptography module for Python introduced?

Adding a GCC backend for Rust (rust-codegen-gcc) does this already. I do not personally see the point of writing another frontend in C++.

Re: GCC Rust Approved by GCC Steering Committee

#129
post #99

Earlier quoted context omitted.

How “old” are we talking about here? Multiple language front ends sharing a common IR is a concept that dates to the 50s: https://academic.oup.com/comjnl/article/22/3/226/408542 (click through to the pdf)

Your link does not work

Thanks. Fixed. (It's not my fault young people broke direct linking on the web.)

Re: GCC Rust Approved by GCC Steering Committee

#130

Earlier quoted context omitted.

One advantage is it forces the language to articulate standards instead of the implementation defining the feature set. Standards tend to give stability and longevity to the language, as well as making it possible to write new compilers and make it more portable.

That sounds a little circular. The benefit of alternate compilers is that it makes making alternate compilers easier. For stability compilers already have a large incentive not to break old programs. For longevity I don't really see how a standard affects it that much. For being more portable you do not need an entirely knew compiler.

Being able to specify a language outside an implementation is extremely useful to prevent hidden logical inconsistencies between different parts of the language, and makes the language more robust.

It also allows people to design new backends (looking at CUDA LLVM backends)by finding out the right abstraction to support performance. For example, implementing a C or C++ compatible CUDA backend required the C++ committee to make changes to the memory model / consistency guarantees of C++ atomics. If C or C++ had only depended on compiler implementation for it, then there would have just been different implementations with different guarantees with no consistencies between them, and no single way to even define why they were different.

Post reply on HN