Hosted by Three Crickets

Scalable Template Engine

Succinct logo: dog running


Succinct is a minimal templating engine designed for concurrency and efficiency. It has an especially abstract data model, allowing you to back your templates by fetching template data on-demand, during render-time, according to your own complex synchronization protocols. It comes with lots of tools to help you make your data "templatable."

Download button


Why a new templating engine and language? Consider two kinds of templating engines out there:

1. New templating languages. These engines present a new language, which the developers believe is better for templating than other programming languages, either because it is easier to use, or because it is safer and more secure to provide a "locked" language at the frontend, rather than full access to a "real" programming language. At one end of the spectrum are very minimal templating languages that allow for very little, and pride themselves on small footprint, fast parsing, and fast rendering. A great example is Velocity. At the other end of the spectrum are mini-programming languages, offering extensibility, inheritance, and other features. PHP can be seen as an extreme example of this: it evolved from a templating language to a powerful, general-purpose language, which happens to have strong templating features.

The new templating anguage needs a way to access your data. Most templating engines support a simple data model, a table of values that you must fill-in before rendering the template. Others allow you to plug-in your own data model. Still others cross the border into real programming by letting you call object methods on data and arbitrary functions.

2. Programming language scriptlets. These engines rely on existing, full-blown programming languages, and provide you with a way of injecting "scriptlets" of these into text documents. Use whatever data model you like! The engine does not enforce or support any in particular. A straightforward example is Tenjin, which indeed supports several programming languages.

A balance is hard to find. Minimal languages might be too minimal for your needs, forcing you into bizarre workarounds for solving certain problems, such as extending the templating engine itself. At the other end, with mini-programming languages you might feel that your wheel has been reinvented. This is especially true as these projects evolve, and users demand more and more features. What was once minimal becomes bloated with extra features.

On the other hand, engines that open the gates into and use existing programming languages lose a main of benefit of templates: a simple syntax that non-programmer users can understand and edit. (Another advantage is that minimal templates are very quick to load and parse on-the-fly. Real programming languages sometimes require slower compilation. In a highly dynamic environment, this delay is a burden. Performance does tend to be comparable once templates are initialized.)

The problem with both kinds of engines is the data model. Calling methods on objects is not good enough: What about transactions involving multiple calls on different data? What about atomicity and synchronization? Of course, this can be achieved with programming language scriptlets, but, oh boy is it messy. You definitely lose the advantage of a simple templating language!

Succinct was designed exactly with such complex data models in mind. It lets you use your own protocol for data access, and helps you make it easy to use within templates.

Cool! But why invent a new language, too?

The Scripturian library solves the problem of using an overly simple templating language by letting you mix scriptlets of different languages into a single document. Where you need power, use scriptlets in a real programming language like JavaScript, Python, Ruby, etc. Where you need a simple, fast syntax, use a minimal templating language like Velocity. Indeed, integration with Scripturian can save templating languages from bloat and the risk of becoming too much like full-blown programming languages. (Disclaimer: Succinct and Scripturian were both conceived of and designed by Three Crickets.)

With Scripturian in mind, we wanted Succinct to be very minimal, even more minimal than Velocity, which already has some bloat -- such as support for calling arbitrary methods and functions. Succinct is a very, very minimal templating language. In fact, it only has two constructs.

Interested? A proper web site for Succinct is coming soon. In the meantime, feel free to get the source code and participate!