4 ms·
gcc and clang are both C++ in my understanding. Regardless, those compilers are usually grandfathered in; distro policies are different for other languages. It
by steveklabnik 9y ago
gcc and clang are both C++ in my understanding.
Regardless, those compilers are usually grandfathered in; distro policies are different for other languages. It just depends.
- kazinator 9y agoEven the C++ front end in GCC is written in C. https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/cp https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/cp
- microcolonel 9y agoTechnically not only C anymore, not sure about the C++ frontend specifically, but there is C++ in GCC since... 5? 4?
- xioxox 9y agoSome of those files are C++!
- deleted 9y ago[deleted]
- pjmlp 9y agoIt looks like C, but actually it is common subset from C++. GCC has migrated to C++ in 2008. https://lwn.net/Articles/542457/ https://lwn.net/Articles/542457/
- kazinator 9y agoAny carefully written C program that doesn't use certain C99 an C11 things can be said to be C++. My language implementation compiles as C and C++. Every so often I build it as C++ (like before releases) to check for regressions and flush out any issues caught by the C++ compiler. I don't think of it as "written in C++", though it is not technically a false statement. All Scheme programs are really written in Common Lisp; they just need a suitable library of macros and functions ...
- readittwice 9y agoNo, they use C++ even for the C front-end. But you are right, you can still see its C past in the source code. What's important though is that the GCC devs actively try to avoid the newest C++-features, this allows it to compile current GCC-trunk even with very old GCC-Releases. IIRC even GCC 4.3 (released in March 2008) is able to compile current trunk (GCC 8.0). This is somewhat different for Rust, where I think the current policy is that master needs to compile with last released version (releases every 6 weeks and just to make it clear: Rust is written in Rust). Before that, the compiler was updated even more frequently. Bootstrapping Rust from 0 therefore is quite hard, since Rust is far from being as ubiquitous as C/C++-compilers. Even if you already have a rustc on your system, it's not unlikely that it is too old for compiling Rust-master. The first Rust-compiler was written in OCaml, so you need to compile that first, then compile Rust commit-for-commit until you reach current master. This could take quite some time. IMHO this is why mrustc is great, since you just compile current master (if it supports all features) with it and then use the generated compiler to compile Rust.
- deleted 9y ago[deleted]