Live data from Hacker News

ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

research.sun.com

21–30 of 31 posts

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#21
post #14
post #13

Earlier quoted context omitted.

> and certainly not by better implementations of familiar constructs. Why not? I sort of took the slides as just that. For a good chunk of the slides he talks about the simple singly-linked list found in LISP. Then shows that implemented as a Tree (conc list), familiar operations still exist, but we get improvements by making operations more parallelizable. Slide 24 starts showing how `first`, `rest`, `append` can be…

Why not? Well, if first and rest are unsuitable for parallelism as Steele says, a programming edifice built on top of better implementations of those might be beside the point. My understanding of the slides is that we don't need better language runtimes to exploit parallelism for us while we continue to write the same kind of code as before; what we need is a new set of primitives (modeled by conc lists in this talk…

> My understanding of the slides is that we don't need better language runtimes to exploit parallelism for us while we continue to write the same kind of code as before;

Yes, I agree he was saying that, but that doesn't mean we can't change the implementations of what we use now to actually make it easier to do accomplish this.

> another thing - the transformation from cons to conc is nontrivial in the Lisp context because Lisp's code=data is so tied to cons. It might be an interesting to think about what programs would look like if you applied code=data rigorously in a conc model. Would a language whose expressions are represented as concs look or feel significantly different than a cons-based one?

But, you could still implement car and cdr in terms on conc, so this is not really an issue. It might not be the most efficient thing, but that's sort of the benefit of macros. Expand at compile time, and avoid the overhead. So, in summary, write macros in terms of an emulated cons cell, and use conc optimized primitives elsewhere.

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#22
post #21
post #14

Earlier quoted context omitted.

Why not? Well, if first and rest are unsuitable for parallelism as Steele says, a programming edifice built on top of better implementations of those might be beside the point. My understanding of the slides is that we don't need better language runtimes to exploit parallelism for us while we continue to write the same kind of code as before; what we need is a new set of primitives (modeled by conc lists in this talk…

> My understanding of the slides is that we don't need better language runtimes to exploit parallelism for us while we continue to write the same kind of code as before; Yes, I agree he was saying that, but that doesn't mean we can't change the implementations of what we use now to actually make it easier to do accomplish this. > another thing - the transformation from cons to conc is nontrivial in the Lisp context b…

But, you could still implement car and cdr in terms on conc, so this is not really an issue.

It might still be an issue. The more distance there is between how code is represented and how data and lower levels of code are represented, the less fluid programming in Lisp becomes. Yes, you can translate one to the other. But the sweet spot of Lisp is the space where no such mapping is needed or it's trivial; the magic drops off pretty sharply as you leave that space. It's not obvious (to me anyway) what the effect of what we're talking about would be. Small changes can have surprisingly big impacts, and one has to include the psychology of this.

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#23
post #14

Earlier quoted context omitted.

Why not? Well, if first and rest are unsuitable for parallelism as Steele says, a programming edifice built on top of better implementations of those might be beside the point. My understanding of the slides is that we don't need better language runtimes to exploit parallelism for us while we continue to write the same kind of code as before; what we need is a new set of primitives (modeled by conc lists in this talk…

I don't think so. Lisp code is already a tree.

It's a tree in the sense that a list is a tree.

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#24
I'd like to see somebody one-up this and say ``and lambda!''. What I mean is restricting explicit recursion/loops to combinators which respect algebraic laws (i.e. Backus's FP/FL) in order to get a better grip on program transformation to reach efficient implementation. Guy already hints at this by stressing the importance of MapReduce.

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#25
post #14

Earlier quoted context omitted.

Why not? Well, if first and rest are unsuitable for parallelism as Steele says, a programming edifice built on top of better implementations of those might be beside the point. My understanding of the slides is that we don't need better language runtimes to exploit parallelism for us while we continue to write the same kind of code as before; what we need is a new set of primitives (modeled by conc lists in this talk…

> It might be an interesting to think about what programs would look like if you applied code=data rigorously in a conc model. Would a language whose expressions are represented as concs look or feel significantly different than a cons-based one? Now that is food for thought.

Concatenative / point-free style? Guy already suggests this on p.68. Paraphrased, if data can be chopped in pieces, maybe code can too?

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#26
post #23

Earlier quoted context omitted.

I don't think so. Lisp code is already a tree.

It's a tree in the sense that a list is a tree.

No, it's really a tree structure. In fact lisp code is much like the abstract syntax tree that you get when you parse other languages.

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#27
post #17
post #15

Earlier quoted context omitted.

This is confusing the difference between concurrency and parallelism, the latter of which Clojure doesn't yet address. If your program is divided into threads, having a language like Clojure that makes concurrency easy and lock-free is a wonderful thing, and of course you get some benefit from running on multiple cores, though I don't think that's entirely the point. If, on the other hand, you're looking for a faster…

Ah yes, a silly mistake on my part. I am hoping that eventually Clojure will help the programmer write parallel algorithms, but you are correct in that such constructs don't exist in the language at this moment.

Like this?

http://github.com/richhickey/clojure/blob/26f5aed73c9cc2959b...

http://paste.lisp.org/display/84027

It's coming,

Rich

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#28
post #9
post #8

Earlier quoted context omitted.

That would be OK if Lisp wasn't list-based. In Lisp you always start at the beginning of the list: any processing requires going through that list somehow. Prolog allows some workaround to this problem by using difference lists.

Did you not read the talk? You can provide the car/cdr interface on top of tree-based implementations. Yes, you pay a cost to use that interface...but you pay a different (Guy Steele would argue more expensive) cost if you write your algorithms using car/cdr instead of, say, empty/singleton/conc . Moreover, as is pointed out on the slides , a lot of processing can happen without ever having to talk about car/cdr , e.…

My point was that Prolog works out of the box; not so with Lisp.

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#29
post #6
post #5

The language (and the features) presented in this presentation are from Fortress, which Guy and other Sun researchers have worked on for some time. On the project page one can download Fortress 1.0 and also check out Fortress 1.0 specification: http://projectfortress.sun.com/Projects/Community/ It's a pretty ambitious project and it looks like they are going to succeed. The focus of the language is to create a new Fo…

From Fortress and a few other languages. Like Scheme. In the talk at ICFP he said, he did this, because he likes them all. The video should come online soon. I hope ACM won't put it behind a pay wall.

the video is now online: http://www.vimeo.com/6624203

Re: ICFP '09: "Get rid of cons!" Guy Steele on parallel algorithms & data structures

#30
post #17

Earlier quoted context omitted.

Ah yes, a silly mistake on my part. I am hoping that eventually Clojure will help the programmer write parallel algorithms, but you are correct in that such constructs don't exist in the language at this moment.

Like this? http://github.com/richhickey/clojure/blob/26f5aed73c9cc2959b... http://paste.lisp.org/display/84027 It's coming, Rich

sweet. Another incf for Clojure.

Is there auto tree balancing?

Post reply on HN