Get the latest tech news

MiniJinja: Learnings from Building a Template Engine in Rust


Learnings from building MiniJinja, a template engine in Rust

The core object model in MiniJinja is a Value type which is represented by an enum that looks as follows (some less important variants removed): This for instance means that if you run range(10) in a template it looks like a list when printed even though iteration and number creation is lazy. It's a wrapper type that does two things: it boxes the inner node and it stores and adjacent Span which is basically the code location in the original input template for debugging:

Get the Android app

Or read this on Hacker News

Read more on:

Photo of learnings

learnings

Photo of Rust

Rust

Photo of template engine

template engine

Related news:

News photo

Show HN: Tach – Visualize and untangle your Python codebase

News photo

Why Rust?

News photo

A Comparison of Arenas in Rust