Live data from Hacker News

DSLs are a waste of time

leebriggs.co.uk

1–10 of 165 posts

Re: DSLs are a waste of time

#2
Why don't we have a tool that lets us associate monetary budgets to concrete hardware specs, and then generates a cross-cloud (or cloud-agnostic) configuration?

  budget: $23000
  pricing: cheapest
  cpu:
    preferred: xeon
    cores: 8
    mem: 64gb
  disk:
    preferred: ssd
And some --import-usage flag to specify a folder of historical CPU and memory usage from Grafana.

Re: DSLs are a waste of time

#4
I think calling terraform a DSL in comparison to general purpose programming languages misses the point. If it used a declarative GPPL instead of HCL I wouldn't care, but imperative alternatives general purpose or not are 'a waste of time' & not fit for the domain, IMO.

Re: DSLs are a waste of time

#5

DSLs are more succinct. The are declarative. They are closer to English. Perhaps if no relational database existed before today, the standard grammar would just be javascript - but I think not.

DSLs need not be declarative.

DSLs need not be succinct.

DSLs need not be close to English at all.

All of these are properties which may or may not apply to a _specific_ DSL, they are not defining features.

Re: DSLs are a waste of time

#6
post #4

I think calling terraform a DSL in comparison to general purpose programming languages misses the point. If it used a declarative GPPL instead of HCL I wouldn't care, but imperative alternatives general purpose or not are 'a waste of time' & not fit for the domain, IMO.

CDK for Prolog would be quite the trip.

As it turns out, what matters is whether the model is declarative. As some uses of YAML go to show, declarative vs not is an orthogonal axis to how general purpose or otherwise a language is, and orthogonal again to whether it looks like a configuration file or code.

Re: DSLs are a waste of time

#7
post #4

I think calling terraform a DSL in comparison to general purpose programming languages misses the point. If it used a declarative GPPL instead of HCL I wouldn't care, but imperative alternatives general purpose or not are 'a waste of time' & not fit for the domain, IMO.

Pulumi is an example that proves the exception: using a general purpose language, you create a declaration of desired state.

Think of it like if you used a GPPL to emit HCL. You get the power of that language: loops, function calls, unit tests, or even the ability to call external APIs. You're declaraing desired state and letting the framework sort it outb which is you say you aren't writing imperative code like:

    if (!exists(dnszone)) create(dnszone);

Re: DSLs are a waste of time

#8
post #5

DSLs are more succinct. The are declarative. They are closer to English. Perhaps if no relational database existed before today, the standard grammar would just be javascript - but I think not.

DSLs need not be declarative. DSLs need not be succinct. DSLs need not be close to English at all. All of these are properties which may or may not apply to a _specific_ DSL, they are not defining features.

But they can be. They can have nice properties that general purpose languages cannot.

Re: DSLs are a waste of time

#9

Why don't we have a tool that lets us associate monetary budgets to concrete hardware specs, and then generates a cross-cloud (or cloud-agnostic) configuration? budget: $23000 pricing: cheapest cpu: preferred: xeon cores: 8 mem: 64gb disk: preferred: ssd And some --import-usage flag to specify a folder of historical CPU and memory usage from Grafana.

Found a great option for you at $23000. Amazingly we managed to accommodate your budget. /s

Re: DSLs are a waste of time

#10
This is a great takeaway from the article-- "programming languages are the better authoring model for cloud infrastructure". I was surprised by the simplicity of the "complex" terraform example the author offered, I have seen much thornier Terraform. The title, while appropriate for an article inspired by Terraform, I think misses the benefits DSLs have paricularly in LISP-derived ecosystems. A much better title for the article would definitely be "Terraform(ing) is a Waste of Time"
Post reply on HN