caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>
To: mottl@miss.wu-wien.ac.at
Cc: caml-list@inria.fr
Subject: Re: lexer, parser
Date: Tue, 15 Jun 1999 11:01:50 +0900	[thread overview]
Message-ID: <19990615110150N.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: Your message of "Sat, 12 Jun 1999 13:02:58 +0100 (MET DST)" <199906121102.NAA30678@miss.wu-wien.ac.at>

From: Markus Mottl <mottl@miss.wu-wien.ac.at>

> 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
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>




  reply	other threads:[~1999-06-15 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0580637621241002*/c=FR/admd=ATLAS/prmd=SG/o=INFI/s=EBER/g=JEAN-MARC/@MHS>
     [not found] ` <0579137620FCB001*/c=FR/admd=ATLAS/prmd=SG/o=INFI/s=EBER/g=JEAN-MARC/@MHS>
1999-06-03 11:55   ` John Skaller
1999-06-12 12:02     ` Markus Mottl
1999-06-15  2:01       ` Jacques GARRIGUE [this message]
1999-06-15 10:20         ` Markus Mottl
1999-06-14  7:15     ` Christian Lindig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990615110150N.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=mottl@miss.wu-wien.ac.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).