When comparing Mustache.js vs Marko, the Slant community recommends Mustache.js for most people. In the question“What are the best JavaScript templating engines?”Mustache.js is ranked 4th while Marko is ranked 8th. The most important reason people chose Mustache.js is:

Mustache provides you with a clean and easy to understand syntax. Having a syntax that is readable is always a huge plus, since this means easier maintenance and code readability in the future.

Pros

Pro

Clean syntax

Mustache provides you with a clean and easy to understand syntax. Having a syntax that is readable is always a huge plus, since this means easier maintenance and code readability in the future.

Pro

Available in lots of languages

Available in a wide variety of languages including Ruby, JavaScript, Python, C++, Scala, Go, Julia, Swift and more. See the full list here.

Pro

Lightweight

Mustache is easy to deliver. If you need more features down the road, you can switch to handlebars, which is a superset of Mustache.

Pro

Server side support

Mustache.js has multi-language server side support, which essentially means you can use mustache based templates on languages other than javascript. (like if your server-side was built on Java you could still use Mustache.js)

Pro

Logic-less

By design logic-less templates force you to separate concerns thus helping you avoid future problems with refactoring. It also allow templates to be used with multiple programming languages without changes.

Pro

Popular

This would mean that you'll have a large community to help you out if you run into any problems.

Pro

Can be compiled

Mustache templates can be compiled to JS files, so that they can be directly loaded.

Pro

Extremely fast

Marko consistently outperforms other alternatives in code benchmarks, both on rendering speed and compilation time.

Pro

Server-side rendering

Marko supports both server-side and client-side rendering.

Pro

Marko Widgets

Marko Widgets allows UI components (rendering + behavior) to be built using Marko.

Pro

Custom tags

Custom tags provide a simple mechanism for embedding more complex components into a template by extending the HTML grammar with support for new tags. For example:

<div>
<say-hello name="World"/>
</div>

Custom tags are easy to create since they just map to a JavaScript "renderer" function as shown below:

Pro

Asynchronous rendering

Pro

Streaming

Streaming allows progressive HTML rendering and reduces time to first byte.

Pro

Allows JavaScript expressions

JavaScript expressions can be executed inside the templates.

Pro

Simple and readable syntax

Marko has a HTML-like syntax which should be easy to read and understand for everyone who has even minimal experience in web development.

Pro

Short learning curve

It is easy to get up to speed and understand what is going on in a very short period of time.

Pro

Small compiled templates

Marko's compiled templates are usually very small, as proven by benchmarks.

Pro

Lots of tests

To prevent regressions, Marko includes a full suite of tests. The testing harness renders a collection of templates and does an exact string comparison to make sure that the tests rendered exactly as expected. There are also API tests, and negative tests to make sure that errors are reported in a friendly way.

Pro

Friendly compile-time error messages

Error messages come in an easy to read and friendly format, with valid stack traces and file formats of the file(s) which brought the error(s).

Pro

Documentation is well maintained and helpful

The documentation is extensive and very helpful. It also contains several sample applications which are very useful.

Pro

Lightweight runtime (~4 KB gzip)

Pro

Concise and Mixed syntax

The Concise syntax type lets you write Marko with a Jade-like indentation based syntax, and the Mixed mode lets you combine in regular HTML-style syntax.

Pro

Easy to integrate with express.js

Easy Integration with Express and Node

Cons

Con

Basic tasks are difficult

Mustache js's attempts at making some things simple makes them so easy that they're almost difficult. That is the case with some basic tasks like figuring out how to apply css to shade odd/even rows on your template based content.

Con

Bested by Handlebars in many ways

Handlebars being an extension of Mustache bests it in both speed and power. It adds additional features to Mustache which make writing templates easier and faster.

Benchmarks have also shown that Precompiled Handlebars renders in about half the time of Mustache and the rewritten Handlebars (current version) is 5 to 7 times faster than Mustache.