Re: [Haskell-cafe] adding recursion to a DSL

2013-02-19 Thread Emil Axelsson
You probably don't need recursion in the DSL for this (that would require a way to detect cycles in the expressions). For this example, it looks like all you need is to add something like `map` as a DSL construct. Your example could perhaps be expressed as forEach (1,1000) (\n - out

Re: [Haskell-cafe] adding recursion to a DSL

2013-02-19 Thread Edsko de Vries
Hi Joerg, You might find Abstract Syntax Graphs for Domain Specific Languages by Bruno Oliveira and Andres Löh ( http://ropas.snu.ac.kr/~bruno/papers/ASGDSL.pdf) a helpful reference to adding things like recursion (and other binding constructs) to your DSL. Edsko On Tue, Feb 19, 2013 at 9:47

[Haskell-cafe] adding recursion to a DSL

2013-02-17 Thread fritsch
I have a tiny DSL that actually works quite well. When I say import language.CWMWL main = runCWMWL $ do out (matrixMult, A, 1, row, matrix-row) then runCWMWL is a function that is exported by language.CWMWL. This parses the experession and takes some action. Now, A is the name of the