Live data from Hacker News

Problems with DSLs for non-programmers

artur-martsinkovskyi.github.io

81–90 of 144 posts

Re: Problems with DSLs for non-programmers

#81
post #23
post #8

The argument here boils down to: I haven't seen it work in places where I've been employed so it must not work. Reality check: I've worked on multiple large research teams that successfully developed DSLs still in use by domain experts -- military sigint in one case, doctors in another case, industrial engineers in another. We developed these languages for specific applications where the domain experts needed to prog…

Are such successful DSLs described somewhere? Generally my feeling is somehow similar to the one expressed in the blog post, ie. that DSLs don't work for non-technical people. If someone is able to use a DSL then he/she is also able to do regular programming, and many people don't have such abilities. And regular programming languages are better tools for the ones with the abilities.

> If someone is able to use a DSL then he/she is also able to do regular programming, and many people don't have such abilities.

I'd disagree with this characterization. Because a good DSL abstracts away things that are not relevant to the domain (e.g. in Excel, memory pointers and allocation) while retaining those that are (which data transformation you want to apply).

It doesn't follow that someone who understands the concepts in the DSL must also understand the superset of all regular programming concepts. Hell, most Java coders couldn't even write a memory manager from scratch!

Which is exactly where their power comes from. Because each time you shrink the required knowledge to do work, you broaden the pool of people who can perform that work.

> SQL is used widely, but it does not work that well for people who are not programmers.

Is the key phrase that shows the author has no idea what they're talking about.

I can count 20 analysts, off the top of my head, that I personally interact with on a weekly basis at work that disprove the point.

They have incredibly deep knowledge of their particular datasets. They know more than enough SQL to produce efficient queries for their needs. And they wouldn't understand exception chaining if it bit them in the ass. But they still run their part of the business better than I would.

Author is making an "anything shy of perfection isn't worth doing" claim, which misses the forest for the trees. The objective of programming (DSL or otherwise) is to get work done.

Not to be ideologically perfect.

Which is one reason Python is wildly successful, despite all its Oops design bits.

