From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3EBxhrb016020 for ; Thu, 14 Apr 2011 13:59:43 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4FAKvgpk1V6aAZcmdsb2JhbACETJM7jW4UAQwIDAkUAyKIb6dBkSqBKYNNeASNb4Nz X-IronPort-AV: E=Sophos;i="4.64,211,1301868000"; d="scan'208";a="96936447" Received: from outgoing-smtp.namesco.net ([85.233.160.25]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Apr 2011 13:59:38 +0200 Received: from [192.168.0.14] (helo=artemis2.hosts.co.uk) by outgoing-smtp.namesco.net with esmtp (Exim 4.67) (envelope-from ) id 1QALCx-0001yd-Jb; Thu, 14 Apr 2011 12:59:36 +0100 Received: from root by artemis2.hosts.co.uk with local (Exim 4.69) (envelope-from ) id 1QALCy-0000XJ-Hl; Thu, 14 Apr 2011 12:59:36 +0100 To: , From: =?utf-8?q?=22Mark=20Adams=22?= Reply-To: =?utf-8?q?=22Mark=20Adams=22?= MIME-Version: 1.0 X-Mailer: Namesco Webmail v3.0 Message-ID: <1302782376235@names.co.uk> Date: Thu, 14 Apr 2011 12:59:36 +0100 Content-Type: text/plain; charset="UTF-8" X-namescosender: 0 2002 X-namesco: 192.168.0.171 X-Spam-Score: -1.0 (-) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p3EBxhrb016020 Subject: Re: [Caml-list] Nicely written Caml/OCaml code to read. Hi Clement, My HOL Zero program may be of interest to you. It's a theorem prover (i.e. a program for performing mathematical proof), but don't let that put you off! It's written in about 8,000-9,000 non-blank/non-comment lines of OCaml, and is heavily commented, nicely formatted and implemented in a straightforward style. I've tried to make it as easy as possible for others to understand the implementation (the idea is that people will then trust that the proofs it performs are correct), and it comes with a glossary explaining background terminology about theorem provers. There is no use of Object-Oriented, there is only a little optimisation (to do basic sensible things regarding tail recursion, etc) and it has a simple implementation of trees. http://www.proof-technologies.com/holzero.html To run it, you'll need a Unix-like operating system with bash, OCaml and Camlp5. There is even a $100 bountry reward if you manage to find a fundamental flaw in the mathematical soundness of the program! Mark Adams Proof Technologies Ltd on 13/4/11 9:40 PM, Create Software wrote: > Hi all, > > I'll be taking exams at the end of the year (starting in a week, actually), > which include programming / informatics > tests. The language used in these exams is Caml Light (you guessed right: > grandes écoles). > > I've done a lot of programming in previous years, but I didn't know > Caml/OCaml before high school -- I come from a mixed > C++/C# world, with drops of Python here and there. > > In developing my skill in other languages, I always found that reading good > code at some point was a great boost to the > beauty and cleanness of the programs I wrote. Usually, every language has > it's own conventions, best practices, and I > think you can usually learn a lot by reading well-written, nicely-crafted > code. > > So here's my question: **which code would you recommend to read?** > > (As a side note, I'm not really interested (at least in the very short term) > in anything on the object-oriented side of > the language, since the notions used at the exam are limited to the elements > available in Caml Light.) > > I've tried batteries and Jane street core/ext-core libraries, but the former > has extremely few comments, and the latter > is too widely optimized to be enjoyable to read (Jane street's map function > is 30 lines long due to loop unrolling). > > Anything that deals with trees or finite state automata gets extra brownie > points =) (and +2 if Gabriel Scherer answers) > > Thanks for your help! > Clément. > > -- > Create Software - Open source, lightweight, and efficient software - > @createsoftware > http://createsoftware.users.sourceforge.net - > http://synchronicity.sourceforge.net > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > >