“Boostache Exposed : the internals of Boost's template engine"
summary
Boostache is a C++11 template engine that parses Mustache and Django-like templates with a Boost.Spirit parser, compiles them to a small set of compiled VM intrinsics (render, for-each, if/else, select, etc.), and applies those against user data via category-based type dispatch (sequence, associative, variant, optional, plain). It uses Fusion-adapted structs and an extended-variant for recursive models, offers extension points for render/test/for_each/context, compiles templates ahead of generation for speed, and partials and some context-walking features are still unfinished.
AI-written summary · about
chapters (15)
- 0:00Introduction and Boost background
- 1:02What is Boostache
- 3:52Design goals of Boostache
- 7:03Basic usage example
- 9:34Handling complex data structures
- 13:08Template compilation overview
- 17:25Spirit parser implementation
- 24:04Abstract syntax tree printing
- 27:52Compilation to VM instructions
- 35:36Template generation engine
- 41:20Type categorization for data
- 48:09Context selection mechanics
- 53:02Extending Boostache with custom types
- 57:57Future development plans
- 1:01:10Q&A and closing remarks
related talks
16mSession Preview - Interview With – Zach Laine
03mMaking sense of terrible template errors with 'camomilla'
36mCool kids' way of generating code
01h 27mBoost.Parser (Part 1 of 2) - A Parser Combinator Library for C++
01h 48mBoost.Parser (Part 2 of 2) - A Parser Combinator Library for C++
01h 01mRethinking the Way We Do Templates in C++
05mI SPY with my little eye Boost.Predef in a constexpr world
15mTool Talk: Soufflé
