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 WAA18738; Wed, 6 Feb 2002 22:49:43 +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 WAA19589 for ; Wed, 6 Feb 2002 22:49:42 +0100 (MET) Received: from gogol.zorgol (Mix-Montsouris-113-2-127.abo.wanadoo.fr [80.9.109.127]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g16LneT17975 for ; Wed, 6 Feb 2002 22:49:40 +0100 (MET) Received: (qmail 22721 invoked by uid 1001); 6 Feb 2002 21:36:40 -0000 Date: Wed, 6 Feb 2002 22:36:40 +0100 From: Berke Durak To: Xavier Leroy Cc: caml-list@inria.fr Subject: Re: [Caml-list] Suggestion for Int32.rotate Message-ID: <20020206223640.A13273@gogol.zorgol> References: <20020205000643.A31440@gogol.zorgol> <20020206190151.A9371@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020206190151.A9371@pauillac.inria.fr>; from xavier.leroy@inria.fr on Wed, Feb 06, 2002 at 07:01:51PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Feb 06, 2002 at 07:01:51PM +0100, Xavier Leroy wrote: > > 2) A syntax extension (or extension to the standard syntax) for > > entering Int32 and Int64 constants. > > This has been on my to do list for a while. The main issue is finding > a decent syntax... (All discussions on this list seem to converge on > syntax these days, that's awful :-) We have three "big integer" types: > int32, nativeint and int64. A C-style syntax would be 12345L for > int32 and 123456789LL for int64; what about nativeint? 12345N ? > Anything nicer? I'd suggest lowercase 'l' for 32-bit and uppercase 'L' for 64-bit : 0xffffffffl = -1 32-bit signed 0xffffffffffffffffL = -1 (64-bit signed) 1239884378742340923094029042n bigint Maybe 'z' instead of 'n' sound better ? > > 3) A hack into Printf to remove the need to use Int32.format > > Printf support was added in 3.04: "%ld", "%nd", "%Ld" for int32, > nativeint and int64 respectively. Wonderful, that's a good reason to upgrade. [...] > More generally speaking, I don't think basic ciphers and hash > functions really benefit from being rewritten in Caml. > [...] So, why not just interface with existing C > implementations -- with the additional benefits that someone else > already debugged and performance-tweaked them? Granted that Caml doesn't make coding low-level cryptographic primitives (at least, usual bit-fiddling ones) easier or safer. However, when you want to implement a new crypto algorithm to do some empirical cryptanalysis on it (statistical tests etc.) it's painful to have to implement it in C, then interface C to Caml. I'd rather write it directly in Caml. Being able to interface to C is an excellent feature, but I'd also like to be able to do everything reasonably efficiently in Caml. Further, if I write my algorithms in Caml, one day if the compiler becomes smart enough it can be as efficient as C. So, what about the rotate ? -- Berke Durak ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr