Stroustrup's talk on C++0x

Ingo Oeser ioe-news at rameria.de
Thu Aug 23 14:23:14 PDT 2007


Downs wrote:
> Ingo Oeser wrote:
>> - More explicit loop notion which can do map(), reduce(), filter().
> See also my "Some tools for D" post. I implemented those with iterators,
> but they're trivial to do as freestanding functions.

Ok, with your tools, I could already CODE like that right now
and remove the "import iter;" later. Thanks for that :-)

But I want to express that there isn't any defined order of execution, 
as long as data flow is correct. And of course I would like them
overloadable to compose and distribute them driven by data flow.

I just like to express the data flow more explicitly instead of 
depending on the optimizer to figure it out himself. Let's help the
optimizer greatly here.

> GCC has autovectorization support in principle, so whenever the gdc
> maintainer gets around to fixing the tree format for statements, gdc
> will be able to take advantage of this.

I know. But this is just a side effect for me and is the compiler guessing
himself, that I do map(), reduce(), filter().

The optimizer is more useful to the programmer doing 
(memory) copy elimination and life time analysis, so the programmer
can write more readable code by using more temporaries.

>> - Please remove the inXX() and outXX() intrinsics.
>>   They are oneliners in asm on X86 and not present on many architectures.
>> 
> I don't know those; what do they do?

They provide port io (IN PORT and OUT PORT) on X86.
in Intel syntax for your reference.

OUT PORT
mov dx,IOport
mov al,Value
out dx,al

IN PORT
mov dx,IOport
in al,dx
mov ReturnValue,al

These are of course privileged operations and the compiler 
doesn't actually know your privilege level. So this kind of intrinsic
is just nonsense. It is also non-sense in a standard library, since >99%
of all programs out there don't need to do that and the rest codes
it either in assembly or uses a special API for that.


Best Regards

Ingo Oeser



More information about the Digitalmars-d mailing list