Few concerns.
-
custom interpolation could easily be used to ensure no SQL injection could be done. As it is done Scala’s ANORM
-
it neither relies not requires “implicit” keyword nor require it to use its functionality
-
the compile time parsing is a key. No runtime parsing could give neither comparable speed nor readability nor functionality. I mean:
Scala way url"https://acme.com/items?matching_name=${namePart}&limit=${limit}"
is clean and nice.
Current Kotlin way, something like urlescape("https://acme.com/items=?matching_name={}&limit={}", namePart, limit)
is ugly and hard to read. We can’t use even ? here
It bounces us back to C times, when format precedes data list. It is what all languages, Kotlin include, tends to replace with string templates. Now make one more little step and let us write our own modern interpolators. Not in 1980’s printf style
Take a look of SQLDelight. They have to parse SQL grammar in a plugin to get the same results they could easily achieved having custom interpolations. And, alas, it is pretty unusable as parsing complex SQL grammar needs a enormous parser…
The most intriguing as for me is a strength of reaction against such a useful and simple to code feature. Listen, colleagues, if some feature was implemented in scala, it does not automatically means it’s bad