
Where is my C++ replacement? - AndrewDucker
http://c0de517e.blogspot.ca/2014/06/where-is-my-c-replacement.html
======
gilgoomesh
I you feel like OOP and template metaprogramming are being publicly derided,
then you're welcome to use plain C. It's still going strong after 40 years and
will probably still be around in another 40. I'm joking a little, maybe, but
the point is that languages don't need to change in a hurry. People still
start new projects in Fortran and Lisp; there are natural islands in the North
Sea newer than these languages.

I think it's easy to _feel_ like C++ is due for replacement when it isn't
really. Yes, it's easy to be jealous about all the new things going on in
other languages but that's in languages that sacrifice performance. If you're
using C++ correctly, you're in a performance critical environment (either low
memory, fast speed or steady speed). Or you have a lot of integration with
C/C++. From this position, the only place you can currently go is from C++
down to C.

Honestly, there just isn't an apples-for-apples replacement for C++ at the
moment. Rust is the only serious effort out there at minimum/zero overhead
programming but it's 6 months away from 1.0, longer still before people get
used to large scale design patterns that work well in the language and type
system and much longer before it approaches the level of third-party library
support that C++ has.

Yes, Boost needs a lot more work. C++ has traditionally had a woefully
inadequate platform independent standard library, relying too heavily on Win32
or Qt or Carbon for things that should have been platform independent.

But frankly, C++ is doing okay. It has never been the easiest of languages to
use but it hasn't gotten any worse. It's actually gotten better with C++11 and
C++14 and with clang on the scene and libc++ providing a libstdc++ alternative
and Microsoft finally trying to reach standards compliance.

------
pornel
I think Rust really has a chance replacing C++. To me it's in the sweet spot
between C and C++: it fixes all the tedious little things in C, but still
feels like a "small" language (everything is a combination of
struct/enum/function) and still is very low-level.

It has no GC and zero overhead like C++. You control stack vs heap allocations
and memory layout. With `unsafe` blocks it allows all kinds of crazy
optimisations when you need them.

When you compile with link-time optimizations most of Rust stdlib is discarded
so you can have reasonably small executables.

Rust doesn't rely on a big runtime and has first-class C interoperability, so
you can use it for plugins/libraries with C API too.

And since Rust is pretty similar to Swift (except without reference counting
and with saner array references ;) I expect LLVM will soon be optimized for
that kind of language, so Rust's performance will be >= C++.

------
Gonzih
Haskell? :)

~~~
ungerik
Go was developed to replace C++

~~~
tdsamardzhiev
... for a few specific tasks.

~~~
mitchty
That and the runtime and garbage collector mean its unlikely to ever replace
c++. Maybe for a few specific tasks, but yeah Go is not a c++ replacement.

