When comparing Nunjucks vs Haml, the Slant community recommends Haml for most people. In the question“What are the best HTML preprocessors?” Haml is ranked 4th while Nunjucks is ranked 5th. The most important reason people chose Haml is:
There are plenty of learning resources available for those who want to learn Haml. The [documentation](http://haml.info/docs/yardoc/file.REFERENCE.html) is detailed and well organized, and Haml is easy to pick up.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Very user friendly
Pro Building blocks for CMS Websites
Another token based system with all of the logic, looping and variable control that other engines provide. But in addition it supports some more advanced page composition elements e.g. block inheritance, includes, layout inheritance, custom tags and macros — all absolutely perfect for a CMS where pages are typically composed of a series of “building blocks”.
Reference:
link
Pro Suppported by Mozilla
Pro Has Jinja2 as role model
Pro Open Source
Pro Easy to learn
There are plenty of learning resources available for those who want to learn Haml. The documentation is detailed and well organized, and Haml is easy to pick up.
Pro Efficient
By using indentation rather than closing tags and eliminating curly braces, Haml is fast to code.
For example
This:
<div id ="lower">
<div class="right column">
<div id="currentDate"><%= print_date %></div>
</div>
</div>
Can be written as:
%div#lower
%div.right.column
%div#currentDate= print_date
Pro Clean syntax
Haml's syntax is very clean and pleasant to look at. It doesn't use HTML tags and it's not verbose at all. The templates are easily readable.
Cons
Con Seeking new maintainer
Con Bad Performance
The rendering time with haml is slower than its competitors.
Con Whitespace sensitivity can be problematic
Haml uses indentation to define structure, rather than closing tags. Though this, in most cases, makes code more efficient to write, it can also cause problems.
Being off by one space can cause an error or change the structure of the code.