Reactive HTML Templating is a widely used practice in frontend development. You create your HTML templates in a web design tool, then copy it into Scala source code and replace the mutable part to bindable XML interpolation.
An implementation of this approach is Binding.scala, one of the most popular Scala.js frameworks. A developer can create reactive DOM nodes from statically type checked XHTML literals, which are able to automatically change whenever the data source changes.
This approach produces very concise code. For example, a complete single page application TodoMVC written in Binding.scala has only 122 lines of code: https://scalafiddle.io/sf/dGkVqlV/9
As Martin Odersky written in The Goals of Scala’s Design:
Initially we had colon-equals for assignment—just as in Pascal, Modula, and Ada—and a single equals sign for equality. A lot of programming theorists would argue that that’s the right way to do it. Assignment is not equality, and you should therefore use a different symbol for assignment. But then I tried it out with some people coming from Java. The reaction I got was, “Well, this looks like an interesting language. But why do you write colon-equals? What is it?” And I explained that its like that in Pascal. They said, “Now I understand, but I don’t understand why you insist on doing that.” Then I realized this is not something we wanted to insist on. We didn’t want to say, “We have a better language because we write colon-equals instead of equals for assignment.” It’s a totally minor point, and people can get used to either approach. So we decided to not fight convention in these minor things, when there were other places where we did want to make a difference.
xml"<html></html>" syntax seems like another colon-equals debate to me. Why do we fight against the widely accepted XML literal syntax, which has been proven success in ActionScript, JSX, TypeScript, LiftWeb, monadic-html and Binding.scala?