Live data from Hacker News

DSLs are a waste of time

leebriggs.co.uk

151–160 of 165 posts

Re: DSLs are a waste of time

#151
post #51

FWIW this wiki page I started may help frame discussions like this: Survey of Config Languages - https://github.com/oilshell/oil/wiki/Survey-of-Config-Langua... It puts a bunch of languages in 5 cateogires. Terraform is at least not a YAML DSL, a very common pattern which I don't understand the appeal of. I guess the main appeal is that you can copy and paste, and pretend it's data in simple cases. But even Terraform…

You can add other languages, such as Kotlin to that list. It is explicitly made to give you the ability to build a strongly typed DSL with proper scoping, references, validation, comes with all the benefits of a real language, including working language servers right out of the box that autocomplete everything properly. But that would require sysadmins to admit that editing all their config through nano with no synta…

rclone allows you to mount remote fs via ssh, it has some quirks but overall I'm able to maintain my self host setup with this. also I'm sure there are plenty of similar plugins, maybe even officially vendored, for all the shiny IDEs

Re: DSLs are a waste of time

#152
post #133

> I was left with an expertise and knowledge of a language that was now, effectively useless. VB did that to me; the lesson I learned is to avoid[0] languages with just a single implementation. As a consequence, I'm not very interested in languages like Ruby, Go and Rust. In the old days, every language had a train of compilers/interpreters following it. Pascal, COBOL, FORTRAN, even ALGOL. I believe that in those day…

not sure why you are making that distinction. sure, a few decades ago, a single implementation meant that a language was not widely used. but that is no longer true today. the biggest example for a widely used single implementation language is probably java. and learning ruby, go or rust surely is not useless

The point, I think, is not how widely used it is, the point is that you become beholden to a single, often corporate vendor.

I'm not actually sure what made the transition from VB classic to the DotNET version so disruptive, and so damaging to VB in terms of popularity and mindshare ( possibly that C# was better while still sharing enough of the benefits? )

But from everything I saw it was. VB mindshare just fell off a cliff from everything I could see.

I mean, you could say similar things about the damage and disruption about perl->raku and python 2->3, which are both effectively single implementation ( ok, less true of python ), but the end result seems very different.

Perl5 is still nearly standard in linux/unix, especially anything not embedded or real-time, while raku is niche, although perl5 is more and more niche despite that, with many, many haters..

Python 3 is probably as popular or more so than 2 was

VB is an also ran in DotNET languages.

So, I dunno, I think there might be more to it that just "single implementation is risky". "Single corporate owner" might be a better one, idk?

Re: DSLs are a waste of time

#153

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.”

According to the article, the alternative to DSL is the programming language. So what the author understands as a DSL is some special-purpose language that is self-contained with its own run-time such that you have to string multiple of these to solve the task. Possibly, the author might have

The article doesn't discuss the possibility of building DSLs with the programming language and using them, all integrated together.

Yes, CSS is crap for instance. The web should have one language for everything in which styling is a DSL.

Regular expressions are better when they are in your language:

  2> (regex-compile '(0+ (or "a" "b")))
  #/(a|b)*/
E.g. we can cleanly stick something into a regex's syntax tree without worrying about escaping:

  3> (regex-compile '(0+ (or "*" "b")))
  #/(\*|b)*/
  4> (let ((x "[")) (regex-compile ^(0+ (or ,x "b"))))
  #/(\[|b)*/

Re: DSLs are a waste of time

#154
post #133

Earlier quoted context omitted.

not sure why you are making that distinction. sure, a few decades ago, a single implementation meant that a language was not widely used. but that is no longer true today. the biggest example for a widely used single implementation language is probably java. and learning ruby, go or rust surely is not useless

The point, I think, is not how widely used it is, the point is that you become beholden to a single, often corporate vendor. I'm not actually sure what made the transition from VB classic to the DotNET version so disruptive, and so damaging to VB in terms of popularity and mindshare ( possibly that C# was better while still sharing enough of the benefits? ) But from everything I saw it was. VB mindshare just fell off…

ha yes, single corporate owner is certainly a different kind of issue. i agree with that.

Re: DSLs are a waste of time

#155
post #144
post #131

Earlier quoted context omitted.

actually the opposite is true. esc-meta-alt-ctrl-shift[0] is more likely to give you carpal tunnel, than vi where you switch modes and then type commands with single keys instead of twisted key combos. i actually get annoyed at how many ctrl-key combos vim has. [0] i don't know if emacs is that bad, but that's a classic pun that just fit here.

I used vim for 10 years (not really an advanced user, but comfortable with it), and I just learned Emacs for the last 6 months... I am now completely confused by the Emacs vs Vim religious war. The two programs excel at completely different layers of productivity. I can't think of any software that radically approaches improving your workflow like either vim or Emacs, and they are both wholly unique. I also use evil…

I am now completely confused by the Emacs vs Vim religious war

i think at least half of those who keep up with the emacs vs vim war are doing it just to confuse newbies. the other half really just prefers the emacs way or the vi way.

either way though you are right. they are both very distinct, and it's not one being absolutely better than the other.

Re: DSLs are a waste of time

#156
post #130

Earlier quoted context omitted.

I thing you're getting to the heart of the matter here. I'm not sure if I'm being redundant, because I reloaded a few times and see that _many_ posts have been made in the short time since I started looking at this article and reading comments. But, the discussing seems to be bifurcating into different camps. Do you assume that the blog and discussion are narrowly scoped to sysop/devops problems, or a general diatrib…

fully agree, especially with the second paragraph. even as a developer, i want a simple DSL that lets me declare things and not twist the data structures into code. and especially as a programmer, if code is needed for more complex structures, i want that to be done in a real programming language. so i am favoring the two products approach, or maybe a language with a well designed syntax for data, where the relations…

FWIW the JSON/JavaScript design is roughly where we're going with Oils

We have JSON support for literal data, pure data

But you can also interleave code and data in what turns out to be a very Lisp-y fashion, which is useful for configuration

https://www.oilshell.org/release/0.17.0/doc/hay.html

Slogan: We're adding the missing declarative part to shell, called Hay (Hay Ain't YAML)

That is, most YAML configs are just nested key-value pairs, where some values are shell snippets ... So I think it makes sense to add declarative data to shell instead!

Re: DSLs are a waste of time

#157
post #91
post #7

Earlier quoted context omitted.

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…

I didn't name it, but Pulumi's the main (multiple) GPPL alternative I was thinking of. I don't think emitting/compiling to something declarative makes it any better; maybe if you normalised that being the key checked-in thing, a bit like a lockfile, but which people really checked and cared if it changed, more so in a way than the source. I want to write and review declarative, not compiles-to-declarative.

Hey, Pulumi engineer here.

The engine doesn't compile to a declarative template. It's a common misconception, however because the user's program runs concurrently with the Pulumi engine, fully dynamic resource graphs are possible, including those inexpressible using templates.

This is Pulumi pseudocode:

    const group = new ldap.DirectoryGroup("$saas-users);

    // or any other runtime query:
    for (const member of group.getMembers()) {
      new saas.User(member.id, {
          email: member.email,
          name: member.fullName,
      });

      // could also do some other dynamic action, such as 
      // calling a webhook to complete user setup
And in ~10 lines of code you have a script or webhook you can use in situations where SCIM would normally be required.

(n.b.: this is a simplified, illustrative example that the program drives the graph using its own using loops or other control flow.)

Re: DSLs are a waste of time

#158
post #91

Earlier quoted context omitted.

I didn't name it, but Pulumi's the main (multiple) GPPL alternative I was thinking of. I don't think emitting/compiling to something declarative makes it any better; maybe if you normalised that being the key checked-in thing, a bit like a lockfile, but which people really checked and cared if it changed, more so in a way than the source. I want to write and review declarative, not compiles-to-declarative.

Hey, Pulumi engineer here. The engine doesn't compile to a declarative template. It's a common misconception, however because the user's program runs concurrently with the Pulumi engine, fully dynamic resource graphs are possible, including those inexpressible using templates. This is Pulumi pseudocode: const group = new ldap.DirectoryGroup("$saas-users); // or any other runtime query: for (const member of group.getM…

Ok. I've never actually used Pulumi, I was responding to GP's description. Personally I want declarative for IaaC; some here are advocating for imperative generation of declarative IaaC (and claiming Pulumi as an example), which I think is barely an improvement (but nevertheless..) over imperative IaaC.

Re: DSLs are a waste of time

#159
> Understanding how to handle complex data structures in say, Python is something which might help you fix bug’s in application code, you can’t throw a DSL at that.

True, but it's not an either/or situation. Maybe it's not optimal, but a lot of people do both. I consider myself a Python and Terraform expert and I'd say I reached that stage in Terraform in less than 10% of the time it took for Python.

Re: DSLs are a waste of time

#160
post #48

Earlier quoted context omitted.

CDK for Prolog sounds sick and disgusting. I LIKE IT! I'm a little more familiar with DSLs w/ Lisp, but I built a simple make replacement with Prolog a few decades ago and it turned out to be useful. Replacing CloudFormation or TerraForm with a Prolog based DSL seems like it could be a win. I like Prolog much more than Pulimi in this role as you can succinctly and unambiguously declare dependency relations.

> I like Prolog much more than Pulimi in this role as you can succinctly and unambiguously declare dependency relations. Prolog for Pulumi is an absolutely doable thing - and indeed sounds sufficiently diabolical that someone should do it ;-)

Or even Prolog w/ the AWS CDK. Hmm.. that might even be a business.
Post reply on HN