From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA07293; Tue, 4 Mar 2003 17:11:18 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA06925 for ; Tue, 4 Mar 2003 17:11:16 +0100 (MET) Received: from jah.cs.unm.edu (mail.cs.unm.edu [64.106.20.33]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h24GBFH24400 for ; Tue, 4 Mar 2003 17:11:15 +0100 (MET) Received: from chipotle.cs.unm.edu ([64.106.21.127] ident=wneumann) by jah.cs.unm.edu with esmtp (Exim 3.36 #2) id 18qF0c-0001rz-00 for caml-list@inria.fr; Tue, 04 Mar 2003 09:11:14 -0700 Date: Tue, 4 Mar 2003 09:14:28 -0700 (MST) From: "William D. Neumann" To: caml-list@inria.fr Subject: Re: [Caml-list] [RANT] String representation (was: Strings as arrays or lists...) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; caml-list:01 rant:01 pons:01 buffer:01 low-level:01 encodings:01 shifts:01 ors:99 chest:99 arrays:01 fernandez:01 ints:01 ocaml:01 byte:01 ops:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 4 Mar 2003, Diego Olivier Fernandez Pons wrote: > > - there is a buffer type which is a byte array for low-level > > operations, and conversion functions between buffers and strings, > > with several possible encodings; > > Yes... strings. Unfortunately strings don't act like byte arrays (to the best of my knowledge anyway -- I'd love to find out I'm wrong). If you want to do any low level operations on the bytes, you first need to convert the chars to ints (and by low level, I'm talking about shifts, rotates, ands, ors, xors, etc), perform your ops, then convert back to chars before re-inserting them into the string, and this is slooooow. Since I do crypto for a living, I run into these problems all the time. fortunately, they haven't forced me to drop OCaml for C in general, but I have had to step back into C for a couple of programs that really needed the extra speed boost. Efficient byte and word arrays would be wonderful tools to add to my chest. William D. Neumann --- "Well I could be a genius, if I just put my mind to it. And I...I could do anything, if only I could get 'round to it. Oh we were brought up on the space-race, now they expect you to clean toilets. When you've seen how big the world is, how can you make do with this? If you want me, I'll be sleeping in - sleeping in throughout these glory days." -- Jarvis Cocker ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners