On Sat, 11 Nov 2006, Christopher Diggins wrote:

> While this is hard to parallelize, the following equivalent program:

>

> define length { triple [square] map [+] reduce sqrt }

>

> is trivial to parallelize (map and reduces can be implemented as

> concurrent primitives).

Good point.

> transform {

> x:(A:any)->(B:any) rot x rot x rot

> y:(B:any B)->(B:any) y

> }

> -> {

> cons cons

> [x] map

> [y] reduce

> }

>

> So what I am proposing with Mutt is a language for rewriting typed

> concatenative programs.

You are probably aware of this already, but I'll mention it anyway: This

approach has been used with great success in the haskell community to

express library specific optimizations. The brightest example is

the ByteString library.

http://web.mit.edu/ghc/www/users_guide/rewrite-rules.html
/ Magnus

> On 11/11/06, Magnus Jonsson <magnus@...> wrote:

>>

>>

>> I would argue the opposite, that the stack model is lousy for

>> expressing parallel programs because it forces everything to be sequenced

>> by the programmer. Simple relationships between inputs and outputs are

>> obscured by stack shuffling.

>>

>> compare:

>>

>> length x y z = sqrt (square x + square y + square z)

>>

>> : length ( x y z -- length )

>> square rot square rot square rot sqrt ;

>>

>> How can you parallelize length without essentially abandoning the stack

>> shuffling representation of your program?

>>

>> / Magnus

>