Belated update: <br><br>The haskell-cnc distribution (if you grab it from darcs) now has a front-end that parses the graph description files.<br>    <a href="http://hackage.haskell.org/package/haskell-cnc">http://hackage.haskell.org/package/haskell-cnc</a><br>

<br>For any readers who haven&#39;t seen this before --  CnC is a parallel programming model that includes both a library and a small DSL for graph specification.  The specification file describes the structure of an application and captures various invariants about data access.<br>

<br>The CnC front-end in the haskell-cnc distro is meant to replace existing CnC spec &quot;translators&quot; and generate code for all host languages that support the programming model (currently C++, Java, .NET, Haskell).  Also the graph specification language is getting a refresh in the process (new features/syntax).  The parser is done with Happy.  What&#39;s there right now  only generates C++ code, but the Haskell codegen is straightforward and should come along shortly (anyone want to help?).<br>

<br>The purpose of such a front-end is to generate code that:<br>

  (1) saves boilerplate in graph construction (more of a problem in non-haskell languages)<br>

  (2) correctness: enforces invariants expressed in the specification<br>

  (3) performance: generate code that embodies graph analysis and optimizations (based also on profiling data)<br>

<br>Cheers,<br>  -Ryan<br><br><br><div class="gmail_quote">On Fri, Jun 25, 2010 at 11:02 AM, David Peixotto <span dir="ltr">&lt;<a href="mailto:dmp@rice.edu">dmp@rice.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div style="word-wrap: break-word;"><div>There is a reference for the CnC grammar in the repository for the .NET implementation. </div><div><br></div><a href="http://github.com/dmpots/CnC.NET/blob/master/CnC.NET/CnC.NET/cnc.grammar" target="_blank">http://github.com/dmpots/CnC.NET/blob/master/CnC.NET/CnC.NET/cnc.grammar</a><div>

<br></div><div>The parser specification for fsyacc (the F# YACC implementation) is here:</div><div><br></div><div><a href="http://github.com/dmpots/CnC.NET/blob/master/CnC.NET/CnC.NET/Parser.fsy" target="_blank">http://github.com/dmpots/CnC.NET/blob/master/CnC.NET/CnC.NET/Parser.fsy</a><br>

<div><br></div><div>The textual representation is still in flux a bit, but this grammar should be enough of a guide for implementing a parser in Haskell. The grammar is left recursive, so using a parser generator like Happy would be a good choice.</div>

<div><br></div><div>The textual representation will actually be a bit different depending on the underlying language since the types of items stored in a collection is part of the description. For example in C, an item collection that stores an array of ints would be declared like:</div>

<div><br></div><div>[int* A];</div><div><br></div><div>but in Haskell we would want to write something like</div><div><br></div><div>[Array Int Int A];</div><div><br></div><div>I think dealing with type declarations would in the textual representation would be the main difference in implementing the parser in Haskell. Once the textual representation has been parsed to an AST it should be possible to generate the Haskell code that builds the graph using the haskell-cnc package.</div>

<div><br></div><div>-David</div><div><br><div><div><div></div><div class="h5"><div>On Jun 23, 2010, at 3:56 PM, Vasili I. Galchin wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5"><br><br>

<div class="gmail_quote">On Wed, Jun 23, 2010 at 3:47 PM, Don Stewart <span dir="ltr">&lt;<a href="mailto:dons@galois.com" target="_blank">dons@galois.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


vigalchin:<br>
<div><div></div><div>&gt; Hello,<br>
&gt;<br>
&gt;      I have been reading work done at Rice University:  http://<br>
&gt; <a href="http://habanero.rice.edu/cnc" target="_blank">habanero.rice.edu/cnc</a>. Some work has been done by <a href="http://www.cs.rice.edu/" target="_blank">http://www.cs.rice.edu/</a><br>
&gt; ~dmp4866/ on CnC for .Net. One component that David wrote a CnC translator that<br>
&gt; translates CnC textual form to the underlying language, e.g. F#. Is anybody<br>
&gt; working on a CnC textual form translator for Haskell so a Haskell user of CnC<br>
&gt; Haskell can write in a higher level??<br>
<br>
</div></div>Ah, so by a translator from high level CnC form to this:<br>
<br>
    <a href="http://hackage.haskell.org/packages/archive/haskell-cnc/latest/doc/html/Intel-Cnc.html" target="_blank">http://hackage.haskell.org/packages/archive/haskell-cnc/latest/doc/hml/Intel-Cnc.html</a><br>
<br></blockquote><div>           ^^ exactly what I mean<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
? Do you have a reference for the &quot;CnC textual form&quot;?<br></blockquote><div>             ^^ if you mean something like a context-free grammatical definition of the &quot;CnC textual form&quot; ,,, the answer is I haven&#39;t seen such a reference.<br>


<br>V.<br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<font color="#888888"><br>
-- Don<br>
</font></blockquote></div><br></div></div><div class="im">
_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>

</div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>