Home | About | Partners | Contact Us

SourceForge Logo

Quick Links
Home
News
Status
Building XL
XL Mailing List

Understanding XL
Conceptual overview
XL examples
Inside XL
Concept Programming

In depth
Browse GIT
Bugs
SourceForge Info
Contact

Other projects
GNU Project
The Mozart Project

XLR: Extensible Language and Runtime

The art of turning ideas into code

XL, an extensible programming language, implements concept programming
If you want to know more, you should start here.

C++ Considered Harmful

Tuesday, October 14, 2008

There is a blog entry on Eric Raymond's web page that is worth pointing at, in particular because of the discussion in the comments.

What strikes me in these comments is that people still oppose dynamic or scripting languages like Lisp or Python to system languages like C or C++. One commenter indicates that he has to use C++ because no other advanced language can do real-time. That is one of the reasons I chose to design XL (I started my professional life writing hard real-time code, think sub-millisecond.)

But as XL proves, even in its present unfinished state, it is possible to design a language that offers a much higher level of abstraction than C++ and is also much more efficient. For example, I remember at some point timing the code for native/TESTS/12.Library/julia.xl on Itanium, and getting almost a 70% speed boost relative to C++. Why? Because the XL construction does not require any kind of memory touch to perform complex operations, whereas C++ mandates them.

Specifically, the complex class has an implicit this pointer, so that an operator like operator+ implicitly performs four loads (real and imaginary part of both arguments) and two stores (storing real and imaginary part of the result). These loads and stores can be eliminated with really advanced back-end optimizations such as register field promotion, the kind of which the HP C++ compiler only performs at O3 or above. The XL complex arithmetic code in native/library/xl.math.complex.xl, by contrast, generates code that can be done entirely in registers, even at the lowest optimization levels. And this, despite having a level of abstraction that is at least comparable to the C++ implementation of the same.

What this tells me is that it is possible to design a language that is very high level, yet at the same time retains and even enhances the good attributes of C++, its ability to generate high-performance code.

October 2008
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Sep  Nov


Copyright 2009 Christophe de Dinechin (Blog)
E-mail: XL Mailing List (polluted by spam, unfortunately)