From: Unknown Date: 2007-02-09T21:46:59+09:00 Subject: Re: String.ord On Fri, 9 Feb 2007, Steven Lumos wrote: > There must be some kind of impedance mismatch going on here. Is > somebody really arguing that maybe it should NOT be possible to read > binary data into a String and process individual bytes efficiently? > > Use cases? > > - any kind of image processing > - implementing maybe half of all Internet protocols > - data compression > - error correction > - encryption > - Efficient XML Interchange [1] > > Stop thinking of strings like 'hello world' and start thinking of > strings like TCP headers. If anyone wants to argue that it should be > arbitrarily impossible / inefficient / inconvenient to implement TCP > in Ruby then I think the burden of proof should be on them. > > Maybe you mean to argue that String should not be used for non-textual > data, even though it always has been before. In that case maybe we > need something like NArray in core. (In core, not ext, please.) > > Steve > > [1] In fact, see http://www.w3.org/TR/xbc-use-cases/ for a whole > stack of use cases. > I dont belive you ever used String class (C++) for Bitmap processing or TCP headers parsing. For Bitmap you usualy have char pic[n] and for TCP some kind of struct. Maybe indeed Ruby needs some kind of native char array class.