In this post, Martin (the language's head honcho) writes:

[XML literals] Seemed a great idea at the time, now it sticks out like a sore thumb. I believe with the new string interpolation scheme we will be able to put all of XML processing in the libraries, which should be a big win.

Being interested in language design myself, I'm wondering: Why does he write that it was a mistake to incorporate XML literals into the language? What is the controversy regarding this feature?

  • 2
    Perhaps he was referring(in the post you linked) to having a simple and consistent core and moving more specialized features to libraries
    – Zavior
    Dec 17, 2012 at 8:50

1 Answer 1


I believe Martin explains the reasoning very well in his post:

I have always tried to make Scala a very powerful but at the same beautifully simple language, by trying to find unifications of formerly disparate concepts.

The problem many languages face when they become more and more popular is that features are wanted by the community and added on top of the language. A worst-case example of this (at least in my book) is C++, where you have pretty much everything, yet not at all in a beautiful unified manner (see for example this question arising from that).

The difficulty, when a language grows due to demands/needs from the community is to add the new features in a way that is consistent with the language's core. And in this respect, the XML literals support of Scala is a sore thumb, because this is a unique thing. It's not really part of a beautiful unified core, but has been added as a once-off solution, whereas the string interpolation is a core concept powerful enough to replace the once-off feature.

  • 1
    IMHO, in an ideal world, a language should only contain the core features that allow its developers community to extend it. Extensions should not be part of the core language but should be provided as libraries. So, eventually language revisions may specify new standard libraries but no new language features. Of course, defining such a core language that is powerful enough is not a trivial task, but I think some languages (e.g. Lisp) came pretty close to it.
    – Giorgio
    Dec 17, 2012 at 10:09
  • Talk about a bunch of whiny programmers. XMl literals in scala are extremely useful. The JSON fan boys probably think they are outdated but forget XML is used in other technologies like SOAP. Mar 5, 2018 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.