Hacker News new | ask | show | jobs
by hardware2win 1280 days ago
>We need competition

There is - between langs.

Compiler engineers can use ideas from other lang's compilers.

C# e.g

1 comments

I think having a GPL implementation of a language makes it more future proof. I don't want to be able compile some source only with "rustc-v_ancient-company_name-internal_fork-no_you_cant_have_its_source" version.

Programming languages with single compilers tend to be not used in my area of work and research (HPC and Scientific Computing). Hence, I'd rather have multiple compatible, yet independently implemented compilers, per language.

> I don't want to be able compile some source only with "rustc-v_ancient-company_name-internal_fork-no_you_cant_have_its_source" version.

Yeah, it's not like Google (and dozens of others) has/have an internal fork of Linux, which never gets merged back. I'm not certain the GPL butters any parsnips here.

> Hence, I'd rather have multiple compatible, yet independently implemented compilers, per language.

You identified it. The problem is compatibility, and again Linux is a good negative example where ostensibly we have a language spec and multiple compilers, but Linux for years would only compile on one compiler.

Multiple compilers and "competition" doesn't solve compatibility. It makes it more difficult. Although I'm sure there will be benefits, I'm not certain the GPL/GCC will make compatibility any easier. It hasn't so far.

> Yeah, it's not like Google (and dozens of others) has an internal fork of Linux...

Doesn't matter for completely internal stuff. My concern is public code requiring non-public toolchains to compile. I have experienced this enough during the decades. I don't want to fight with this again.

Google doesn't want to touch Linux for their devices anymore, so they're building Fuchsia, but let's not digress...

> Multiple compilers and "competition" doesn't solve compatibility. It makes it more difficult. Although I'm sure there will be benefits, I'm not certain GPL will make compatibility easier. It hasn't so far.

What GPL brings to the table is strict openness, not compatibility. I can share my code and say that "It builds right on this $GPLd_Compiler", and people can get it and build it. This is what I like to bring to the table for anything I release.

I also wonder whether people would be this reactive to this issue if $company announced a closed source compiler with strict rustc compatibility.

> What GPL brings to the table is strict openness, not compatibility.

I kinda wonder where this has been an issue with LLVM re: non-public toolchains, and public code where it wouldn't also be an issue with GCC. FWIW I definitely could see it being an issue in HPC/graphics/ML.

> I also wonder whether people would be this reactive to this issue if $company announced a closed source compiler with strict rustc compatibility.

Call me dense -- I guess I don't understand precisely what you're getting at. I don't think anyone would use a closed source compiler with strict rustc compatibility without a pretty big carrot. I think the issue here is strictly compatibility/divergence. Although I'm personally less of a fan of GCC/GPL/FSF, I think a new compiler is great so long as it doesn't (completely) ruin some of the nice things about a single implementation system, and why rust_codegen_gcc seems much more appealing.

Many Rust people don't want to live in the C/C++ compiler world, because they don't have to. "Oops this code won't build with GCC" is a battle they'd just as soon avoid.

In the past I have downloaded kernel modules & SDKs for Linux, which were partially open (i.e. had binaries, compiled libraries, etc. alongside open parts), and they were intentionally compiled for highly specific environments, tying the modules or SDKs to (archaic) OS releases which are very hard to obtain, or cannot be obtained from anyone except the hardware vendor.

We wanted to use these thing in newer systems, but it was not always possible, and made our lives way harder than it should be. At the end of the day, you buy vendor's hardware and want to couple it with more modern software, but the vendor doesn't want this for some unknown reason. Planned obsolescence, maybe.

Now, consider that a company pulls the same shenanigans, but by moving the magic to the compiler. All source is open, but can't be compiled because, while the code valid, its correct compilation needs a specific compiler behavior, and the vendor who opened the source cannot share the compiler in source form due to "trade secrets". They may require you to send the code in to "make sure that it's fine", or "sign an agreement" to get the compiler, for a fee, maybe.

I don't want to live in this world, or leave anyone accidentally in that state.

> Many Rust people don't want to live in the C/C++ compiler world, because they don't have to. "Oops this code won't build with GCC" is a battle they'd just as soon avoid.

As someone else noted, gccrs people say that "We strive for rustc compatibility. We will not extend or mangle the language, and consider rustc as our test suite." This is a pretty strong commitment to "many implementations, single behavior" promise.

I started my computing journey in a very open and flexible ecosystem, and with every stopgap put as in the name of security, this openness and flexibility eroded step by step. With this pace, programming and development will be confined to corporations which design the hardware and OS running on them, and PCs will be consoles with keyboards.

I don't want to live in such future. This is why FSF/GPL is important, for me.

>I don't want to be able compile some source only with "rustc-v_ancient-company_name-internal_fork-no_you_cant_have_its_source" version.

I dont think it is valid concern in $currentYear

Nowadays languages like e.g c# are partially created by community and foundations (.net foundation) on github

