From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C72A07FCCB for ; Fri, 1 May 2015 18:16:23 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=pra; client-ip=66.111.4.25; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=mailfrom; client-ip=66.111.4.25; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@out1-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.25; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="postmaster@out1-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CHAQDOpUNVnBkEb0Jcg19cgx3EMoYEAoFaPBABAQEBAQEBEQEBAQEBBg0JCSEuhCEBAQMBIx00BgQLCxoCJgICLBsQiDwIDbJ3cIRnjkcBAQEHAQEBAQEBFgaBIYoXhFI6FoJSL4EWlX6IIJQdhDMiMYJFAQEB X-IPAS-Result: A0CHAQDOpUNVnBkEb0Jcg19cgx3EMoYEAoFaPBABAQEBAQEBEQEBAQEBBg0JCSEuhCEBAQMBIx00BgQLCxoCJgICLBsQiDwIDbJ3cIRnjkcBAQEHAQEBAQEBFgaBIYoXhFI6FoJSL4EWlX6IIJQdhDMiMYJFAQEB X-IronPort-AV: E=Sophos;i="5.13,351,1427752800"; d="scan'208";a="138480337" Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 May 2015 18:16:22 +0200 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9F2892086F for ; Fri, 1 May 2015 12:16:20 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute5.internal (MEProxy); Fri, 01 May 2015 12:16:20 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=lpw25.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=cPp0Z6UEgBLAxrjolHOp7X/omlU=; b=uQlMnr wIqV4qf4BBzPW/grPf8y6HIQ9jXijYnj7tfFEQ+U0l6/4BILlFu4LABgvSg4IsKN slR+F6urPg/oY7u9kU1OmXCajv1oDLsfzOfcLIjqDr+qZVhdMW0d8YZI22QtYcLE OKZA0PT233osWzjT2ka73CZVUQg0bs5JvGIIU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=cPp0Z6UEgBLAxrj olHOp7X/omlU=; b=l0e73fuABNxDjesbNfH0feQjXkpzthbdyarAiEs56K/e4vR aH2SBMSP23ifvQE0X+uvrBpo2n2wETLWtpcagr95YPcZVXPszv6eCx2mE3IO3CVs p2HdcQOyqp0g2UsQBAEddJNTYbPHYod3n2LWYi2DO36bS9nToG8Lf0k/Zc1M= Received: by web3.nyi.internal (Postfix, from userid 99) id 7A21610B1AF; Fri, 1 May 2015 12:16:20 -0400 (EDT) Message-Id: <1430496980.1158661.261513285.08E1920C@webmail.messagingengine.com> X-Sasl-Enc: 25OPylJroFWP7p5SDqGBUroeOqBNDSMP3ISyM6MHMdvr 1430496980 From: Leo White To: caml-list@inria.fr MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-f5f4dd6c Date: Fri, 01 May 2015 12:16:20 -0400 In-Reply-To: References: <20150501112114.1C8DFC382A@www1.g3.pair.com> Subject: Re: [Caml-list] Problems with printing MetaOCaml generated code > Can we talk about what is non-serializable here? I pushed some code to a > public repo for demonstration purposes. I have a simple interpreter for > a simple language. I'm experimenting with different levels of > interpreter specializations(aka. first Futamura projections). As a > simplest specialization, I want to eliminate parsing costs. The code > that's supposed to do this is here: >=20 > https://github.com/osa1/int-proj/blob/master/Unlambda.ml#L204 >=20 > `p'` in that code is lifted, and it's parsed syntax tree of given source > file. Syntax tree is defined here: >=20 > https://github.com/osa1/int-proj/blob/master/Syntax.ml#L63 >=20 > I think it doesn't have anything that's not serializable: It's just a > simple monomorphic type, doesn't have any closures etc. >=20 > But MetaOCaml is failing to print this code. To try it yourself, make > sure you have metaocamlc in $PATH, and run: >=20 > =E2=9E=9C unlambda git:(master) =E2=9C=97 make unlambda_metaocaml > metaocamlc -c Syntax.ml > metaocamlc Syntax.cmo Unlambda.ml -o unlambda_metaocaml >=20 > =E2=9E=9C unlambda git:(master) =E2=9C=97 ./unlambda_metaocaml program= s/Hello.unl stage0 > File "Unlambda.ml", line 204, characters 67-69: > Warning 22: The CSP value is a closure or too deep to serialize > File "Unlambda.ml", line 204, characters 58-66: > Warning 22: The CSP value is a closure or too deep to serialize > .<(* CSP eval_ref *) (* CSP p' *) []>. >=20 >From a quick look at the code, it seems pretty clear that `eval_ref` is not= serializable. It is a local function so there is no AST fragment which could represent it= globally. I suspect that if you moved `eval_ref` into a separate module, so that it was a global function, then this code would work. Regards, Leo