Developing metaprograms is hard and painful. Templight (
http://plc.inf.elte.hu/templight/) supports the development and debugging of template metaprograms, but the code has to be recompiled after every minor change and tricks are needed to retrieve useful information about the result.
A number of languages (Python, Haskell, Erlang, etc) provide an interactive shell for trying code out and displaying the results immediately. For example adding a new element to a list and displaying the result in a Python shell is an easy thing to do:
> l = [2, 3, 4]
> l.insert(0, 1)
> l
[1, 2, 3, 4]
The shell can display the result immediately. The developer does not need to compile his code and start up a debugger to see the result of an expression.
This talk presents Metashell, which is an interactive shell for template metaprogramming. It provides a testing and development environment for template metaprogramming which is as easy to use as a Python shell. For example one can do the following:
> #include <boost/mpl/vector.hpp>
> #include <boost/mpl/push_front.hpp>
> #include <metashell/formatter.hpp>
> using namespace boost::mpl;
> push_front<vector<int, char>, double>::type
boost_::mpl::vector<double, int, char>
The shell displays the result of a template metafunction.
Metashell is available here:
https://github.com/sabel83/metashell. One can try it online in a browser as well:
http://abel.web.elte.hu/shell. Metashell is based on the libClang library.