System programming in D (Was: The God Language)

Iain Buclaw ibuclaw at ubuntu.com
Thu Jan 5 15:00:36 PST 2012


On 5 January 2012 22:22, Manu <turkeyman at gmail.com> wrote:
> On 6 January 2012 00:17, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
>>
>> On 5 January 2012 22:11, Manu <turkeyman at gmail.com> wrote:
>> > So regarding my assumptions about translating the D front end
>> > expressions to
>> > GCC? Is that all simpler than I imagine?
>> > Do you think GDC generates optimal code comparable to C code?
>> >
>> > What about pure functions, can you make good on optimisations like
>> > caching
>> > results of pure functions, moving them outside loops, etc?
>> >
>> >
>>
>> I think you are confusing the pure with memoization.  I could be wrong
>> however... :)
>
>
> Umm, maybe... but I don't think so.
> And I don't think you just answered either of my questions ;)

What I meant was, pure attribute will only allow the compiler to
reduce the number of times the function is called in certain
circumstances. However it makes no guarantees that it will do so, only
if it think it's appropriate.

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list