caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Cannasse" <warplayer@free.fr>
To: "SooHyoung Oh" <shoh@duonix.com>, "Caml-List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Q: safe language
Date: Fri, 30 Aug 2002 16:42:34 +0200	[thread overview]
Message-ID: <001801c25033$7b32b4b0$bd00a8c0@mini2k> (raw)
In-Reply-To: <001c01c24fc5$9c51bfb0$fe00a8c0@hama>

> I heard Ocaml is "safe" language.
>
> Some questions about "safe" language:
> - Is it necessary for a safe language to have a type system?
> - Isn't Lisp a safe language?

Depends what you're calling "safe"...

Any language having garbage collection prevents the user from having "access
violations" errors ( such as in C :  (*NULL)++ ). Then, other errors will
always be detected either at run-time ( with often an exception mechanism )
or at compile time.

Lisp is a dynamicly typed language, so will perform all type checks at
run-time, resulting a very simple way of writing things but most of the (not
syntax) errors will be detected by the user at run-time. This kind of
language require rought testing of the programs from the user ( keep in mind
that a runtime error is taking at least 10 more time to find/fix than a
compile-time one )

Then comes strongly types languages. Theses need "types" and will only
accept compiling programs where functions are applied to the good typed
parameters. Perhaps more work is needed by the programmer, but most of Lisp
run-time errors are now detected at compile-time, resulting a "more safe"
binary.

OCaml is far better than that, but it does "type inference" for you. That
is, it automaticly deduce variables & functions types from the context in
which they are used. So you can write programs with almost the same freedom
as Lisp ( without type anotations ) but with a compile-time errors-detection
:-)

Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2002-08-30 14:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-30  1:36 SooHyoung Oh
2002-08-30  8:41 ` sebastien FURIC
2002-08-30 12:44 ` Vitaly Lugovsky
2002-08-30 13:05   ` David Frese
2002-08-30 13:46     ` Oleg
2002-08-30 16:09       ` Yutaka OIWA
2002-08-30 13:49     ` Vitaly Lugovsky
2002-08-30 14:04       ` J Farrand
2002-08-30 14:26         ` Vitaly Lugovsky
2002-08-30 14:48           ` Nicolas Cannasse
2002-08-30 15:31             ` Vitaly Lugovsky
2002-08-30 14:55           ` Mike Lin
2002-08-30 14:58             ` Eric Newhuis
2002-08-30 16:03           ` Yutaka OIWA
2002-08-30 21:44           ` Oliver Bandel
2002-09-01  8:07         ` John Max Skaller
2002-08-30 14:50       ` David Frese
2002-08-30 15:38         ` Vitaly Lugovsky
2002-08-30 15:28     ` didier plaindoux
2002-08-30 14:41 ` Florian Hars
2002-08-30 14:42 ` Nicolas Cannasse [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='001801c25033$7b32b4b0$bd00a8c0@mini2k' \
    --to=warplayer@free.fr \
    --cc=caml-list@inria.fr \
    --cc=shoh@duonix.com \
    /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).