Live data from Hacker News

DSLs are a waste of time

leebriggs.co.uk

71–80 of 165 posts

Re: DSLs are a waste of time

#71

We stop calling the useful ones “DSLs” so this is a truism. Is SQL a “waste of time?” Regular expressions, HTML, Makefiles, CSS (and CSS selectors aka jquery selectors)? It’s the bad ones that are a waste of time. The ones still called “dsl” instead of just “language, “format,” or “syntax.”

I think your examples are spurious and wrong, when compared with the specific kind of DSL the article talks about. SQL is a "Fourth Generation Language", much like Prolog, which is quite different to what is being discussed. HTML isn't a DSL; it's a type of SGML, a specific document markup language - you can't just shout "DSL" and squint a bunch and assume "All sort-of-languages are DSLs". Regular expressions, sure, but that's not relevant here because it's so universal - and mathematically backed (ever done a CS degree?) - that it's embedded inside every language now - i.e. this representation is a somewhat fundamental and mathematically general representation of interacting with strings - the DLSs in question here are, quite obviously, nothing of the sort.

The article is right. DSLs are, universally, awful, as they grow and grow until they encompass all features of a general programming language - but because of their evolution path the're awkward and twisted and lack basic features of a general programming language (and definitely lack all the tooling you get). Witness what happened with XML as a configuration language. What started off as another leaf node under SGML ended up - by way of the Java ecosystem - growing if statements and loops and all the rest, only in a horrendous, hard-to-read and harder-to-debug monstrous language.

So he's right. We should use real languages. And we should probably all just use Pulmi.

Re: DSLs are a waste of time

#72

We stop calling the useful ones “DSLs” so this is a truism. Is SQL a “waste of time?” Regular expressions, HTML, Makefiles, CSS (and CSS selectors aka jquery selectors)? It’s the bad ones that are a waste of time. The ones still called “dsl” instead of just “language, “format,” or “syntax.”

> We stop calling the useful ones “DSLs” so this is a truism. Bingo! Lua was born as a DSL for configuration files. Today is way more than that. JSON was born as a DSL for describing data, a less verbose alternative to XML. It is more than that.

It should be a rule that all mature configuration languages become turning complete

Re: DSLs are a waste of time

#73
The alternative, using general programming languages, is a terrible idea. The last thing I want to do when dealing with a domain specific configuration is trying to figure the meaning out of hundreds of poorly written, badly abstracted, totally undocumented, lines of code.

Re: DSLs are a waste of time

#74
Nothing new or interesting in this article. I find the idea that a general purpose programming language is better for infra/config-as-code to be utterly laughable. No one is out there saying DSLs are “easy”. They are just far more constrained in a way that’s often useful.

His examples of confusing Terraform are not particularly interesting without some counterexample showing how his preferred CDK-style alternative is better (spoiler: it isn’t any less messy).

In fact, CDK/Pulumi-style programming is actually just an imperative-style wrapper that generates the underlying declarative IaC code. You might even call it a reverse DSL. But adding one more layer of abstraction away from what’s actually happening isn’t actually useful. It just adds more seams and more opportunities for leaky abstractions. Using a generic programming language to wrap your declarative infrastructure actually encourages more layers of abstraction. Not a good idea.

Could Terraform’s language be improved? Yes. But replacing it with JavaScript or Python is not the answer.

Re: DSLs are a waste of time

#75
Read the first couple of paragraphs, realized I have no idea what DSLs are or why I should care about them.

Define your abbreviations, people, especially when its not the first hit when googling it. It's not that hard and makes your writing much more accessible.

Re: DSLs are a waste of time

#76

We stop calling the useful ones “DSLs” so this is a truism. Is SQL a “waste of time?” Regular expressions, HTML, Makefiles, CSS (and CSS selectors aka jquery selectors)? It’s the bad ones that are a waste of time. The ones still called “dsl” instead of just “language, “format,” or “syntax.”

JavaScript was a cute little DSL once too! I feel like the author missed a more obvious comparison between Puppetlang and HCL: vendor specific languages. When you consider them from that perspective it’s clear that the decision is based more on which company you trust to serve your long term needs over any point in time implementation details. Is that company Puppet? HashiCorp? Pulumi? The implementation details obvi…

JavaScript wasn't really a DSL though was it? Not in the sense of this article. Brendan Eich was hired to embed Scheme into Netscape Navigator. That's not the same as the kind of crippled templating languages this article is discussing.

Re: DSLs are a waste of time

#77

So, the author considers platform specification languages a waste of time, and has no idea what DSLs are (except that he knows about plartform specification languages)... Yes, platform specification languages are a mess. Making them without the "language" part keeps all of the mess (the language is absolutely not the source of it). There are people trying to fix this, although I'm not sure if I'd place Pulumi on that…

DSLs are often the advanced step to a programmer guaranteeing his future employment:

1) don't document

2) obfuscate

3) pick obscure language

4) implement with your own language

I will grant that the most succinct representation of a problem is a DSL, but DSLs are inherent obfuscation to some degree.

Just because a perfect mathematical representation exists doesn't mean anyone besides the author will understand it inherently

Re: DSLs are a waste of time

#78
Author is arguing that parsed DSLs are worse than embedded DSLs, and he's not wrong pe se - if you have a choice, you should choose parsod DSLs 99% of the time.

However, this is not at all an argument against DSLs. Using a "real" language to specify the cloud infrastructure, you'd still want your API to be declarative and ergonomic, i.e. you'd want a DSL.

Re: DSLs are a waste of time

#79

Yes DSLs have been a terrible failure in the infrastructure space. But that's just because DSLs are suited to a class of problem where the language of the domain is well-defined and changes infrequently. What we've seen with devops is an ecosystem that changes even more rapidly than frontend software development (in other words, a brakeneck pace). DSLs are great in any area where you want to allow less-technical or u…

What specific DSLs are you talking about being failures? Because this is absolutely ludicrous claim.

Re: DSLs are a waste of time

#80
post #76

Earlier quoted context omitted.

JavaScript was a cute little DSL once too! I feel like the author missed a more obvious comparison between Puppetlang and HCL: vendor specific languages. When you consider them from that perspective it’s clear that the decision is based more on which company you trust to serve your long term needs over any point in time implementation details. Is that company Puppet? HashiCorp? Pulumi? The implementation details obvi…

JavaScript wasn't really a DSL though was it? Not in the sense of this article. Brendan Eich was hired to embed Scheme into Netscape Navigator. That's not the same as the kind of crippled templating languages this article is discussing.

One is procedural (JavaScript), the other is declarative (HCL).

Both are (or at least were originally) “crippled” compared to “real” languages.

Both grew immensely each eventually escaping their single-vendor origins.

Post reply on HN