[Haskell-cafe] CnC Haskell

Ryan Newton newton at mit.edu
Thu Sep 2 20:23:02 EDT 2010


Belated update:

The haskell-cnc distribution (if you grab it from darcs) now has a front-end
that parses the graph description files.
    http://hackage.haskell.org/package/haskell-cnc

For any readers who haven'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.

The CnC front-end in the haskell-cnc distro is meant to replace existing CnC
spec "translators" 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's there right now
only generates C++ code, but the Haskell codegen is straightforward and
should come along shortly (anyone want to help?).

The purpose of such a front-end is to generate code that:
  (1) saves boilerplate in graph construction (more of a problem in
non-haskell languages)
  (2) correctness: enforces invariants expressed in the specification
  (3) performance: generate code that embodies graph analysis and
optimizations (based also on profiling data)

Cheers,
  -Ryan


On Fri, Jun 25, 2010 at 11:02 AM, David Peixotto <dmp at rice.edu> wrote:

> There is a reference for the CnC grammar in the repository for the .NET
> implementation.
>
> http://github.com/dmpots/CnC.NET/blob/master/CnC.NET/CnC.NET/cnc.grammar
>
> The parser specification for fsyacc (the F# YACC implementation) is here:
>
> http://github.com/dmpots/CnC.NET/blob/master/CnC.NET/CnC.NET/Parser.fsy
>
> 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.
>
> 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:
>
> [int* A];
>
> but in Haskell we would want to write something like
>
> [Array Int Int A];
>
> 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.
>
> -David
>
> On Jun 23, 2010, at 3:56 PM, Vasili I. Galchin wrote:
>
>
>
> On Wed, Jun 23, 2010 at 3:47 PM, Don Stewart <dons at galois.com> wrote:
>
>> vigalchin:
>> > Hello,
>> >
>> >      I have been reading work done at Rice University:  http://
>> > habanero.rice.edu/cnc. Some work has been done by
>> http://www.cs.rice.edu/
>> > ~dmp4866/ on CnC for .Net. One component that David wrote a CnC
>> translator that
>> > translates CnC textual form to the underlying language, e.g. F#. Is
>> anybody
>> > working on a CnC textual form translator for Haskell so a Haskell user
>> of CnC
>> > Haskell can write in a higher level??
>>
>> Ah, so by a translator from high level CnC form to this:
>>
>>
>> http://hackage.haskell.org/packages/archive/haskell-cnc/latest/doc/hml/Intel-Cnc.html<http://hackage.haskell.org/packages/archive/haskell-cnc/latest/doc/html/Intel-Cnc.html>
>>
>>            ^^ exactly what I mean
>
>
>> ? Do you have a reference for the "CnC textual form"?
>>
>              ^^ if you mean something like a context-free grammatical
> definition of the "CnC textual form" ,,, the answer is I haven't seen such a
> reference.
>
> V.
>
>
>
>> -- Don
>>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> _______________________________________________
> 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/20100902/b9c76242/attachment.html


More information about the Haskell-Cafe mailing list