Modern Type-Safe Template Engines (Part 1)

See the original posting on DZone Python

Over the past two decades, textual templates have been the most used approach to build dynamic HTML documents. Textual templates engines fit the main web development requirements, however, we leave here two considerations:

  • They are slow.
  • Most of them are not safe.

In this article, we present four recent alternatives (Rocker, J2Html, KotlinX.html, and HtmlFlow) that embrace disruptive and innovative techniques to suppress some of the common handicaps in traditional template engines. We also include a performance comparison between these engines and other state of the art technologies such as Velocity, Handlebars, Thymeleaf, etc. In some of the most challenging benchmarks, Rocker and HtmlFlow are at least two-times faster than the competition.