Hacker News new | ask | show | jobs
by pmontra 3442 days ago
What are those two templating engines?
1 comments

I don't know about the other, but Shopify has its own templating engine called Liquid, which allows their users to create themes etc fairly easily.

https://shopify.github.io/liquid/

Thanks! I suppose the other one is plain ERB.

The advantage of ERB is that it's plain Ruby and there is no need to learn another language. For the same reason in the Python world I prefer web2py's use of Python than Django's custom language. It reminds me of the days of Strut's <c:choose> tags and all the others.

Interesting that Liquid is faster that ERB. All the surrounding HTML tags being the same, it means that the translated Liquid-to-Ruby code is faster than native Ruby code, which is strange. But maybe Liquid is faster at handling the HTML part of the page. I googled for some data but I couldn't find anything.

However I can understand why Shopify doesn't want to put full Ruby into the hands of customers. Some nasty guy could have used Shopify's CPUs to make some computations for free. Apparently GitHub pages also use Liquid, because of Jekyll and maybe for the same underlying reason.

I've been using liquid for a long time (heavy Jekyll user), and it is pretty good at what it does. Shopify actually lets their enterprise customers (Shopify Plus) to run actual ruby code (which runs a very limited mruby setup) to help process orders.

https://github.com/Shopify/scripts-public