Lambda the Ultimate

inactiveTopic The dominant paradigm
started 11/27/2003; 3:18:44 AM - last post 11/27/2003; 1:27:43 PM
David B. Wildgoose - The dominant paradigm  blueArrow
11/27/2003; 3:18:44 AM (reads: 202, responses: 3)
You will find tens of thousands of loops written in C/C++ that amount to

for (ListElement* p = head; p; p = p->next) { ... }

That is the dominant paradigm. It stinks. It is holding us back.

The old ways hold us back, (you may need to scroll down to the November 10th article).

Christopher Cambell - Re: The dominant paradigm  blueArrow
11/27/2003; 7:59:43 AM (reads: 188, responses: 0)
So what are the alternatives?

Bart van der Werf (Bluelive) - Re: The dominant paradigm  blueArrow
11/27/2003; 10:18:25 AM (reads: 171, responses: 0)
The paper suggests a few things.

foreach, filters and paralel processing of elements.

Dominic Fox - Re: The dominant paradigm  blueArrow
11/27/2003; 1:27:43 PM (reads: 160, responses: 0)

Friend of mine used to write machine code for Crays, which had (as he told it, as I remember) vector operations built in, along with parallel execution pipelining of some sort - so you would execute one instruction to load up a vector, do some other stuff while it was happening, then come back and collect the results. I would imagine that writing a compiler for that architecture would present some interesting challenges. But also, I don't see why a reasonably smart compiler shouldn't be able to recognise for-loops as above and optimize accordingly - I know C/++ ostensibly exposes "real" pointers to "real" memory addresses for manipulation, but that's no reason why a compiler shouldn't treat what looks like pointer-hopping traversal over a linked list as an abstraction rather than implementation gospel. In other words, forget that C is "portable assembler" and pretend it's a somewhat higher-level language than it really is. As is no doubt evident, I have no idea of how difficult this would actually be to do...