r/ProgrammingLanguages • u/t_ewert • Jun 13 '26
Blog post Language Design of a new template language
https://pinc-official.leaflet.pub/3mo3nsla6z22uI have been working on a new template language in my free time. Its trying to solve some problems I have with other template languages which are outlined in the post.
Its not released / ready yet, but I am looking for some feedback :)
17
Upvotes
View all comments
1
u/liquidivy Jun 13 '26 edited Jun 13 '26
For a practical templating language, personally I've pretty much decided that if there's going to be any computation, I just want it to be expressed in the host programming language. OCaml in your case, rather than a template-specific language with similar but different rules I have to learn. I'd rather the "template" part be just templates, i.e. basically string interpolation (with control structures).
Relatedly, I don't really like the "Slot" idea at all, including in other template frameworks. I think you can do better for composability and uniformity. Slots only makes sense if your function/component invocations have to look like HTML. But... you're making your own language. You can just have function calls, with named arguments. I really want components to just be regular functions.
Functions are just really great, you know? :D