4 ms·
The other big advantage of C is that multiple compilers for it exist that are good enough to use in real life, for a wide variety of toolchains, and it's simple
by david-given 10y ago
The other big advantage of C is that multiple compilers for it exist that are good enough to use in real life, for a wide variety of toolchains, and it's simple enough that it's possible to write a compiler for it (if not necessarily a very good one) as a hobby project. We can be reasonably sure that C will continue to exist.
By comparison, C++ has precisely two working open source compilers --- clang and gcc --- and Rust has one: if you commit to using Rust, you're also committing yourself to an LLVM-based monoculture. The chances of the entire Rust team being simultaneously hit by a bus is low... but it's something that needs to be factored into a product assessment.
- gcr 10y agoThat argument seems akin to avoiding C# because only MS supports it, or avoiding Python because CPython is the only serious implementation. The language with the most sensible implementations seems to be javascript, I guess.
- pekk 10y agoIt can be rational to develop projects on new languages. It can also be rational to consider the risk posed by the ecosystem you are plugging into. For example, it would be rational to consider the risk to a new project of basing itself on a language that is only supported by one corporation. (Imagine if Oracle had become a single point of failure for Java.) That said, Microsoft has very deep pockets, shows every indication of continuing to promote and use .NET extensively, and has also built up a lot of commercial buy-in over the 15 years or so that .NET has existed, which could carry it forward a while or fuel alternate implementations if something catastrophic happened. PyPy is a serious implementation of Python. There are others and have been others over the years. While the corporate buy-in isn't the same as .NET or Java, there is a large amount of open source funding and buy-in from very diverse sources. Python is older than .NET as well. Maybe the risk of using Rust is acceptable even if a bit larger, or the added risk is offset by Rust's good qualities - nonetheless, it's a very new language with no Microsoft-scale company behind it. Not precisely comparable. It doesn't matter if Rust is perceived as having less ecosystem risk than Python or .NET, if in (say) 10 years it doesn't make significant headway against C, which is what it actually has to compete with. Here we could consider the examples of Pascal and Lisp - they competed with C, were arguably much better languages, and they lost anyway. It's something worth considering if your dreams are founded on Rust.
- dispose13432 10y ago>That argument seems akin to avoiding C# because only MS supports it Or avoiding Flash because only Adobe supports it, or SilverLight/VB because only MS supports it, or Objective C because only Apple supports it.
- unscaled 10y agoMany popular languages nowadays essentially have just one viable open source toolchain: Go has the Go toolchain (gccgo being niche), Python 3 has CPython (Jython and IronPython only support Python 2.7, and PyPy is not up-to-date), Swift has the apple toolchain, Haskell has GHC (none of the other compilers is widely used). That's not necessarily a bad thing since the compilers are all open source and you can port them to whatever platform you want anyway. C managed to spawn a lot of adequate compilers, but the language itself has seen very few changes since it was standardized (27 years ago), while all the other contenders (including C++!) see a major release at least every 2-3 years, and up to several times a year (for Rust). You can't have that pace of changes and still maintain compatibility between all the different implementations.
- dispose13432 10y ago>Many popular languages nowadays essentially have just one viable open source toolchain: Go has the Go toolchain (gccgo being niche), Python 3 has CPython (Jython and IronPython only support Python 2.7, and PyPy is not up-to-date), Swift has the apple toolchain, Haskell has GHC (none of the other compilers is widely used). The problem is that having multiple providers prevents the BDFL from playing too hard with the language. If there was an alternate Python toolchain, Python3 wouldn't have happened.
- stymaar 10y ago> Rust has one: if you commit to using Rust, you're also committing yourself to an LLVM-based monoculture rust currently has only one backend, which is LLVM, but their is a working project to build an alternative one for the Cretonne compiler[1] for the «debug» builds, and there might also be a GCC backend for rustc one day if people are interested enough to build it. I'm not aware of any fundamental difficulties that would prevent it. [1]: https://internals.rust-lang.org/t/possible-alternative-compiler-backend-cretonne/4275 https://internals.rust-lang.org/t/possible-alternative-compi...
- Manishearth 10y ago(The reason cretonne is debug only is that it's raison d'être is for WASM, so it won't be doing (many) optimizations. It will help with rapid prototyping however, and perhaps let you do things like a rust interpreter)
- dispose13432 10y agoThe question is not so much how many working compilers are there, but how many rely on the language. Practically, PHP has one interpreter, but if they go out, you can be assured that someone will fork and maintain it. On the other hand, if MyToyLangOnGitHubGraduateProject goes belly up, you're stuck maintaining it yourself.
- bluejekyll 10y agoIf you never adopt new technology there is no progress. C++ dissed, but offered enough ergonomics that it gained adoption. Java succeeded in giving people a platform on which they could distribute software while relying on a consistent runtime. Rust is new compared to these, but again offers significant ergonomics over C and C++, seems to be delivering on platform independence pretty well (better than C/C++ imo); it really is the best of both worlds. What's also amazing, is that Rust is growing through sheer love of the language. There is no one pushing it, but for the joy of hacking. It is lik C in that way.