starlark
starlark copied to clipboard
Formatted string literals (PEP 498)
PEP 498 introduced formatted string literals which make this possible:
>>> name = "Star-Lord"
>>> f"Starlark, say hi to {name}"
'Starlark, say hi to Star-Lord'
It would be nice to have it as an alternative to the regular string formatting, especially since modern languages like Kotlin and Swift make this formatting convenient and less error-prone.
val name = "Star-Lord"
val greeting = "Starlark, say hi to $name"
let name = "Star-Lord"
let greeting = "Starlark, say hi to \(name)"
However, I can completely understand that sometimes a language should be simple. So this is just an idea.