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 KAA27674; Fri, 18 Oct 2002 10:30:49 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA28035 for caml-list@pauillac.inria.fr; Fri, 18 Oct 2002 10:30:48 +0200 (MET DST) 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 EAA20362 for ; Fri, 18 Oct 2002 04:52:06 +0200 (MET DST) Received: from mail.interaktif.net.tr ([62.248.102.120]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9I2q4501812 for ; Fri, 18 Oct 2002 04:52:05 +0200 (MET DST) Received: from abn166-176.ank-avrupa-ports.kablonet.net.tr (unknown [195.174.166.176]) by mail.interaktif.net.tr (Postfix) with ESMTP id 4AEA31E654; Fri, 18 Oct 2002 05:49:15 +0300 (EEST) From: Eray Ozkural Organization: Bilkent University CS Dept. To: Dave Berry , Markus Mottl , Oleg Subject: Re: [Caml-list] Re: productivity improvement Date: Fri, 18 Oct 2002 05:48:10 +0300 User-Agent: KMail/1.4.5 Cc: OCaml References: <4.1.20020714213245.00a37f00@pop3.btclick.com> <4.1.20021017221827.0091c6f0@pop3.btclick.com> In-Reply-To: <4.1.20021017221827.0091c6f0@pop3.btclick.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200210180548.10452.erayo@cs.bilkent.edu.tr> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday 18 October 2002 00:27, Dave Berry wrote: > >For a C++ compiler, the ratio would be about the same since C++ has > > simpler semantics but a more involved syntax than well designed > > languages. > > I'm staggered at your suggestion that C++ has a simple semantics. To me, a > major advantage of the ML family is that their semantics is relatively > simple. > C++ has a less sophisticated and mathematically lacking semantics devoid of generality compared to ML family, especially modern incarnations such as ocaml. The hard part of writing a C++ compiler is coping with several syntactic ambiguities and incoherent semantics (such as in templates and type system) rather than realizing a well defined and expressive semantics. Where in C++ is orthogonality, reliability, parametrized/recursive types, parametrized modules, etc.? I'm staggered at you claiming more than C++ deserves. Where C++ ought to be strongest, OOP, ocaml is much more general and complete. In other design objectives ocaml beats C++ by a good measure. No derivative of C can be a really good programming language design and C++ is not an exception. It isn't just a coincidence that programming language research focuses on functional languages a la ML. And that the industry uses largely C++ has nothing to do with semantics. I think it is clear why the industry prefers one language over another; it is collective stupidity. As a side note, once you get past the parsing stage it should be relatively easy to implement an optimizing C++ or C# compiler. I've been working on a C++ parser, but the syntax is so hard it's almost impossible to implement everything and verify that it really works. (Another indication that the design sucks) The syntactic analyzer itself could take a couple of thousands of lines. All in all it would still take 10000 or more lines. I would estimate somewhere about 10000-20000 lines for a C++ compiler. A C# compiler could be made smaller. If we had a good C++ parser written in ocaml or haskell we could proceed to a full compiler very fast. It just hasn't been done before. I can put forward a challenge in front of you and I think you would be much more helpless than I am about writing a C++ compiler from scratch -- which is no easy undertaking whatever the implementation language is. What about writing a full-fledged ocaml or haskell compiler in C++? I am pretty sure that would be an overwhelming task, something which would require more than 100.000 lines of C++ code. I intend to release a version of my parser when it is able to parse KDE headers. Maybe then people experienced in C++ parsers can work on a full-fledged compiler. I'm writing a top-down parser like in the recent versions of g++ using haskell Parsec library. Thanks, -- Eray Ozkural Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo 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