Let Us Have More C++ Languages

C++ is a good language in that it is widely supported and has a large ecosystem around it. As a result, it has a large number of libraries, including extensive cross-platform frameworks (such as Qt). There are also entire operating systems written in C++, of which Symbian is an example. All of this provides ample motivation to use C++ (or at least its libraries) from time to time.

However, as a language C++ can feel verbose and constraining at times. You often find that you’re repeating yourself, and can’t find a way around it by staying within the language unless you are a wizard in the use of CPP preprocessor macros and template metaprogramming. So you might for example end up creating custom (and fragile) preprocessors (such as Qt’s moc), or hacking together ad-hoc code generating Perl scripts.

One option to avoid repeating yourself is not to consider C++ purely as a source language (something to be written by hand), and rather manage your code using an advanced IDE that can crank out and refactor code based on your instructions. (You don’t edit Word documents with Emacs either, after all.) Another, less interactive and more reusable (by rerunning or copy/pasting and editing) approach would be to use a language that is more flexible than C++ itself and can be translated to readable C++ (in the vein of CoffeeScript to JavaScript translation, for instance). The end result presumably could be roughly the same regardless of whether produced using an IDE or a translator.

There are many languages that compile down to JavaScript. I’d like to see some more languages that compile down to C++ and are fairly interoperable with C++ APIs. Or technologies enabling the implementation of such languages, or the extension of C++ itself. Currently I know of hardly any such languages or technologies, certainly nothing of the kind of maturity already manifested by CoffeeScript. C, being the high-level assembly language of CPUs, is a popular target language, but C++ however is not.

For the time being one can at least imagine what kind of features one would like to add to C++, if it were possible with reasonable effort. A couple of weeks ago I started recording ideas for language constructs that would be translatable to readable C++.