[Haskell-cafe] On DSLs - one last time

John Van Enk vanenkj at gmail.com
Thu Oct 8 11:04:19 EDT 2009

To me, the "D" and "S" come in when I'm deciding what to support. The
"domain" represents the set of primitive operations I want to support. The
"specific" says that I don't support anything other than those operations.

Consider a language for laying out boolean logic circuits: we want to
implement only AND, OR, and XOR, and NOT. The domain is boolean logic. We
can't reason directly about trees or rainbows with this language, so it's

Our set of primitive operations would probably consist of:

1) Create input
2) Perform one of AND, OR, or XOR on two inputs (or proceeding inputs from
previous operations)
3) Apply a NOT to an operation.

With this basic set of operations, one can build up a graph of gates which
can then be executed directly, converted to some other intermediate form, or
plotted in graphical form. This is actually the focus domain of a small EDSL
I'm working on for demonstrative purposes. The following is a link to the
github repository and a direct link to one of the examples.


The example linked is a 4 bit adder (8 inputs, 4 outputs) that will dump
GraphViz 'dot' code.

This simple EDSL currently only allows you to construct graphviz, but the
intermediate Logic type could be transformed to just about anything having
to do with boolean logic or executed in place.

I hope some of this made sense.


2009/10/8 Günther Schmidt <gue.schmidt at web.de>

> Hi all,
> I'd like to summarize my impressions on the DSL issue, gathered from the
> responses to my posts.
> It is absolutely amazing, various people have shown here that it is
> possible to design languages within haskell that are almost or just as
> powerful and safe as haskell itself. It is probably even possible to create
> an EDSL within an EDSL within haskell.
> Amazing!
> Uhm...
> ... but in that case I really wonder why I should not use Haskell directly
> then.
> Because out of the EDSL I can clearly see the "E" and I can see the "L" but
> having slight problems figuring out where the "D" and the "S" come in.
> In short, yes it's great that you can create a language within Haskell so
> powerful that it's gone full circle and is general purpose again, but what
> good is that?
> The efforts I've seen here where efforts to create a rich and powerful
> syntax, but aren't we supposed to focus on expressing semantics specific to
> a problem in a DSL rather?
> I'm not trying to put the efforts and achievements of the people who have
> done such amazing work down, but what exactly is it that I missed?
> Günther
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091008/25479ffb/attachment.html

More information about the Haskell-Cafe mailing list