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 OAA22749; Tue, 9 Jul 2002 14:46:03 +0200 (MET DST) 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 OAA27308 for ; Tue, 9 Jul 2002 14:46:01 +0200 (MET DST) Received: from cirse.saclay.cea.fr (cirse.saclay.cea.fr [132.166.192.127]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g69Ck1r09934 for ; Tue, 9 Jul 2002 14:46:01 +0200 (MET DST) Received: from argiope.saclay.cea.fr (argiope.saclay.cea.fr [132.166.192.108]) by cirse.saclay.cea.fr (8.12.2/8.12.2/CEAnet-Internet.1.0) with ESMTP id g69Ck0Zj020023 for ; Tue, 9 Jul 2002 14:46:00 +0200 (MEST) Received: from muguet.saclay.cea.fr (unverified) by argiope.saclay.cea.fr (Content Technologies SMTPRS 4.2.10) with ESMTP id ; Tue, 9 Jul 2002 14:39:04 +0200 Received: from is002254.saclay.cea.fr (is002254.saclay.cea.fr [132.166.134.67]) by muguet.saclay.cea.fr (8.12.2/8.12.2/CEAnet-Interne.1.0) with ESMTP id g69Ck0iM011152; Tue, 9 Jul 2002 14:46:00 +0200 (MEST) Received: from basile by is002254.saclay.cea.fr with local (Exim 3.35 #1 (Debian)) id 17RuMu-0006Ov-00; Tue, 09 Jul 2002 14:45:24 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <15658.56034.306342.892408@is002254.saclay.cea.fr> Date: Tue, 9 Jul 2002 14:45:22 +0200 To: Oleg CC: caml-list@inria.fr Subject: [Caml-list] productivity improvement In-Reply-To: <200207081952.PAA28813@hickory.cc.columbia.edu> References: <200207081952.PAA28813@hickory.cc.columbia.edu> X-Mailer: VM 7.03 under Emacs 21.2.1 From: Basile STARYNKEVITCH Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "Oleg" == Oleg writes: Oleg> What are the _simplest_ examples that demonstrate Oleg> considerable (> 2:1) O'Caml vs C++ productivity improvement Oleg> (in terms of program size) and where can I find them? I am not sure the question does make any real sense. You might ask an Ocaml vs Java comparaison, or an Ocaml vs Python compraison .... 1. Try coding the Ocaml compiler, the ActiveDVI viewer, the Unison synchronizer, or the Coq proof system, ... in C++, then tell us about your findings. If possible, publish your working C++ code :-) 2. The simplest example I can think of is the hello world program. In Ocaml it is just a single line: print_endline "hello world";; but in C++ you'll need at least an #include, then a main function, containing a out << "hello world" << endl statement perhaps a simplest even example is the empty program: (a 0 byte file in Ocaml, but in C++ you need a main function. the size improvement is infinite in favor of Ocaml) Ok, my answer is silly, but I feel the question a bit silly too. More convincing examples are the many existing (and publicised) code in Ocaml. See the ocaml hump for instance, and more generally try ocaml in a Web search engine. Also the Oreilly book (originally in French, but translated in english) on Ocaml will help. There are lots of stuff from http://www.ocaml.org/ too. Both Ocaml and C++ requires a significant learning effort, however (you might compare the volume of the language reference manuals; the core language of C++ is much heavier than the core language of Ocaml). Try coding some stuff in Ocaml and you will learn by yourself. The type inference system is really a big plus. Ocaml does have some minor weaknesses: the syntax is sometimes painful (you could look into the Revised syntax proposal of D.deRanglaudre in camlp4); mixing datatypes (eg records) and classes is painful; there are much less libraries in Ocaml than in C or C++; metaprogramming is not really easy; runtime information is almost inexistant; Ocaml has no overloading, etc... The real convincing examples would be projects which failed in C++ but were resurrected and worked in Ocaml (I heard there are some such projects but I cannot name them) but I am not sure you'll find public references to failed projects. N.B. Any opinions expressed here are only mine, and not of my organization. N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA. --------------------------------------------------------------------- Basile STARYNKEVITCH ---- Commissariat à l Energie Atomique * France DRT/LIST/DTSI/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX phone:+33 1,6908.6055; fax: 1,6908.8395 home: 1,4665.4553; mobile: 6,8501.2359 work email: Basile point Starynkevitch at cea point fr home email: Basile at Starynkevitch point net ------------------- 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