So not only isnt it fully tied to company, but also it is oss.

>Hence, I'd rather have multiple compatible, yet independently implemented compilers, per language.

I dont because it permanently decreases developer experience and the value added is not something that could not be achieved with single compiler

I mean if you see room for improvement then go ahead and make PR instead of creating yet another compiler with its own bugs, quirks and wtfs

> I dont think it is valid concern in $currentYear

I don't care about $currentYear. My concern is about $nextDecade earliest, and future doesn't look bright from my perspective.

> Nowadays languages like e.g c# are partially created by community and foundations (.net foundation) on github

A foundation created by Microsoft for a Microsoft's cash cow language on Microsoft's OSS entanglement platform. Yes.

> but also it is oss.

I'm not talking about OSS, I'm talking about Free Software.

> I dont because it permanently decreases developer experience and the value added is not something that could not be achieved with single compiler

This is not what happened with clang vs g++/gcc. Also we have Intel's, Microsoft's and Portland groups compilers side by side for decades.

> I mean if you see room for improvement then go ahead and make PR instead of creating yet another compiler with its own bugs, quirks and wtfs

I prefer implementing language correctly in a compiler to force others to the same, spec-compliant behavior.

Otherwise compilers and languages divert, and lack of alternatives make everything much more complicated in the long run.

>This is not what happened with clang vs g++/gcc. Also we have Intel's, Microsoft's and Portland groups compilers side by side for decades.

What? Cpps ecosystem is the most developer hostile ecosystem that Ive ever used

I wouldnt want to write in it even if my salary was multiplied by 1.5

A lot of compilers where all of them have different lang. features implemented, various bugs, quirks, wtfs, various perf. characteristics (e.g intel's generating faster code)

Long as hell compilation times. This is fundamental problem yet still that diversity didnt manage to solve it

Many package managers

And mediocre lang by modern standards on top of that. Minefield++ would fit it better.

>Otherwise compilers and languages divert, and lack of alternatives make everything much more complicated in the long run.

Theres still competition between langs

I bet Rust helped cpp improve more than gcc clang diversity

I also dont fully understand why you treat lang as a standard instead of product

C++ is an old language, and may not be evolved the best way possible, because it set the path, didn't follow a trail opened by another language.

The ecosystem's state is different depending on your perspective and what you are trying to achieve with it. While C++ is touted as a general purpose language, it's overkill for most of today's tasks. I use C++ to write high performance and low level code. It's my favorite language to work with, but I'm not using it blindly for everything.

As a person who worked with C++ a lot, and still developing something (which I'll eventually open source) for almost a decade, I can say that most of the things you say are not completely correct.

> different lang. features implemented, various bugs, quirks, wtfs, various perf. characteristics...

You can opt to not use any of the compiler extensions and have a completely portable code. Said code compiles in GCC, LLVM on macOS and possibly in MSVC, and uses CPU at its highest potential (verified on Linux with perf, in turn verified by timing on macOS). Intel's compiler creates fast code for Intel's processors, but it needs intel's patched libraries, etc. It's not worth it most of the time, and GCC already creates pretty fast code. In my discipline compiler cross-compatibility is king. So Intel's is not that important for our case.

> Long as hell compilation times. This is fundamental problem yet still that diversity didnt manage to solve it.

You can re-compile only the changed parts in any compiler for ages. This shaves a lot of time from compilation and linking times. Again this is neither novel, nor new.

> Many package managers

The idea of packages born with Java for enterprise software and became ubiquitous after that. Languages have their own package managers to prevent this, but it doesn't always work. Having an "official" package manager doesn't prevent from bringing in a "New and Improved (TM)" package manager to the ecosystem. Also, Rust is a young language. C++ is well, 35 years old? It's inevitable that we have better solutions for the issues we have at hand.

> And mediocre lang by modern standards on top of that. Minefield++ would fit it better.

It's a language with unfettered low level access. It's a sharp knife (or fighter jet). Learn how to handle it, and it won't bite. It's never guaranteed to be fluffy like Go, Python or memory-safe (to a point) like Rust by adding hard barriers.

On the other hand, being semi-conscious about what you're doing prevents 99% of the problems in C++. Said code had memory leak once, during initial development, and fixed on the spot (I test my code with Valgrind), and is memory-sane since that day. That code is not something simple. It's a scientific application which makes your cores and memory controller saturate. It takes every bit of performance offered by your system and converts into science.

> Theres still competition between langs

Yes, but that's another matter, which is not subject of this discussion.

> I also dont fully understand why you treat lang as a standard instead of product.

Because a language is a language. Not different from mathematical notation or human language. Compiler is the product, which transpiles that language to another language (incl. machine code) to run on your PC, mouse, microwave or plant based biologic computer. Compiler is the product. Language is just a language. Sets of rules, a standard even (like C++ is an ISO standard).

It is already a concern with, for example, clang.