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 QAA10024; Wed, 20 Feb 2002 16:27:04 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA11594 for ; Wed, 20 Feb 2002 16:27:02 +0100 (MET) Received: from audi.ibcp.fr (audi.ibcp.fr [193.51.160.127]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g1KFR2H19002 for ; Wed, 20 Feb 2002 16:27:02 +0100 (MET) Received: from pc-bioinfo1.ibcp.fr (pc-bioinfo1.ibcp.fr [193.51.160.63]) by audi.ibcp.fr (Postfix) with ESMTP id 07022FCB0 for ; Wed, 20 Feb 2002 16:27:02 +0100 (CET) Date: Wed, 20 Feb 2002 16:15:32 +0100 (CET) From: Martin Jambon X-X-Sender: To: Subject: [Caml-list] Safe Caml for online teaching Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Is the following proposal completely crazy or could it be done (or both?): The insertion of Caml-toplevel forms in Caml online HTML manuals could be attractive for beginners since it doesn't require the installation of Caml on the local machine. This would require a strict control over the code that the user will want to be compiled and executed on the server. (we already discussed such things last week on the beginners' list http://groups.yahoo.com/group/ocaml_beginners/messagesearch?query=interactive%20learning) Now I think the following extensions to Caml could provide a way to achieve a sufficient level of safety: - every value is either "safe" or "unsafe" (independently from its type) - 2 compilation modes would be available: + unsafe mode: allows to make safe values of unsafe ones + safe mode: prohibits the use of unsafe values (in the current module) + safe-compiled and unsafe-compiled modules may be linked freely - inheritance: + imported values (using keyword "external") are unsafe + every piece of code that uses unsafe data is unsafe, otherwise it is safe. - compatibility: default mode = unsafe mode - syntax examples (for unsafe-mode-designed modules): .mli and .ml: safe external : = ... .mli: safe val : .ml: let safe = ... - requirements: + additions to the compiler... + addition of safety annotations at least in the standard library Well, this would require a non-negligible amount of concertation, expertise and coding. It seems to me much cleaner than deleting parts of the standard library (and others) and suppressing the "external" construct by some syntaxic preprocessing. An interactive Caml book would also require a strong and brave HTTP server :-) Martin ------------------- 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