2006-06-25

The semester is almost ending (more 2, 2.5 weeks and it's all finished). I'm trying to take as much time as I can to deal with the project. Some (confusing) news:
  • Judy.Map/Map2/MapSL: Map now uses any Stringable (methods toString and fromString) type as index type, and any Refeable (has methods to map to Value type) type as Index. Map is using JudyHS (strings with lengths) as backend, and MapSL uses JudySL (null terminated strings). Map2 is built on top JudyL (keys are pointer-sized values), so it uses Refeable types as index too.
  • Iter "situation": I'm suspecting HSIter code has problems, don't know if it's in my bindings or in spinclad tree, still need to debug, which means still need to learn how to debug Haskell code (it seems to be difficult/impossible make it play nicely with gdb). The "situation" is: Iter code is segfaulting when a lot of memory is being used before calling HSIter related functions.
  • Pugs: As Map isn't fully functional (because of Iter problems), I used MapSL to be the backend for IHash type in Pugs, no much time improvements, but at least compiled/runned_tests fine. The interface is the same as Map, so changing between is easy AND Map will perform better.
  • CollectionsM: I started with MapM class, it's being used by the three map types.
  • Possible bug in GHC: http://www.haskell.org//pipermail/glasgow-haskell-users/2006-June/010389.html
  • Missing stuff: Nothing in benchmark area yet, I will looking for nice examples/algorithms to include as benchmark for Set and Map types. I'm not staying online in #haskell as much as I wanted, hope fix this when semester ends. I didn't talk about finalizer stuff here, but will as soon as I have something concrete.
PS: I probably should split this points in more than one post, and try to illustrate some points more (ie. post some code =) ).

2006-06-16

  • BitSet: Seems to be working nice. Needs a benchmark comparing with other implementations. However, replacing IntSet on Pugs doesn't seem to get much improvement (tests were inconclusive, but looks like BitSet is only a little bit better). But the use of this datatype in Pugs is very limited, so BitSet wasn't fully exercised.
  • Judy.Map: Did a Map type on top of JudyHS, it uses StablePtr as values and any "Stringable" type as keys. Stringable means that there's a injective function from type to Strings, as JudyHS use Strings as index type. I'm thinking in use some class stuff to deal with values too, so default implementation uses StablePtr, but will be easy to do specialized implementation for Int, for example (don't need SPtr in this case, just save the Int).
  • Pugs: I'm trying to figure out how IHash works in Pugs, so I can test Judy.Map in Pugs code. Let's see what happens.
  • My next steps: As Bulat, and later AudreyT, suggested I'm working on a CollectionM and MapM classes based on Collections interface. Some benchmark for BitSet and Map will be nice to have too.

2006-06-07

Short updates

  • StablePtrs and BitSet: I discovered that StablePtrs are not fit to used as indexes for external arrays, that is because for the same haskell "value", GHC may create different objects on the heap. So for BitSet, inspired on Edison (library of pure functional data structures), we created a type-class HashIO, that maps a type into a Value, so this Value can be used as index in Judy Arrays. If the type is also ReversibleHashIO, there is a function that lists all index elements in a BitSet.
  • Judy basic FFI: the missing part to be tested is JudyHSIter. Recently spinclad changed HSIter code to use m4 macros instead of CPP macros. I still have to test it.
  • My next steps: audreyt mentioned that a good test might be using BitSet instead of StateT IntSet in Pugs.Prim code. I'll try to make it happen. Also learning about Cabal packages, to get HsJudy cabalized. And last but no least, I'm downloading code from collections and Edison to take a look. These steps may be slown down by some school assignments due next week.

About Me