Florian Bösch (2014-03-08T17:30:51.000Z)
domenic at domenicdenicola.com (2014-03-20T16:23:54.004Z)
That's a fine approach, and I'm not against preprocessing in any flavor if that's your cup-o-tea. The problem rather is that one explicit usecase of multiline strings (aka templates) is to make it easier to write DSLs. But if you write DSLs and embedd the strings in your JS source somewhere, you're gonna have to deal with debugging of any kind. For example, WebGL implementations return errors strings like these: ERROR: 0:1: 'foobar' : syntax error You can imagine that being confronted with a string like that, out of thousands of shader code lines in your application, isn't very useful. You'll also realize that, not all errors can actually be detected with a validator. In order to make this a useful piece of error message, you'll need to translate whatever WebGL throws back at you, to a sourceline and filename. And unless you instrumented this beforehand with a preprocessor, you're not gonna get it. So my question is this, is everybody happy with the state of affairs that a preprocessor is the only viable way to use templates/multiline strings for DSLs, or am I the only one who thinks that could somehow be better?