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 WAA28364; Sat, 10 May 2003 22:42:48 +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 WAA27511 for ; Sat, 10 May 2003 22:42:46 +0200 (MET DST) Received: from eposta.kablonet.com.tr ([62.248.102.66]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h4AKgiT12970 for ; Sat, 10 May 2003 22:42:44 +0200 (MET DST) Received: (qmail 79969 invoked by uid 0); 10 May 2003 20:44:16 -0000 Received: from unknown (HELO 195.174.169.185) (exa@kablonet.com.tr@195.174.169.185) by 0 with SMTP; 10 May 2003 20:44:16 -0000 From: Eray Ozkural Reply-To: erayo@cs.bilkent.edu.tr Organization: Bilkent University CS Dept. To: Dave Berry , Markus Mottl , Oleg Subject: Re: [Caml-list] Re: productivity improvement Date: Sat, 10 May 2003 23:41:38 +0300 User-Agent: KMail/1.5.9 Cc: OCaml References: <4.1.20021017221827.0091c6f0@pop3.btclick.com> <4.1.20021019205725.01442878@pop3.btclick.com> In-Reply-To: <4.1.20021019205725.01442878@pop3.btclick.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200305102341.38284.exa@kablonet.com.tr> X-Spam: no; 0.00; eray:01 ozkural:01 caml-list:01 oleg:01 nonetheless:01 neglected:01 measurable:01 appel's:01 shorter:01 implemented:01 demonstrate:01 haskell:01 pleases:01 monadic:01 pseudocode:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Oleg is probably going to get mad at such delays in a follow-up but nonetheless I have had very little time to write anything intelligible because of my unfortunate phd studies. I am trying to catch up with some mails that I've neglected at the time. For recall, Dave said that a measurable 2 or 3-fold improvement in code size could convince people to switch to ML. On Sunday 20 October 2002 15:46, Dave Berry wrote: > Way back when this thread started, I quoted another example: Andrew Appel's > Tiger compiler. This has three versions, one in C, one in Java, and one in > SML. The SML is shorter, but not to such a great extent. (I need to > recheck the actual figures). What I would guess is that a C++ compiler implemented in Ocaml would improve code size considerably over one written in C. Even over those in C++, which seems to be the language of choice for efficient code nowadays. I have looked at some of the open source C++ compilers to see how the code organization was and I think that a C++ compiler does have the right amount of complexity to demonstrate our point about productivity. I myself tried to go at some length previous summer by writing a combinatorial C++ parser with Parsec in Haskell. As you will guess, I quickly ran into a few hard resolution problems and then although I realized there was a nice LL(1) grammar that I could use, I didn't have enough time for the project (as you could also guess) If somebody gets interested, I will try to clean up the parser and have it actually parse a subset of C++ so that we can begin some development on it. Then, if somebody pleases, it shouldn't be impossible to translate the code to ocaml or other functional languages. The reason I used Haskell was that I thought it would be interesting to see the pipeline effect of lazy monadic code in something like (pseudocode!) do t <- parseProgram prog1; s <- semanticAnalyzer t; pr <- generatePR s; opr <- optimizePR pr; generateCode opr I haven't really looked at any real compilers written in Haskell but I would think they use a fair amount of monadic functions. But first I must program more data structures!! Regards, -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- 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