From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA08639; Fri, 30 Aug 2002 16:42:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA07224 for ; Fri, 30 Aug 2002 16:42:08 +0200 (MET DST) Received: from relay-4m.club-internet.fr (relay-4m.club-internet.fr [194.158.104.43]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7UEg6D21136 for ; Fri, 30 Aug 2002 16:42:07 +0200 (MET DST) Received: from mini2k (lns02m-5-75.w.club-internet.fr [212.194.16.75]) by relay-4m.club-internet.fr (Postfix) with SMTP id 09FE3E09B; Fri, 30 Aug 2002 16:42:04 +0200 (CEST) Message-ID: <001801c25033$7b32b4b0$bd00a8c0@mini2k> From: "Nicolas Cannasse" To: "SooHyoung Oh" , "Caml-List" References: <001c01c24fc5$9c51bfb0$fe00a8c0@hama> Subject: Re: [Caml-list] Q: safe language Date: Fri, 30 Aug 2002 16:42:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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