> (In author's defense of DSLs) There are AWK, RSpec, EJS, Emacs Lisp, bash scripts and a lot of others that are cool because their domains are steady and they are used by professionals.

The pompous twit... so data retrieval isn't a steady domain and business analysts aren't professionals?

Re: Problems with DSLs for non-programmers

#82
post #77
post #73

Earlier quoted context omitted.

The counterpoint would be Visual Basic. It was meant for non-engineers/managers to be able to write programs, but that never really happened. It was always easier for a manager to write an email 'I need an app that does X' than to write the app themselves.

There's one key I've seen to DSLs that really work: scope your DSL with iron. You should be able to clearly say 'This DSL can do X. It cannot do Y.' (Then, if Y sometimes needs to get done, provide an escape hatch integration point to C et al.: but don't ever expand your DSL beyond the domain!)

You can see this with how VB became much more monstrous and complex as soon as they tried to shoehorn in a multi-table paradigm.

Re: Problems with DSLs for non-programmers

#83
post #53

Earlier quoted context omitted.

Casual conversation I had with a top surgeon trying to login to an account: me: It's case sensitive - you need a capital letter. him: How do I do that? me: Hold down the shift key. him: Where's that?

Haha! I’m not surprised :)

Everyone has to admit there's a lot of programming minutiae that could and should be thrown overboard.

If you show your language / app / webpage to someone and they ask "Why is X preventing me from doing work?", it would behoove all of us to honestly ask ourselves "Is X important enough that we should keep it?"

Otherwise, we end up with 10,000 gotchas and only someone who studies for 2 years can use things. And I'd personally much rather that surgeon be studying medicine for those 2 years!

Re: Problems with DSLs for non-programmers

#84
post #35

How do we make automating the work of a computer more accessible? 1. Visual programming usually turns into a hot mess. It's actually as hard to learn properly as a simple programming language and once learned - usually harder to build things in. How many devs choose a visual environment when there is a genuine option? 2. "Simple" languages - BASIC, Python, Applescript, Logo. They often become complex over time unless…

Have you used Simulink? It's quite nice for doing realtime control programming.

Re: Problems with DSLs for non-programmers

#85
post #73
post #12

Earlier quoted context omitted.

Anyone who thinks DSLs for the general public can't work has never used Excel. The real trick is creating a domain model that "clicks" in the heads of your users.

The counterpoint would be Visual Basic. It was meant for non-engineers/managers to be able to write programs, but that never really happened. It was always easier for a manager to write an email 'I need an app that does X' than to write the app themselves.

Notice that the GP didn't include managers at the groups he created DSLs for.

And Visual Basic (or COBOL if you want to go back) are meant for what group exactly? It does not look specialized into any domain.

Re: Problems with DSLs for non-programmers

#86

    P.S. I hate Gherkin, Cucumber and other DSLs that 
    let you write the tests that “read like English”
I'm with you there, friend!

But then the author mentions Rspec as a good DSL, so I don't know what their ideal of a good DSL is because Rspec's about as English-like as it gets.

Re: Problems with DSLs for non-programmers

#87
post #82
post #77

Earlier quoted context omitted.

There's one key I've seen to DSLs that really work: scope your DSL with iron. You should be able to clearly say 'This DSL can do X. It cannot do Y.' (Then, if Y sometimes needs to get done, provide an escape hatch integration point to C et al.: but don't ever expand your DSL beyond the domain!)

You can see this with how VB became much more monstrous and complex as soon as they tried to shoehorn in a multi-table paradigm.

I think later-legacy-VB (eg 6) suffers harshly from failing to properly separate primatives.

Imho (open to disagreement), one should think incredibly hard before adding primatives to a DSL. Because what that's essentially saying is "My abstraction was incomplete over the target domain, and now I'm going to hack something in." And now you have a "domain + some other stuff" language, which starts to look like a general purpose language.

SQL vs VB is an excellent example of focus.

(Although I do think VB.net added sanity back to the mix, by saying more clearly "These are VB things" and "These are .net things", and if you want to do the latter in the former, just make a library call)

Re: Problems with DSLs for non-programmers

#88
The problem with DSLs consists of trace debugging, in my opinion.

First, one more counter example to add to the mix already presented here:

https://www.scholars.northwestern.edu/en/publications/pop-pl... Florence et al. – POP-PL: A patient-oriented prescription programming language (2015)

Citations: https://scholar.google.com/scholar?cites=4536900861193079588

The debugging issues which came to light as part of the development of POP-PL led to the new Racket trace debugging facilities in the form of Medic and Ripple, which I've previously commented about here, and which unfortunately barely anyone seems to know about:

https://news.ycombinator.com/item?id=19962087

Re: Problems with DSLs for non-programmers

#89
post #83
post #53

Earlier quoted context omitted.

Haha! I’m not surprised :)

Everyone has to admit there's a lot of programming minutiae that could and should be thrown overboard. If you show your language / app / webpage to someone and they ask "Why is X preventing me from doing work?", it would behoove all of us to honestly ask ourselves "Is X important enough that we should keep it?" Otherwise, we end up with 10,000 gotchas and only someone who studies for 2 years can use things. And I'd p…

Which is a different way of saying that most computer UI still sucks for most users. I agree, and I think that one of the key reasons programmer-y people are successful at navigating computer tasks that stymie the proverbial grandma is this: faced with a question about how to accomplish a task inside some UI, we're just inherently more likely to follow a similar train of thought as the person who wrote the program in the first place, and reach the correct conclusion. (And case-sensitivity in a username is exactly the kind of keen (textual) detail that we're both wired and trained for.)

In other words, we're just iterating on trying things [as xkcd observed][0]. The key is that inside that first decision box, locating an action to try, we have a huge leg up on the "...which looks related to what you want to do" part. I sometimes describe this as "knowing how computers think", but really it's knowing how the people that wrote the program think.

Not that it's an easy problem, but I think we still have a lot of work to do as a field, to make stuff accessible to people whose brains don't follow the same patterns as ours.

[0]:https://www.xkcd.com/627/

Re: Problems with DSLs for non-programmers

#90
post #23
post #8

The argument here boils down to: I haven't seen it work in places where I've been employed so it must not work. Reality check: I've worked on multiple large research teams that successfully developed DSLs still in use by domain experts -- military sigint in one case, doctors in another case, industrial engineers in another. We developed these languages for specific applications where the domain experts needed to prog…

Are such successful DSLs described somewhere? Generally my feeling is somehow similar to the one expressed in the blog post, ie. that DSLs don't work for non-technical people. If someone is able to use a DSL then he/she is also able to do regular programming, and many people don't have such abilities. And regular programming languages are better tools for the ones with the abilities.

In four letters: HTML
Post reply on HN