That Kotlin page calls them "Groovy-style", perhaps because many of those working on Kotlin (e.g. James Strachan, Alex Tkachman) used to develop the Groovy Language.
But doesn't Ruby also have those builders? Wouldn't it be easy enough for Scala to implement them in a library if they haven't already? Wouldn't Python also provide this type of syntax? E.g. a possible translation into Python from the Kotlin code on the linked page...
html:
head:
title {"XML encoding with Python"}
body:
h1 {"XML encoding with Python"}
p {"this format can be used as an alternative markup to XML"}
// an element with attributes and text content
a(href = "http://python.org") {"Python"}
// mixed content
p:
"This is some"
b {"mixed"}
"text. For more see the"
a(href = "http://python.org") {"Python"}
"project"
p{"some text"}
// content generated by
p:
for (arg in args) arg
So what are they called "Groovy-style" builders for?
I program in Groovy daily. "Groovy-style" builders are just sugar over the Builder pattern via heavy use of closures - so in reality they can be used anywhere an Object needs to be constructed.
So yea, any language which supports closures should be able to do "Groovy-style" builders.
Presumably because, among the languages (and standard libraries) you mentioned that have implemented this pattern, Groovy is the language that is most tightly associated with the JVM (which Kotlin is obviously targeting).
But doesn't Ruby also have those builders? Wouldn't it be easy enough for Scala to implement them in a library if they haven't already? Wouldn't Python also provide this type of syntax? E.g. a possible translation into Python from the Kotlin code on the linked page...
So what are they called "Groovy-style" builders for?