From: John Prevost <jmp@arsdigita.com>
To: Dan Grossman <danieljg@cs.cornell.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] bigarrays and toplevel on Win32?
Date: 07 Mar 2001 16:04:05 -0500 [thread overview]
Message-ID: <874rx52ucu.fsf@elbereth.pgh.arsdigita.com> (raw)
In-Reply-To: <3AA65B30.F354EA2@cs.cornell.edu>
>>>>> "dg" == Dan Grossman <danieljg@cs.cornell.edu> writes:
dg> No. If I could be guaranteed a core dump on my first
dg> out-of-bounds access, I would be fine with this. It's why my
dg> C code sometimes doesn't check for null before dereferencing a
dg> pointer. But with arrays, you can silently corrupt arbitrary
dg> memory. Maybe your program crashes later. Maybe it ends up
dg> deleting all your files. Maybe it never tells you that it
dg> computed the wrong answer.
dg> What I would be okay with was doing the bounds-check and
dg> exiting (or core dumping if you prefer) on out-of-bounds.
dg> This still gives an optimizer some leeway because
dg> array-intensive code will have fewer exception-causing
dg> instructions.
You have a good point here--I was just being cheeky.
I really look at the unsafe array operations as akin to the unsafe
magic cast operation. None of them are appropriate for everyday
use--but if I go over a small piece of code with a fine-toothed comb
and prove to my satisfaction that everything is correct, it's
worthwhile to have them. They're not the most ideologically sound
tools available, but I appreciate that O'Caml tends to balance
ideology with practicality more often than the other guys seem to.
John.
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr
prev parent reply other threads:[~2001-03-08 10:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-05 7:43 Chris Hecker
2001-03-05 16:57 ` Xavier Leroy
2001-03-05 17:37 ` Chris Hecker
2001-03-06 17:18 ` Brian Rogoff
2001-03-05 20:52 ` Bruce Hoult
2001-03-05 21:28 ` John Prevost
2001-03-07 16:00 ` Dan Grossman
2001-03-07 21:04 ` John Prevost [this message]
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=874rx52ucu.fsf@elbereth.pgh.arsdigita.com \
--to=jmp@arsdigita.com \
--cc=caml-list@inria.fr \
--cc=danieljg@cs.cornell.edu \
/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