[Haskell-cafe] Is Haskell capable of matching C in string processing performance?

John Millikin jmillikin at gmail.com
Sat Jan 23 12:53:46 EST 2010


I'm using UCS-4, with uint32_t.

On Sat, Jan 23, 2010 at 03:43, Taru Karttunen <taruti at taruti.net> wrote:
> Excerpts from John Millikin's message of Fri Jan 22 19:40:58 +0200 2010:
>> Correct me if I'm wrong, but ByteStrings can't contain non-ASCII
>> values, right? I'm looking for something like this pseudo-C:
>>
>>     typedef void (*Callback)(const uint32_t *chars, size_t n_chars, void *);
>>     WriterState *new_state (Callback, void *);
>>
>> I tried using the Text type, but its conversions to Ptr Word16 are all
>> O(n) -- not much better than String.
>
> Are you using unicode on the C side with wchar_t?
>
> You can have utf-8 inside ByteStrings.
>
> - Taru Karttunen
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list