On C++ compilers, clang++ it's much faster than g++ under legacy platforms. Clang uses far less RAM and CPU than GCC while compiling.
I know we have no cproc/cparser or tcc for C++, but at least clang it's usable with 1GB of RAM.
If you want to compile a recent c++ compiler (gcc/clang), you must have already a c++ compiler (one of the biggest mistake in open source software ever was to move gcc to c++, clang doing the wrong thing right from the start...).
You can start to compile gcc 4.7.4, the last gcc compiler with buggy c++98 you could compile with a C compiler (you will need to patch it, and even unroll its full SDK), then you will have to compile at least 2 gccs to reach the last gcc. This insane mess is due to the infinite versions of c++ ISO "standard", introducing tons of feature creep which will force you to "upgrade" (mostly no real good reasons, namely developer tantrums, or planned obsolescence).
This is disgusting, Big Tech grade abomination of software engineering, shame on the people who did that and those in power who are not trying to fix it (probably the GCC steering committee).
And big mistakes require big fixing.
Big pimpin' on B-L-A-D’s, we doin'
Big pimpin' up in NYC
It's just that Jigga Man, Pimp C and B-U-N B
On cproc, cparser, I meant that we have no lightweight c++ compilers and sadly the closest to cparser in lightness it's clang++, because it's either that or the g++ behemoth.
People rants about CL being a bit 'huge', but with the introduction to the Symbolic Computation book and Paradigms of Artificial Intelligence Programming you are almost done except for a few modules from QuickLisp (CL's CPAN/PIP), such as bordeaux-threads, usockets and MCClim for an UI, which will run everywhere.
C++ templates can be far more complex than Common Lisp macros. At least with CL you have a REPL to trivially debug and inspect then. Clang and GCC just recently began to introduce * understandable* help and error messages over template parsing walls...
The last "real" C++ code I wrote was probably the modular softsynth in http://canonical.org/~kragen/sw/dev3/sweetdreams-c++.cc (see http://canonical.org/~kragen/sw/dev3/sweetdreams.html for an explanation) which also compiles successfully in under 256MiB of virtual memory (¼GiB). But that's still under 500 lines of code.
I'm not sure how much RAM you need to compile G++ itself. More, I imagine. I was definitely compiling versions of GCC long before I ever saw a machine with so much RAM as 1GB, but I am guessing you probably need at least 1GiB for recent versions, maybe 4GiB.
LLVM, which is required for both clang and Rust, is much heavier. You definitely can't compile current versions of LLVM on i386, m68k, or any 32-bit platform anymore. You can get it to cross-compile to them as targets. In theory there are PPC64 machines that have enough address space to build it, but I'm not sure anyone ever made a PPC64 machine with enough physical RAM to build it in a practical span of time.
That said, it seems some people get nice results at porting from c++ to C using "AI" (LLM?).