Loading ...
Sorry, an error occurred while loading the content.

Re: [stack] Parallel computing is concatenative

Expand Messages
  • Magnus Jonsson
    ... Good point. ... 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
    Message 1 of 36 , Nov 11, 2006
    View Source
    • 0 Attachment
      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
      >
    • Manfred Von Thun
      On 7/12/06 7:45 PM, Manfred Von Thun wrote: [..] OOOPS - a little error: in the 7-th line below, replace the ³uncons² by
      Message 36 of 36 , Dec 11, 2006
      View Source
      • 0 Attachment
        On 7/12/06 7:45 PM, "Manfred Von Thun" <m.vonthun@...> wrote:

        [..]

        OOOPS - a little error:
        in the 7-th line below, replace the ³uncons² by ³uncons first².

        > However, in Joy the two lists [11 22 33 44 55]
        > and [11 [22 [33 [44 [55]]]]] do not mean the same
        > at all. The first is the usual notation for lists, and the
        > second I have never really used. Looking at dc made
        > me wonder whether perhaps one should.
        >
        > Joy: [11 [22 [33 [44 [55]]]]] i ==
        > [11 [22 [33 [44 [55]]]]] uncons
        >
        > dc: [11 [22 [33 [44 [55]]]]] x # x = i in Joy
        >
        > The three programs above (two Joy, one dc) all
        > do exactly the same to the stack.



        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.