From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 4F29EBBAF for ; Tue, 27 Jul 2010 16:38:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsCAGOMTkxKfVK0kGdsb2JhbACDFJAHjEMIFQEBAQEJCQwHEQMfp0WIQDuCEIY7LohUAQEDBYEhgx1zBIhq X-IronPort-AV: E=Sophos;i="4.55,268,1278280800"; d="scan'208";a="56191836" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail2-smtp-roc.national.inria.fr with ESMTP; 27 Jul 2010 16:38:15 +0200 Received: by wyb33 with SMTP id 33so3842608wyb.39 for ; Tue, 27 Jul 2010 07:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=IGAWFGL+FRslUGV1wj5k2Pw0xeXQ587aO10+tSclZek=; b=N34Oks6gUklP56UonZ9/MR/VQB5f3jOCo41d+As+zHs81XafH3iWI4LKAKMLv3icwN 3M8Z0JHpotXWjM8Nf53MVfACgat1mMEzG06kGacF1rn/RlQPJxAe3oKq9JpoMcB5Y4XN 7tmWE/aXbltmzrbcTxYPcSRlK8nL2MqlmQ7Kc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lPAPA8dXd2uTiZCuv3eRZBIAC40JHA775yFCjp3sTC281IjScdAJTpbQaAv0TyUiQ6 vNhq9kDimpC/m6MuBOaQQkyeY2GIfV8SVHeq3G3dCXVRR4Caud/POtMqKr3NRDFnxxca alfbxgV1S1jIS3c9BB4OMIQpOwFHsa3ck9f3Q= MIME-Version: 1.0 Received: by 10.216.157.81 with SMTP id n59mr9007321wek.84.1280241493794; Tue, 27 Jul 2010 07:38:13 -0700 (PDT) Received: by 10.216.182.132 with HTTP; Tue, 27 Jul 2010 07:38:13 -0700 (PDT) In-Reply-To: <54129.88.170.165.56.1280236965.squirrel@imap-sop.inria.fr> References: <54129.88.170.165.56.1280236965.squirrel@imap-sop.inria.fr> Date: Tue, 27 Jul 2010 16:38:13 +0200 Message-ID: Subject: Re: [Caml-list] [Camlp4] Quotation expander with OCaml syntax From: Raphael Proust To: Thomas.Gazagnaire@sophia.inria.fr Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; camlp:01 expander:01 ocaml:01 syntax:01 wrappers:01 branching:01 runtime:01 compiler:01 runtime:01 ocaml:01 byte-code:01 compiler:01 statically:01 branching:01 bigloo:01 On Tue, Jul 27, 2010 at 3:22 PM, wrote= : > Are you trying to the same thing as HOP [1] ? I haven't looked at HOP yet, but I heard a lot and will probably try to rea= d about it in the future. > > What kind of restrictions do you impose on the expressions you can > transfer from the server to the client (only non-functional values) ? How > do you ensure them in your program ? We try to minimize restriction by providing users a way to define their own [un]wrappers for exotic values. Such a value is (1) wrapped, (2) marshalled= , (3) sent to the client, (4) unmarshalled and (5) unwrapped. It is not possible = to send a value that has no associated wrapper (but their a basic wrapper for generic values). The "weirder" type we currently support is probably ['a React.E.t][1]. Types are currently checked (and inferred) via the wrap and unwrap function= . > > Are you sure splitting the code into two parts is sufficient ? How will > you handle branching than you can decide only at runtime, as example ? HO= P > is using a javascrip compiler embedded in a library to compile efficientl= y > the right client code at runtime. The client code is obtained with js_of_ocaml[2], an ocaml byte-code to Javascript compiler. Code is compiled statically. Branching is handled by t= he client at runtime. > > Btw, would be glad to have more details on what you have done and plan to > do as I am working on similar things (not very actively currently) : I've > been trying =C2=A0to make camloo, a caml-light to bigloo compiler, workin= g > again (current version[2] is quite working - still few things to finish). > At one point, the goal would be to extand the source language with simila= r > constructs than yours =C2=A0and to compile to HOP ... [1] http://erratique.ch/software/react/doc/React [2] http://ocsigen.org/js_of_ocaml --=20 _______ Raphael