Stream: show and tell

Topic: HTML Templating with Roc


view this post on Zulip Isaac Van Doren (Apr 14 2024 at 18:20):

I wrote a tool to do HTML templating in Roc called Roc Template Language (RTL): https://github.com/isaacvando/rtl. I am very excited about how nice it is to use already.

It works by compiling template files into Roc functions that accept some data and return an HTML string. Because of this, there are no runtime errors which has been a huge pain point with other template engines for me. This design is very dependent on the fact that Roc has structural records and such good type inference which highlights for me why these features are so nice. It also supports tag unions and pattern matching in general with when expressions.

A smaller version of this code will also appear in the forthcoming Roc book: https://github.com/roc-lang/book-of-examples.

If you try it out and run into any issues, please let me know! :smiley:


Last updated: Jul 06 2025 at 12:14 UTC