Joe Brown
Joe Brown

Reputation: 31

Domain specific languages, application generators and software reuse

James Neighbors mentioned DSLs as an approach for software reuse but without explaining why.He just say that DSLs can be a better approach than a library of reusable components. I could not understand the relationship and what benefits can we come up with using DSLs in software reuse ?

Also in When and How to develop DSLs paper by Mernik , he mentioned that DSLs can serve as an input language to application generators, and application generators is one approach of reusing software discussed by Krueger.

Could anybody tell me the relationships or just how would a DSL be an effective approach towards software reuse ? Thanks a lot for your help

Upvotes: 1

Views: 212

Answers (1)

Ira Baxter
Ira Baxter

Reputation: 95306

James made it very clear why DSLs are a good approach for software reuse (he and I were at UC Irvine together):

  • They capture the concepts of interest in the problem domain
  • They use a notation familiar to community that works in that domain
  • They define the rules of composition of specification/solution components to produce an answer, so that a DSL fragment can be checked for sanity as it is provided

His Draco system implemented all these concepts, accepting DSL descriptions, followed by a DSL instance, which Draco then compiled to low level code by applying implementation knowledge fragments ("refinement rules") to map from a high-level DSL into lower level DSLs/optimizing in the lower level DSL, and then repeating until you finally reach a DSL at low-enough level abstraction to give to a conventional compiler (e.g, to LISP or C or Ada or COBOL or ...).

This is his refine-and-optimize paradigm, that allows a set of DSLs to refine through layers of hierarchy to low level code. Thus, you get composability of layered domains and you can work at a very high level of abstraction.

So you capture problem specification and implementation knowledge, and apply it to get code. Reuse of abstractions, of specifications, of implementation, wow, ... not just reuse of "code" which is where lots of folks still seem stuck, as they were in the early 80s. Code is really hard to reuse.

This is really a very nice paradigm compared to "subroutines-as-components" (the fancy term for this currently is "inner DSL", which misses the domain notation, specification checking, implementation, and compositionality elements).

I think you really ought to read his PhD thesis (accessible here along with a lot of his other papers) carefully. It is a lot more approachable than might expect. It isn't full of arcane math; it is full of concepts and demonstrations of how to engineer his kinds of DSLs.

Upvotes: 2

Related Questions