[Yhc] ByteString

Neil Mitchell ndmitchell at gmail.com
Fri Jun 15 07:54:48 EDT 2007


Hi Creighton,

> I think Neil means here that you can't write a .cabal file, for code
> that uses Data.ByteString, that will work unchanged with ghc 6.4 and ghc
> 6.6, since the module is in a different package in each case.

Neil means he's been bitten by ByteString and Cabal many many times... :-)

After discussing with Malcolm, we think a cleaner (and potentially
faster) way to go would be move to plain old String. Most of the
strings in Yhc are short - something ByteString isn't particularly
optimised for. String is also faster than PackedString, the only
reason for PackedString was memory requirements, but that stopped
being an issue years ago.

So in essence, a port from PackedString to String is probably the best
way to go!

The way I'd go about this is:

1) Write a String implementation of the interface we use for PackedString

2) Start inlining the implementation manually, function by function

That way you should have relatively little work to move to String, and
should be able to then patch by patch move towards a proper use of
String, without doing one big change.

Thanks

Neil


More information about the Yhc mailing list