Live data from Hacker News

DSLs are a waste of time

leebriggs.co.uk

131–140 of 165 posts

Re: DSLs are a waste of time

#131
post #82

Earlier quoted context omitted.

ssh-ing somewhere strange on a small laggy connection is standard operating procedure. Not having internet is normal. Not being able to write gigabytes of crap into root's home is normal. Not to mention not installing some weird language environment like Kotlin just so the config is highlighted properly. Including all the bazillion libs i'll need. And all the editor configuration that i'll of course have to copy arou…

>You can pry vim from my cold dead hands. I won't need to, you're already giving yourself carpal tunnel with all the :wQ! INSERT-MODE :wmkGDonzn zz CWSFD, these hands are already marked for death.

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.

Re: DSLs are a waste of time

#132
post #131

Earlier quoted context omitted.

>You can pry vim from my cold dead hands. I won't need to, you're already giving yourself carpal tunnel with all the :wQ! INSERT-MODE :wmkGDonzn zz CWSFD, these hands are already marked for death.

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.

To be fair, I have never advocated for Emacs either. Nano for quick edits, proper IDEs for anything else.

Re: DSLs are a waste of time

#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

Re: DSLs are a waste of time

#134

Steve Yegge made this same point ~20 years ago: > The whole nasty "configuration" problem becomes incredibly more convenient in the Lisp world. No more stanza files, apache-config, .properties files, XML configuration files, Makefiles — all those lame, crappy, half-language creatures that you wish were executable, or at least loaded directly into your program without specialized processing. I know, I know — everyone…

I'd rather they just fix whatever problem or missing feature caused me to want logic in the config file. Ideally, why do I even need a nontrivial config file at all? I want more stuff that just works, and has standard interfaces to find and connect to all it's other pieces. Even manually executing SQL to make a database is too much. I don't want make files at all. They're only there because C/C++ doesn't handle it fo…

The point is that the config gets more and more complex, requiring more and more features, until you get a rather ugly turing-complete programming language. And the further point is that with Lisp, you don't need any of that. Code is data. Data is code.

Re: DSLs are a waste of time

#135

This push and pull on "programming language vs DSL" will be with us forever. Some people love maven because it's a concise DSL, easy to understand if you understand maven. Some people like gradle because it's a DSL with a major escape hatch in that it's also just the groovy programming language with all that entails. This dance has played out with the likes of the Javascript community. Just write a js script, no actu…

> After 10+ years of programming Ah - you're a young whippersnapper! I lived through those changes. I never understood why people thought it was a good idea to have a build-pipeline for an interpreted language like Javascript. But my colleagues did; grunt->gulp->laravel->nodejs->react, with a parallel succession of CSS compilers. That was in just the 5 years before I retired. It became a sort of Red Queen race; you h…

there are frameworks that can be used without a build-pipeline. but while i have been building websites that way for years, i only recently realized the significance of avoiding the build-pipeline. it's way more than just laziness

Re: DSLs are a waste of time

#136

Earlier quoted context omitted.

I'd rather they just fix whatever problem or missing feature caused me to want logic in the config file. Ideally, why do I even need a nontrivial config file at all? I want more stuff that just works, and has standard interfaces to find and connect to all it's other pieces. Even manually executing SQL to make a database is too much. I don't want make files at all. They're only there because C/C++ doesn't handle it fo…

The point is that the config gets more and more complex, requiring more and more features, until you get a rather ugly turing-complete programming language. And the further point is that with Lisp, you don't need any of that. Code is data. Data is code.

But then you're moving towards less of an app with configuration, and more of a "Here's a new programming language and frameworks to write your own app!" Situation.

If possible I'd rather examine why people need so many config options, and design from the start so that things don't need to be manually configured as much.

If a turning complete config really is the way to go, I'd rather just use JS or Python, not something metaprogramming focused that just invites and almost requires building more layers on top to do real programming.

Re: DSLs are a waste of time

#137

Earlier quoted context omitted.

Regular expressions ... 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. https://en.wikipedia.org/wiki/Regular_language Regular expressions have a deep mathematical background. An ad-hoc DSL from a company that specifies infrustructure does not .

Regular expressions, as used in practice in programming are mathematically general for interacting with strings, but they are in no way fundamental. They are a DSL for generating NFAs and DFAs (depending on the underlying engine). There is nothing fundamental about them, they are just a shorthand (a DSL) for those abstractions. Indeed, the very article you posted notes that anything able to be implemented as a finite…

You're grasping at straws now. Just admit that regex is a much more fundamental technology than some ad-hoc, badly specified commercialware and we can be done. Go on, you can find it in yourself ;-D.

Sure, Makefiles are a DSL. Just a horrible one. They just make my point in a different way. Have you used a Makefile recently? They are AWFUL. Brittle, complex, half-bash, invisible-tab-prefixed, abominations, sent from another millenium. Let's take a modern codebase - say Python - you're much better to just use something like pyinvoke - handles all the CLI-level stuff, and you get the full force of the programming language you were writing in the first place.

Re: DSLs are a waste of time

#138
post #127

Earlier quoted context omitted.

Better than making your own syntax for a declarative system, that now needs custom tools. I'd prefer it to lisp, and to JSON if I have to hand read or write it. What's the alternative, besides specifying your declarative stuff inside something like Python?

I agree. For some things yaml is good enough. XML, JSON and s-exprs are also good enough. Everything is good enough until it isn’t. At that point your configuration becomes code becomes configuration becomes code you know the drill. My point is that the more complex use cases like GitHub actions conditions invent their own DSLs in yaml string values anyway because nobody wants to write in a half broken lisp but in ya…

I'd rather we just stop trying to be unixy and support every workflow instead of just having a large but fixed set of things.

Like, GitHub actions could afford to crappy if you rarely had to deal with them. It would be better if you did in fact have JS...

But GH actions take multiple minutes to run, and a linter is near instant.

A less powerful solution would be saying "Here's some prefab instant actions that don't spin up a new container, just tell us what paths to include in for this linter and this formatter and click this box, and since we control it we can optimize it and fix the bugs and all that".

People invent DSLs instead of just exposing code often because they want it to be easy and expressive, but they make the easy things moderately hard, and the hard things near impossible.

But if the easy common things are just built in, you don't need any DSL at all, and you're not tempted to, because you just say "We cover common stuff already, if you want to do weird stuff we have Python for that".

But for some reason programmers would rather spend 10x the effort on a custom system rather than implement a specific common feature, because they want everything to be like a math equation, a description of something general.

Back in the early desktop era, adding stuff just because X fraction of users want it seemed to be all the rage, now people add things based on whether it fits with a vision or an idea.

Re: DSLs are a waste of time

#139
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.

To be fair, I have never advocated for Emacs either. Nano for quick edits, proper IDEs for anything else.

every editing command in nano is either ctrl-key or alt-key. vi/vim is the only editor that i am aware of that doesn't make me stretch my fingers across the keyboard.

Re: DSLs are a waste of time

#140

Earlier quoted context omitted.

Well, I remember them teaching that stuff, and regex is quite clearly a very different sort of DSL than the ones being discussed. That combined with the comment author's seeming lack of nuance made me wonder if they'd ever looked deeper than "all things without a for loop are a DSL". I think we are getting too far into the semantics here though, at risk of splitting hairs and geting lost in the details. The core poin…

I was replying to a very unuanced article, with the headline “DSLs are a waste of time” and no further hedging on that headline in the text. So ya, I knocked down the argument on the argument’s own (very broad) terms. No need for the personal swipe. > The core point is that the article is talking about some quite specific types of DSLs It used specific types of DSLs as evidence but I don’t see a narrowing of the clai…

> No need for the personal swipe

Fair enough

It used specific types of DSLs as evidence but I don’t see a narrowing of the claim itself? Where are you getting that?

What makes me sad, as I posted in a top-level comment, is that I read this exact same rationale 20 years go, by Steve Yegge, and yet we are still having the same stupid debate in programming about whether we should use DSLs and then the DSL grows and grows and, lo and behold, it's Turing-complete, but its ergonomics are dire and its tooling non-existant. And it's not like this is some niche part of the ecosystem - it's how most people deploy infrastructure.

What I despise is seeing the same problems come up again and again, and never seeing good solutions to them, jsut the same mistakes, repeated. Programming is, truly, terrible. Just a load of slaves building the Pyramids.

Post reply on HN