What is a "domain specific language"?

What is the relationship between a "language" and a "domain" in the term DSL? I suspect we curently apply just a subjective ontology: some languages are intended to cover a specific domain and are therefore domain specific. But aren't Erlang, C and Perl also domain specific in this respect ( telecommunication networks, operating systems and text processors )? We are just widening and narrowing abstractions and also domains and unless we don't simply focus on surface syntax ( what almost any author inevitably does who is talking about DSLs ) it's pretty hard to designate a domain specific language. For instance we could replace this ugly line noise that regular expressions are by a combinator library without changing the underlying semantics. Do we have a language only in the first case but not the last?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It's fuzzy, but

It's fuzzy, but it's domain specific when it does not support, or at least is not intended to support, general purpose programming (and is intended to support a specific domain). E.g. make, parser generators, HTML are not things you could develop arbitrary programs with. Other languages are geared at a domain but are actually general purpose languages (and upon occasion, rather nice ones). E.g. postscript, javascript, TeX.

The difference between regular expressions and combinators representing them is a difference between a domain specific language and an embedded domain specific language.

I'd probably consider an

I'd probably consider an otherwise general purpose language that's tied to a specific and limited platform (the Java platform doesn't count) to be domain-specific as well.

Except perhaps by legal means

Except perhaps by legal means, it's a bit difficult to tie a language to a specific platform. Taking postscript as an example (which I assume is one that you are including in the above): does it cease to be domain specific if I implement an implementation outside of a postscript viewer?

I guess that you can say this insofar as you can say that e.g. Ruby is an interpreted language, which is to say it is not a property of the language but the most significant implementations.

If you're having to supply a

If you're having to supply a pile of non-standard libraries or even new language features just to write a console hello world app, it might have been a DSL? :-)

Pretty hello world

In postscript I'm sure you don't need new languages features for that, and I can make a quite pretty hello world program. What? Your console doesn't display postscript?

The main thing I'd say most "domain specific" languages are lacking that a "general purpose" language usually (... hopefully) has is an FFI.

Hello, world.

Postscript has a print to console command.

Try the following program:

(Hello, world.) =

Of course, you need to use an interpreter which has a console.

Little Languages

I prefer the term "little languages" precisely beacuse it doesn't commit you defining what the domain is, and the related issues that follow.

As you probably know we have a DSL department. Over the years we mentioned many papers on DSLs, quite a few of which deal with the issue of defining what a DSL is. You might want to check them out.

Another useful resource may be the DSL Annotated Bibliography. I think sec. 5 would be of particular interest.

"Formal Islands" contains refs

There have been many papers on DSLs, what constitutes a DSL, etc. Formal Islands contains a brief discussion, and many references to prior papers discussing DSLs.

LtU

Umm, I guess this is a characteristic of this site; if something has been written about it shouldn't be discussed? I think the OP has some valid points and questions, but instead of discussion he's pointed to the literature. Very high cost of entry here, I'd say.

Goals

Perhaps getting Kay Schluehr's, a long time active member of LtU, view on this thread via email is in order. You may be surprised.