C# InterpolatedString is very close, with the twisty bit being that C# can rely on static typing for safety so the "f-string" and "t-string" variants use the same literal syntax and depend on what function they are passed to, whereas in both Python and Javascript they have different literal syntaxes. Python chose to use a different literal prefix to its literals ("f" versus "t") and Javascript chose to use a function-call syntax as prefix (`templateString` versus html`templateString` where html is a function in scope).
For the case like here it’s closer to FormattableString that’s what EF Core’s composable FromSql method works on top of. Both address custom interpolation but from different angles / for different scenarios.
Also, you can also find languages like Python that have a rich ecosystem of third party templating solutions. These are often intended for things like rendering entire web pages but many of them have relatively simple ways of using their templating functionality in a fairly reasonable amount of code, if you just want to have a template format that allows interpolating values based on a template string.
So, as you can see, many other languages have this feature, as you can tell from all the examples I have shown you here.
(To spell it out for those who may find this too subtle... somehow... I'm not a fan of this simply because Python has gone from "There should be one-- and preferably only one --obvious way to do it." to "there's half-a-dozen ways to do it and if they are all wrong Python 3.x+1 will introduce a seventh" and I'm just not seeing the benefits worth the tradeoffs here.)
I find this a confusing reply. First, you seem to be confusing eager string interpolation with this lazy/deferred templating feature. I'm specifically asking about languages that have the latter. More confusingly, you bring up the language under discussion as an example... if it already had this feature, they wouldn't be adding a new feature.
Then, you bring up 3rd party templating solutions, but this is off topic, as we are talking about language builtins. I am well aware there are many templating solutions to solve text templating in general.
In summary, I'm specifically asking for examples of languages that allow string interpolation with _deferred/lazy_ processing, which is how I understand this feature. It seems there are a few, but it doesn't seem to be terribly common after reading the other comments.
It's not confusing... it's sarcastic. I don't believe adding literally a third string interpolation method to a language is generally justified, and honestly you can consider it a fourth if you think, as I do, that even "my string " + val + " etc." is itself an interpolation language, especially when combined with things like __str__. I'm afraid you fed me a straight line I couldn't resist; it's not really an answer to you.
If I were in charge of Python, I'd probably feature-freeze it. It is already too large, but shrinking it is impractical.
Failing that, because it probably would fail, I would be raising the bar sky-high on new feature additions.
It seems like the project has actually lowered the bar in the last few versions. What was once one of my favorite languages, if not my favorite, is now a language I try to avoid, and approaching one I actively recommend against. When I'm writing it myself it's ok, but using other people's code in it is getting harder and harder, as they keep using all the features.