From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A3D13BC48 for ; Mon, 4 Apr 2005 19:39:48 +0200 (CEST) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.89]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j34HdlOG002660 for ; Mon, 4 Apr 2005 19:39:48 +0200 Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/8.12.11/smtpout02/MantshX 4.0) with ESMTP id j34HddfG002630; Mon, 4 Apr 2005 10:39:40 -0700 (PDT) Received: from [192.168.0.100] (dsl092-032-215.lax1.dsl.speakeasy.net [66.92.32.215]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 4.0) with ESMTP id j34HdbpI024249; Mon, 4 Apr 2005 10:39:38 -0700 (PDT) In-Reply-To: <20050404154408.16534457.ocaml-erikd@mega-nerd.com> References: <49464.202.164.198.46.1112355123.squirrel@www.ivorykite.com> <424DA923.7020106@tfb.com> <50130.202.164.198.46.1112418605.squirrel@www.ivorykite.com> <51945.202.164.198.46.1112586123.squirrel@www.ivorykite.com> <20050404154408.16534457.ocaml-erikd@mega-nerd.com> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6ed7a87a9c29d26e2bc742181b787e49@mac.com> Content-Transfer-Encoding: 7bit Cc: effbiae@ivorykite.com, caml-list@yquem.inria.fr From: Paul Snively Subject: Re: [Caml-list] Re: some comments on ocaml{lex,yacc} from a novice's POV Date: Mon, 4 Apr 2005 10:39:22 -0700 To: Erik de Castro Lopo X-Pgp-Agent: GPGMail 1.0.2 X-Mailer: Apple Mail (2.619.2) X-Miltered: at concorde with ID 42517BE3.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 hash:01 parser:01 parsers:01 haskell:01 parser:01 combinators:01 sourceforge:01 compilers:01 compilers:01 compiler:01 statically:01 ocaml:01 inference:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Apr 3, 2005, at 10:44 PM, Erik de Castro Lopo wrote: > On Mon, 4 Apr 2005 13:42:03 +1000 (EST) > "Jack Andrews" wrote: > >> here's the usual calc example that generates a parser: >> >> (define expr-parser >> (lalr-parser >> ; Terminal symbols >> (ID + - * /) >> ; Productions >> (e (e + t) : (+ $1 $3) >> (e - t) : (- $1 $3) >> (t) : $1) >> (t (t * f) : (* $1 $3) >> (t / f) : (/ $1 $3) >> (f) : $1) >> (f (ID) : $1))) >> >> isn't that nice?!? > > Yes. > >> compare with caml solutions? compare with any other solution? > > There are parsers for Haskell which would compare very favourably > with your lisp parser. I haven't used them myself but I've seen > example code somewhere. > ONAE's cf's parser combinators, perhaps, if the point is to have an "in-native-code" solution. See also the Spirit parser generator framework in the Boost libraries for C++, at or . >> i'm told there are good scheme compilers. > > Since scheme is a dynamically typed language, scheme compilers are > unlikely to ever produce code as fast as a compiler for a statically > typed langugae like ocaml. > It's hard, but by making the closed-world assumption and doing some careful type inference, it's possible to be competitive: see the Stalin, Bigloo, and Gambit compilers. > Erik > -- > +-----------------------------------------------------------+ > Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) > +-----------------------------------------------------------+ > " ... new TV ad for Microsoft's Internet Explorer e-mail program which > uses the musical theme of the "Confutatis Maledictis" from Mozart's > Requiem. "Where do you want to go today?" is the cheery line on the > screen, while the chorus sings "Confutatis maledictis, flammis acribus > addictis,". This translates to "The damned and accursed are convicted > to the flames of hell." > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > Best regards, Paul -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) iEYEARECAAYFAkJRe9gACgkQO3fYpochAqKNyQCg8wks+wUbD9phOo2/7p9s+uDc u+sAn1bc3LOKJJyVDMrIsKqtiIFOFrv8 =KmnK -----END PGP SIGNATURE-----