From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA02602 for caml-redistribution; Tue, 15 Jun 1999 22:47:42 +0200 (MET DST) 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 EAA23262 for ; Tue, 15 Jun 1999 04:01:39 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id EAA03997 for ; Tue, 15 Jun 1999 04:01:35 +0200 (MET DST) Received: from localhost (safran.kurims.kyoto-u.ac.jp [130.54.16.91]) by kurims.kurims.kyoto-u.ac.jp (8.9.1a/3.7W) with ESMTP id LAA04329; Tue, 15 Jun 1999 11:01:21 +0900 (JST) To: mottl@miss.wu-wien.ac.at Cc: caml-list@inria.fr Subject: Re: lexer, parser In-Reply-To: Your message of "Sat, 12 Jun 1999 13:02:58 +0100 (MET DST)" <199906121102.NAA30678@miss.wu-wien.ac.at> References: <199906121102.NAA30678@miss.wu-wien.ac.at> X-Mailer: Mew version 1.93 on Emacs 20.3 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990615110150N.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 15 Jun 1999 11:01:50 +0900 From: Jacques GARRIGUE X-Dispatcher: imput version 980905(IM100) Content-Transfer-Encoding: 7bit Sender: weis From: Markus Mottl > Execution of "semantics" is also much faster than versions that use > algebraic datatypes and pattern matching, because here we only have to > call methods (wrapped in the functions of the stream) on objects instead > of match abstract syntax trees or else. Sorry to answer pinpoint, but I just want to avoid a confusion. In caml pattern-matching is much more efficient than calling a method. Calling a method is a dynamic operation, involving looking-up a table and calling a possibly curried function, while pattern-matching is completely statically compiled. OO may help you structure your program, but when algebraic datatypes are handy, I would suggest sticking with them. Jacques --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG