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 VAA32412; Mon, 27 Oct 2003 21:08:39 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 VAA05753 for ; Mon, 27 Oct 2003 21:08:38 +0100 (MET) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h9RK8b112006 for ; Mon, 27 Oct 2003 21:08:37 +0100 (MET) Received: from [130.113.68.27] (account carette@univmail.cis.mcmaster.ca HELO pccarettej) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.0.6) with ESMTP id 6355098 for caml-list@inria.fr; Mon, 27 Oct 2003 15:08:35 -0500 Reply-To: From: "Jacques Carette" To: Subject: RE: [Caml-list] partial eval question Date: Mon, 27 Oct 2003 15:08:36 -0500 Organization: McMaster University Message-ID: <002d01c39cc6$1ac80680$1b447182@cas.mcmaster.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: <16285.28219.572454.790216@beertje.william.bogus> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jacques:01 caml-list:01 metaocaml:01 metaocaml:01 burdensome:01 jacques:01 first-class:02 prototyping:03 symbolic:03 partial:03 object:03 scheme:03 forgetting:04 proc:05 proc:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > If you really want more control over code generation (not forgetting > that just writing out what you want by hand is often the simplest > option in practice!) then I think C++ templates are a dead end---far > better to make the object language the same as the target language, > as in MetaOcaml and similar. If you know what you want, MetaOcaml is great. If you are prototyping/experimenting, then a typeless symbolic language (like = Scheme or Maple) give you much greater flexibility. MetaOcaml's contortions to = get something like: > pow :=3D proc(x,n::nonnegint) if n=3D0 then 1 else times(x,pow(x,n-1)) = end if end proc; pow :=3D proc(x, n::nonnegint) if n =3D 0 then 1 else times(x, pow(x, n - 1)) end if end proc > unapply(pow(x,5), x); x -> times(x, times(x, times(x, times(x, times(x, 1))))) is really quite burdensome. Having the freedom of dealing with 'open' = terms as first-class citizens is really very powerful, if somewhat dangerous. I have found Thiemann's PGG as the 'front end', coupled with Scheme-to-YourFavoriteLanguage translation to be quite effective PE strategy, at least when more basic 'symbolic computation' is not enough. Jacques ------------------- 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