Boost logo

Boost :

Subject: [boost] Template metaprogramming libraries
From: Ábel Sinkovics (abel_at_[hidden])
Date: 2011-09-07 16:29:15


Hi Boost developers,

I am a PhD student at Eotvos Lorand University, Budapest. My research
area covers C++ template metaprogramming. As part of my research I have
developed four template metaprogram libraries based on Boost.MPL. On my
conference appearances I was encouraged to submit my libraries to the
Boost sandbox.

Here is a short summary of the libraries:

metaparse

A tool for building embedded DSLs in C++. This is a compile-time parser
generator library. Using it one can build parsers that take compile-time
strings as input text and parse them as part of the C++ compilation
process. One can think of it as using Spirit at compile-time.

safe_printf

Typesafe printf implementation using metaparse. It provides printf
(sprintf, fprintf) functions taking the format string as a template
argument and type-checking it at compile-time. It is a practical
application of the metaparse library.

metamonad

Monad implementation for C++ template metaprograms. The library provides
a framework for using monads in C++ at compile-time. The library
provides an embedded language for C++ template metaprogramming similar
to Haskell's do-notation. Using it, template metaprograms can be written
with a syntax that resembles procedural code. Unlike the approach
presented at this year's Boostcon, my library focuses on monads
evaluated completely at compile-time.

The library contains implementations for a number of monads available in
Haskell (Maybe, Either, Reader, Writer, State, etc.).

As an addition, the library contains a monad for error propagation in C
++ template metaprogramming. Based on the similarities of monadic error
propagation and exception handling in runtime C++, the library provides
an embedded language that resembles to exception handling. Using it, one
can throw and catch "exceptions" at compile-time.

metatest

Unit testing library for C++ template metaprograms. If a metaprogram
test case fails, it does not produce compilation error, but makes the
result information available at runtime. Using this one can generate
advanced reports and integrate the results into unit testing frameworks
for runtime C++ code. The library contains code that integrates it with
Boost.Test.

The source code, unit tests and examples for the library are available
at http://github.com/sabel83/mpllibs
I've tested the libraries with the following compilers:
 - gcc 4.5
 - clang 2.8
 - Visual C++ 10

Full documentation of the libraries can be found at
http://abel.web.elte.hu/mpllibs.
Publications related to the libraries:
http://abel.sinkovics.hu/?mod=kutat

I would like to ask you for access to the Boost sandbox and I would
appreciate all feedback from the Boost community.

Best regards,
  Abel Sinkovics


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk