caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dan Grossman <danieljg@cs.cornell.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] bigarrays and toplevel on Win32?
Date: Wed, 07 Mar 2001 11:00:48 -0500	[thread overview]
Message-ID: <3AA65B30.F354EA2@cs.cornell.edu> (raw)
In-Reply-To: <87pufvoqro.fsf@elbereth.pgh.arsdigita.com>



John Prevost wrote:
> 
> >>>>> "xl" == Xavier Leroy <Xavier.Leroy@inria.fr> writes:
> 
>     xl> The party line on unsafe array accesses is unclear: on the one
>     xl> hand, we do not want to encourage their use, as it can break
>     xl> type safety and dramatically reduce the safety of the
>     xl> programs; on the other hand, they are handy when benchmarking
>     xl> against C or Fortran :-)
> 
> Think of it less as an "unsafe array access" and more of "license to
> turn a given set of exceptions into core dumps in exchange for
> efficiency."  ;)
> 
> John.

No.  If I could be guaranteed a core dump on my first out-of-bounds access,
I would be fine with this.  It's why my C code sometimes doesn't check for
null before dereferencing a pointer.  But with arrays, you can silently
corrupt arbitrary memory.  Maybe your program crashes later.  Maybe it ends
up deleting all your files.  Maybe it never tells you that it computed the
wrong answer.

What I would be okay with was doing the bounds-check and exiting (or core
dumping if you prefer) on out-of-bounds.  This still gives an optimizer some
leeway because array-intensive code will have fewer exception-causing
instructions.

--Dan

-- 
| Dan Grossman     www.cs.cornell.edu/home/danieljg H:607 256 0724 |
| 5157 Upson Hall  danieljg@cs.cornell.edu          O:607 255 9834 |
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-03-07 16:00 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 [this message]
2001-03-07 21:04       ` John Prevost

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=3AA65B30.F354EA2@cs.cornell.edu \
    --to=danieljg@cs.cornell.edu \
    --cc=caml-list@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).