3 ms·
After using many templating systems over the years, I'm sold on the opposite approach of embedding (a description of) the output language in the host language,
by acjohnson55 11y ago
After using many templating systems over the years, I'm sold on the opposite approach of embedding (a description of) the output language in the host language, rather than trying to embed logic in the output language. Think React or Scalatags. Logic becomes trivial, because it's the logic of the host language. And the output can be the output language, directly, or some other data structure (VDOM, in the case of React).
It's similar to the concept of the free monad [1].
[1] http://underscore.io/blog/posts/2015/04/14/free-monads-are-simple.html http://underscore.io/blog/posts/2015/04/14/free-monads-are-s...