Re: Using `string` vs `seq[uint8]` for non-text data

2017-09-21 Thread Araq
Yes, use `seq[byte]` already.


Re: Using `string` vs `seq[uint8]` for non-text data

2017-09-21 Thread def_pri_pub
Sorry to be a bit of a pest, but I want to know if this is the thing I should 
be doing or not for my Nim code now?


Re: Using `string` vs `seq[uint8]` for non-text data

2017-09-19 Thread def_pri_pub
Okay, that sounds better to me. So for in my case with my stb_image wrapper, 
should I switch the API now to use seq[byte] or should I hold off on it for a 
little longer?


Re: Using `string` vs `seq[uint8]` for non-text data

2017-09-17 Thread Araq
> In the issue ticket I linked, Eduardo Bart mentioned that int the Nim 
> codebase that string is also used as a buffer (instead of a seq[uint8]), e.g. 
> readFile() and writeFile(). Where even the data those procs could be 
> returning binary and not text.

That is correct. But in the longer term we'll be forced to use `seq[byte]` more 
and more. The reason? Often the serialization format (JSON) distinguishes 
between Unicode text and bytes.