[Agda] Does Agda2 have fast arrays?

Andreas Abel andreas.abel at ifi.lmu.de
Sun Oct 3 09:50:06 CEST 2010


On Oct 3, 2010, at 7:59 AM, Don Stewart wrote:
> nad:
>> On 2010-10-02 18:17, Don Stewart wrote:
>>> Could Agda target one of the high performance array libraries in
>>> Haskell?  E.g. repa or vector?
>>
>> Agda has a Haskell FFI, so that should be easy, assuming that the
>> library APIs don't use too exotic types. However, Agda code is  
>> compiled
>> into Haskell by inserting unsafeCoerce almost everywhere, so I  
>> would not
>> expect good performance, especially if REWRITE pragmas are involved.
>>
>
> What can we do about the coercions? I suspect they make GHC sad.

The current excessive amount of coercions is not needed.  One could  
write a better compiler using Pierre Letouzey's techniques, who did  
the Coq extraction procedure.  The raw idea is to combine compilation  
with a Hindley-Milner type inference which inserts coercions for you  
when it encounts a type error.


Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel at ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/



More information about the Agda mailing list