[haskell-llvm] Limitation of API - omissions or design?
Henning Thielemann
lemming at henning-thielemann.de
Thu Dec 16 16:17:04 EST 2010
Maciej Piechotka wrote:
> On Thu, 2010-12-16 at 14:23 +0100, Henning Thielemann wrote:
>> On Thu, 16 Dec 2010, Maciej Piechotka wrote:
>>
>>> I use this technique often. Well the code is secure but I have things
>>> like infinite space of values of infinite space of functions.
>> What do you mean with 'space'? According to LLVM doc open arrays shall be
>> implemented using arrays of size zero while relying on LLVM not to do any
>> boundary checks.
>>
>
> I mean tree. Something like (simplified and for functions operating only
> on ints):
>
> data SymbolSpace a = SymbolSpace (a TypeNum) (SymbolSpace a TypeNum)
I am wondering why SymbolSpace has one parameter 'a' on the left hand
side, two arguments on the right side - 'a' and 'TypeNum'.
I see, you need recursive types. They are handled in a special way in LLVM:
http://llvm.org/docs/LangRef.html#t_uprefs
I remember that they are not supported in Haskell-llvm wrapper and I
helped myself with a void pointer that (in your case) I have to cast to
a (Ptr SymbolSpace).
It's an interesting challenge to model this in Haskell.
More information about the Haskell-llvm
mailing list