It was super fun and interesting. But I wouldn't say it was a terribly useful exercise that has greatly enriched me as a programmer.
And somehow I have ended up with a very strong bias against DSLs.
It was super fun and interesting. But I wouldn't say it was a terribly useful exercise that has greatly enriched me as a programmer.
And somehow I have ended up with a very strong bias against DSLs.
Most DSLs are bad, partially because most people are bad at designing languages.
Embedded DSLs can be quite neat. Eg Haskell makes it easy to embed something like DSLs inside your Haskell code.
(If you squint a bit, the ability to define your own functions in any language goes in that direction of allowing you to define your own mini-sub-language that handles your problem better. Haskell (and the Lisps) just dial that kind of approach up to 11.)
It had better have an extremely high payoff to justify that cost.
See http://wiki.haskell.org/Embedded_domain_specific_language
Because the overheads are lower, the payoff doesn't have to be as high to make it worthwhile.
(However, there's still some overhead, otherwise you wouldn't really label them as embedded-DSLs.)
But even then. I was never really able to get into Observable because although it looks like JavaScript, there are kind of hidden objects and methods available to you that I found weirdly hard to discover.
Kind of like Jupyter notebooks for JavaScript? Kind of?
Stumbled across your post about spin2win a while ago and I'm glad you found it useful! I still use it every day and wish I could fix the jankiness but oh well hahaha.
A perfectly-designed DSL is still bad just because it's a whole 'nother language for you to build, and for others to learn, that probably isn't needed for whatever project.
I attempted to write a parser for Wikitext once in ANTLR which was an interesting nightmare.
But DSLs are tempting, especially among the more passionate programmers, so at work we've ended up with a lot of them. All of them are tripping hazards.
You can do anything with it because it allows launching other programs, but I'd say it was designed specifically for the domain of launching other programs and building data pipelines with their in- and outputs.
IMO Bash and friends are too powerful and generic to be considered DSLs.
Anything from programmable authorization to custom views becomes safely and relatively easily available. Say what you want about ESB pattern, but you can implement ESB transformers in a custom DSL.
Obviously not every piece of software needs these features, but when it does DSLs are very handy.
At work, we had two painful DSLs for monitoring queries. Our team changed monitoring systems entirely just to use SQL instead.