0

Does a domain specific language use other languages like c++ or java, or is it standalone?

  • Ruby is sometimes used to build DSL. See http://jroller.com/rolsen/entry/building_a_dsl_in_ruby or http://stackoverflow.com/questions/4936146/tutorials-for-writing-dsl-in-ruby – knut May 29 '13 at 21:56
  • DSL can either be standalone or embedded into another language (eDSL). It's pretty easy to embed a DSL into C++ or any other proper meta-language, but with something as dumb as Java it's too tricky. – SK-logic May 30 '13 at 10:22

1 Answers1

2

Yes, DSLs are often implemented using other languages. Tcl, ruby, groovy, and many others are very good for creating DSLs. A simple DSL can be developed in a matter of just a few hours or days in many cases.

A lot depends on he "D" -- the domain. If you're writing a DSL for financial traders, you might write it in C to get high performance. If you're writing a DSL for a testing framework or to describe a GUI, building atop an existing language may make more sense.

Other factors include whether this is a DSL that will be used daily by domain experts who have a specialzed vocabulary, or if it is for novices to configure a game once every few months. Will it be a commercial product or a freebie? And so on.

There are many, many use cases for small DSLs to be written on top of scripting languages.

Bryan Oakley
  • 25,192
  • 5
  • 64
  • 89