[bitc-dev] Code for bitc_vector_string

Sam Mason sam at samason.me.uk
Mon Jul 3 14:55:02 EDT 2006


On Mon, Jul 03, 2006 at 02:28:30PM -0400, Jonathan S. Shapiro wrote:
> If you are able to donate the code, we'ld be glad to take it.

sorry, forgot to include the patch. . .

> The problem is that
> expr[ndx] is a location expression, and we don't have the type system
> support for generalized locations.

OK, I'll wait and see how things turn out!

> And it won't help with arrays, because the length of the array is part
> of its type and there is no way to do literal class. What's needed here
> is a type that is something like like:
> 
>   (forall ((Indexable 'a) (Word sz)) (array 'a sz))
> 
> Note that 'Word' isn't a type class here -- it's a literal class. BitC
> doesn't have those, and probably never will. Arrays are actually the
> only motivating case, and they exist solely for legacy reasons.

In Haskell some libraries advocate encoding peano numbers in the type
system.  But it's not much fun to use and probably overkill for arrays.


  Sam

p.s. has the compiler been in a bad state for the past couple of days?
I've got some code that used (I don't think I've changed it too much)
to work, but now causes the compiler to fail an assertion.


More information about the bitc-dev mailing list