caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yawar Amin <yawar.amin@gmail.com>
To: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Detecting missed checks for error indications in ML code
Date: Sun, 24 Jan 2021 22:59:24 -0500	[thread overview]
Message-ID: <CAJbYVJ+FVb3c8KV934paSsyV1kXw53te=G+1SXQ-QO1AwMwF4Q@mail.gmail.com> (raw)
In-Reply-To: <a775ca82-b401-3642-8921-1e81f4602da1@web.de>

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

On Sun, Jan 24, 2021 at 11:22 AM Markus Elfring <Markus.Elfring@web.de>
wrote:

> ...
> Are you used to programming concerns according to software weaknesses
> like “CWE-252: Unchecked Return Value”?
> https://cwe.mitre.org/data/definitions/252.html


I would say this is a solved problem. Or at least, it can be if you program
in that way, using the result type to indicate errors. Even better, using
polymorphic variants to encode the different types of errors. But you are
already aware of this approach, since you linked to Vladimir Keleshev's
article on it.

Actually, this was a solved problem even before the result type was
introduced into OCaml, because we already had exceptions. And exceptions
were invented exactly for the purpose of ensuring that errors can never go
unnoticed. In other words, an exception ensures that either you handle it,
or the program crashes.

Of course, someone could just do a try...catch and ignore exceptions. But
at that point, no one can help them.

Regards,

Yawar

[-- Attachment #2: Type: text/html, Size: 1548 bytes --]

  reply	other threads:[~2021-01-25  3:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 11:42 Markus Elfring
2021-01-24 14:08 ` Hendrik Boom
2021-01-24 15:28   ` Markus Elfring
2021-01-24 14:34 ` Oliver Bandel
2021-01-24 15:52   ` Markus Elfring
2021-01-24 16:07     ` Oliver Bandel
2021-01-24 16:21       ` Markus Elfring
2021-01-25  3:59         ` Yawar Amin [this message]
2021-01-25 18:55           ` Markus Elfring
2021-01-24 16:18     ` Oliver Bandel
2021-01-24 16:50       ` Markus Elfring
2021-01-29 21:14         ` [Caml-list] Error handling in FPLs (Re: Detecting missed checks for error indications in ML code) Oliver Bandel
2021-01-30 11:51           ` Markus Elfring

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='CAJbYVJ+FVb3c8KV934paSsyV1kXw53te=G+1SXQ-QO1AwMwF4Q@mail.gmail.com' \
    --to=yawar.amin@gmail.com \
    --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).