3

I'm considering doing something with Domain Specific Languages for my undergraduate project. My one problem is I can't really find any interesting examples that I can root around in. Does anyone have any good examples of DSELs (preferably open source)?

Also, one area I would love to look at is solving/addressing concurrency problems (coroutines etc) with DSEL's. Are there any good examples that anyone uses of this in DSELs? If this is a stupid application of DSELs please explain why...

Another potential area to explore would database programming. Again is this a stupid area to explore with DSEL's. For example, would adding some crazy database manipulation syntax to C# say be a good project to undertake?

EDIT: General languages I would be looking at implementing in would be Java, Python, Scala, C# etc. Probably not C++ or C.

seadowg
  • 4,215
  • 6
  • 35
  • 43

2 Answers2

1

Linda implementations can be considered as eDSLs. STM implementations like CL-STM are certainly eDSLs.

Unrelated to concurrency, but extremely useful are embedded Prolog implementations, there are plenty of them for Scheme, Lisp and Clojure. Parsing eDSLs had been mentioned already - and their patriarch Parsec definitely worth digging into.

EDIT: with your list of implementation languages you're missing the most interesting eDSL opportunities. The most powerful and flexible eDSLs are made with metaprogramming. Scala-style (or even Haskell-style) eDSLs are based on high order functions, i.e., on mini-interpreters. They're more complicated in design, much less flexible and limited to the syntax of your host language.

SK-logic
  • 9,605
  • 1
  • 23
  • 35
  • My mentor for the project is actually one of the Haskell co creators interestingly enough. He is was enthusiastic for me to use Scala or Haskell but are you saying this may not be the best route to take? Also, I am unclear on the subject of metaprogramming? Could you give me a simple example? – seadowg Mar 18 '11 at 12:16
  • @Oetzi, by metaprogramming I mean C++ template metaprogramming, Lisp/Scheme macro metaprogramming, Nemerle macros, etc. An example of what can be done this way is here: http://www.meta-alternative.net/pfront.pdf Also, take a look at the embedded prolog implementations I've mentioned above. – SK-logic Mar 18 '11 at 13:04
0

boost::spirit if you're after C++ is an interesting example. Quote:

Spirit is a set of C++ libraries for parsing and output generation implemented as Domain Specific Embedded Languages (DSEL)...

(I have no idea what you mean by "solving concurrency" though. I don't see how you can solve "concurrency problems" in general, or how a DSEL could help.)

Mat
  • 202,337
  • 40
  • 393
  • 406
  • Whoops. I meant solving concurrency PROBLEMS. Not concurrency in general. As you say "concurrency" isn't really solvable in any way :). – seadowg Mar 18 '11 at 11:06