I'm looking at data-binary-754 right now, and it seems pretty complicated. Why don't they just cast the values bitwise to integers and then serialize those? Forgive my naivete-- I don't know much about binary encoding issues.
I went the route of implementing everything in C and then using the FFI. There's a lot of lot of bit-twiddling involved when you work with the guts of IEEE754, which is a lot easier to do in C. See http://github.com/patperry/hs-ieee/blob/master/cbits/feqrel_source.c for a truly ugly example. I ported this code from the Tango math library for D ( http://www.dsource.org/projects/tango/browser/trunk/tango/math/IEEE.d ). It's original author, Don Clugston, claims that the function is about as fast as a ">" comparison. Haskell's great, but I don't think it could get nearly as fast for a function like this. Patrick On Sun, Sep 19, 2010 at 11:16 PM, Conrad Parker <con...@metadecks.org> wrote: > On 20 September 2010 11:18, Patrick Perry <patpe...@gmail.com> wrote: >>> Given that IEEE is actually a standards body and they have many >>> standards, wouldn't it be more appropriate to call this library >>> ieee754? >> >> If it seems important to people, I'd be happy to change the name. I'm >> not religious about these things. Will it clutter up hackage, though? > > I reckon it's worth making it obvious that this library does 754 and > not, say, 1394 or 802.11 ;-) On the other hand if you intend on > expanding the package to implement every IEEE standard ... (j/k) > > Anyway, good work. Does this have any overlap with > data-binary-ieee754? There was some recent discussion here about the > encoding speed in that package. > > Conrad. > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe