caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Berke Durak <berke@altern.org>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Suggestion for Int32.rotate
Date: Wed, 6 Feb 2002 22:36:40 +0100	[thread overview]
Message-ID: <20020206223640.A13273@gogol.zorgol> (raw)
In-Reply-To: <20020206190151.A9371@pauillac.inria.fr>; from xavier.leroy@inria.fr on Wed, Feb 06, 2002 at 07:01:51PM +0100

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


  parent reply	other threads:[~2002-02-06 21:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-04 23:06 Berke Durak
2002-02-06 18:01 ` Xavier Leroy
2002-02-06 20:08   ` Daniel de Rauglaudre
2002-02-06 20:43     ` Frederic van der Plancke
2002-02-06 22:40       ` Chris Hecker
2002-02-07  1:07       ` Gerd Stolpmann
2002-02-07  3:05         ` Brian Rogoff
2002-02-07  3:25         ` Eric C. Cooper
2002-02-07 13:49         ` Thorsten Ohl
2002-02-07 13:55           ` Remi VANICAT
2002-02-07 16:32             ` [Caml-list] More syntax: _ in numbers, backquote infix op's Christian Lindig
2002-02-06 21:02   ` [Caml-list] integer types and their literals james woodyatt
2002-02-06 21:36   ` Berke Durak [this message]
2002-02-07  1:15 ` [Caml-list] Suggestion for Int32.rotate Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020206223640.A13273@gogol.zorgol \
    --to=berke@altern.org \
    --cc=caml-list@inria.fr \
    --cc=xavier.leroy@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).