# Lucid

### From HaskellWiki

EndreyMark (Talk | contribs) m (grammar correction) |
EndreyMark (Talk | contribs) (/*Implementation*/: gets new subsections /*Fast-food*/, /*Arrow*/, - →Comonad: , and add a link to a comonad page) |
||

Line 14: | Line 14: | ||

== Implementation == | == Implementation == | ||

+ | |||

+ | === fast-food === | ||

A fast-food implementation: | A fast-food implementation: | ||

Line 26: | Line 28: | ||

In fact, <code>first</code>, <code>next</code>, <code>fby</code> are not necessarily primitives in Lucid, but this fast-food implementation treats them as primitives. | In fact, <code>first</code>, <code>next</code>, <code>fby</code> are not necessarily primitives in Lucid, but this fast-food implementation treats them as primitives. | ||

+ | === Arrow === | ||

A better implementation could be written using the [[arrow]] library available at the [http://www.haskell.org/arrows/download.html Downloads page of Arrows: A General Interface to Computation] written by [http://www.galois.com/~antony/ Antony Courtney], | A better implementation could be written using the [[arrow]] library available at the [http://www.haskell.org/arrows/download.html Downloads page of Arrows: A General Interface to Computation] written by [http://www.galois.com/~antony/ Antony Courtney], | ||

[http://www.cs.nott.ac.uk/~nhn/ Henrik Nilsson] and | [http://www.cs.nott.ac.uk/~nhn/ Henrik Nilsson] and | ||

[http://www.soi.city.ac.uk/~ross/ Ross Paterson]. | [http://www.soi.city.ac.uk/~ross/ Ross Paterson]. | ||

+ | |||

+ | === Comonad === | ||

A professional approach based on comonads: | A professional approach based on comonads: | ||

see [http://www.cs.ioc.ee/~tarmo/papers/aplas05.pdf The Essence of Dataflow Programming] paper written by [http://www.cs.ioc.ee/~tarmo/ Tarmo Uustalu]. | see [http://www.cs.ioc.ee/~tarmo/papers/aplas05.pdf The Essence of Dataflow Programming] paper written by [http://www.cs.ioc.ee/~tarmo/ Tarmo Uustalu]. | ||

− | Comments on this paper can we read in [http://lambda-the-ultimate.org/node/988 Lambda the Ultimate] (but the link given there seems to be broken). | + | Comments on this paper can we read in [http://lambda-the-ultimate.org/node/988 Lambda the Ultimate] (but the link to the mentioned given there seems to be broken, I have given an updated one here). The links to pages introducing the concept of comonad are [http://www.cs.helsinki.fi/u/ekarttun/comonad/ Comonads and Haskell] written by [http://www.haskell.org/tmrwiki/EinarKarttunen Einar Karttunen]. |

## Revision as of 18:32, 11 June 2006

## Contents |

## 1 Introduction

Weblogs Forum: Fluid Programming in Lucid -- good examples, and very good links.

Lucid page written by Bill Wadge, including an excerpt from Lucid Primer book.

Wikipedia article (yet a stub, but useful links).

## 2 Details

The most detailed online material on the details of this language I could find: Raganswamy Jagannathan, Chris Dodd. GLU programmer's guide (downloadable as the 4th paper of GIPSY Publications). The first pages seem to discuss other problems, but it is worth of reading further, because a detailed description of Lucid's syntax and semantics is hiding inside this paper (section 3.1.2 on pages 22--38). This paper is part of the Gipsy Project Home Page (GIPSY: A General Intensional Programming System).

## 3 Implementation

### 3.1 fast-food

A fast-food implementation:

written to mimick and test the following Lucid example (I have made it a little Haskell-like):
```
```

```
```average n = sum n / card
sum n = **first** n **`fby`** (sum n + **next** n)
card = 1 **`fby`** succ card

```
In fact,
```

`first`

, `next`

, `fby`

are not necessarily primitives in Lucid, but this fast-food implementation treats them as primitives.

### 3.2 Arrow

A better implementation could be written using the arrow library available at the Downloads page of Arrows: A General Interface to Computation written by Antony Courtney, Henrik Nilsson and Ross Paterson.

### 3.3 Comonad

A professional approach based on comonads: see The Essence of Dataflow Programming paper written by Tarmo Uustalu. Comments on this paper can we read in Lambda the Ultimate (but the link to the mentioned given there seems to be broken, I have given an updated one here). The links to pages introducing the concept of comonad are Comonads and Haskell written by Einar Karttunen.