News for hackers. Stuff that matters.
Re:Mrustc: a Rust compiler written in C++ by kazinator on Thursday September 21, 2017 @09:21PM (#15308723)
Even the C++ front end in GCC is written in C.

https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/cp

Re:Mrustc: a Rust compiler written in C++ by readittwice on Friday September 22, 2017 @02:16AM (#15309789)
No, 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.

Re:Mrustc: a Rust compiler written in C++ by pjmlp on Friday September 22, 2017 @12:58AM (#15309485)
It looks like C, but actually it is common subset from C++.

GCC has migrated to C++ in 2008.

https://lwn.net/Articles/542457/

Re:Mrustc: a Rust compiler written in C++ by kazinator on Friday September 22, 2017 @10:57AM (#15312743)
Any 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 ...

Re:Mrustc: a Rust compiler written in C++ by microcolonel on Thursday September 21, 2017 @10:40PM (#15309054)
Technically not only C anymore, not sure about the C++ frontend specifically, but there is C++ in GCC since... 5? 4?
Re:Mrustc: a Rust compiler written in C++ by xioxox on Friday September 22, 2017 @12:00AM (#15309301)
Some of those files are C++!