Dictu icon indicating copy to clipboard operation
Dictu copied to clipboard

Support Templating

Open LamboCreeper opened this issue 4 years ago • 1 comments

Personally, I am not a fan of how Dictu handles formatting strings. I think the addition of a templating system similar to Python's f-Strings or JSX's expression embedding system would be beneficial to the language:

var name = "Lambo";
var job = "Developer";

print("My name is {name} and I'm a {job}."); // My name is Lambo and I'm a Developer.

The ability to perform logic inside these templates (like JavaScript's template literals) would be a bonus:

print("I am {10 + 7} years old."); // I am 17 years old.

LamboCreeper avatar Apr 28 '20 07:04 LamboCreeper

I can see the benefit of more seamless string interpolation, however from a parsing perspective allowing expressions inside strings adds a lot of complexity for very little benefit. That being said, simple symbol resolution wouldn't be too costly.

kayomn avatar Jun 30 '20 14:06 kayomn