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:
Or read this on Hacker News