Boost logo

Boost :

Subject: Re: [boost] Accelerating algorithms with SIMD - Segmented iterators and alternatives
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2010-10-12 12:40:08

Mathias Gaunard wrote:
> On 12/10/2010 04:23, Simonson, Lucanus J wrote:
>> Since we already have the compiler technology for languages that
>> allow it to work well it seems best to implement such a language as
>> a DSEL that allows us to use that compiler technology from C++
>> rather than try to implement a vector compiler in a template
>> metaprogram
> I don't understand. Implementing a C++ DSEL means implementing a
> compiler as a C++ meta-program, since it's a domain-specific language
> embedded in the C++ language.
> Did you mean it without the E, i.e. a domain-specific language with a
> normal compiler infrastructure?
> We're doing that too, re-using the same technology.

We want something that can be called from C++ and extends C++. If we wanted a domain-specific langauge there is cuda, openCL and fortran itself (if you care to think of Fortran as a high performance computing domain specific langauge). Implementing a C++ DSEL does mean implementing the front end of the compiler as a meta-program if you want your errors at compile time instead of runtime, but the backend of the compiler can be deferred to runtime by compiling the expressions to expression data objects (some IR) that aren't compiled into executable code until the first time they are called. Having done expression templates and meta programming (including expression templates for vector primitives) I can honestly say that I wouldn't want to implement an optimizing compiler as a template meta-program. It would be a very tedious and painful task with the end result being something that is thoroughly impractical due to long compile times and the impossibility of maintaining it. It could not compete with the quality and speed of compilers programmed in C.


Boost list run by bdawes at, gregod at, cpdaniel at, john at