From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id D98DC7FD05 for ; Thu, 7 May 2015 23:50:29 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of omeragacan@gmail.com) identity=pra; client-ip=74.125.82.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="omeragacan@gmail.com"; x-sender="omeragacan@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of omeragacan@gmail.com designates 74.125.82.54 as permitted sender) identity=mailfrom; client-ip=74.125.82.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="omeragacan@gmail.com"; x-sender="omeragacan@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wg0-f54.google.com) identity=helo; client-ip=74.125.82.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="omeragacan@gmail.com"; x-sender="postmaster@mail-wg0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DfAQAw3UtVlDZSfUpcg2JeBoMYwlEJgVOGCQKBOAc4FAEBAQEBAQERAQEBAQcLCwkfMEEFg1sBAQMBEhEdARsdAQMBCwYFCw8CJgICIgERAQUBHBkih3QBAwoIDac5PjGLOIFrgneIaAoZJw1XhFgBAQEBAQEBAwEBAQEBFwEBBA6BE4oZhQUHFoJSgUUFj36GTIZEgSSRUIIJEiOBDAmCCYIsIjGCRgEBAQ X-IPAS-Result: A0DfAQAw3UtVlDZSfUpcg2JeBoMYwlEJgVOGCQKBOAc4FAEBAQEBAQERAQEBAQcLCwkfMEEFg1sBAQMBEhEdARsdAQMBCwYFCw8CJgICIgERAQUBHBkih3QBAwoIDac5PjGLOIFrgneIaAoZJw1XhFgBAQEBAQEBAwEBAQEBFwEBBA6BE4oZhQUHFoJSgUUFj36GTIZEgSSRUIIJEiOBDAmCCYIsIjGCRgEBAQ X-IronPort-AV: E=Sophos;i="5.13,386,1427752800"; d="scan'208";a="114932620" Received: from mail-wg0-f54.google.com ([74.125.82.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 May 2015 23:50:29 +0200 Received: by wgiu9 with SMTP id u9so56290621wgi.3 for ; Thu, 07 May 2015 14:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=6D+xr+lyktOYHwj45z6HwXUs1lXNqMWYtn+/rYaPlOw=; b=hn9cjcOiuvW9r782pTnu2lg8cK6m2EvUVnFDVoY0uSYXY7czk5TGrUtj1nZe3k4HvH skF57F9RVRtqAEOCZwag8ycF1XBV1EfAq7JrPVJmrMwWxInQYz9CYacpG8fMtMlyWX25 xFF4WAcYu3BNoJjnS2b4oK6SRi5Wusgof0XrlmP1BP8bX/0Qd7sFkRu8ixBLAp+8QMTd 3ZOZu1wBX3oNP65/6A4T3msdtsOMTC8n7NV9oaCpE0O/P0J4SHDUA2H41VC0M76kxpoX LJmDHlsUKdZd7QDz1khtB1YOgxehYU9ONJG434DMs8yq1v7z5k144rM06AeSRU043uo/ arLw== X-Received: by 10.194.121.163 with SMTP id ll3mr1216768wjb.142.1431035428822; Thu, 07 May 2015 14:50:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.63.8 with HTTP; Thu, 7 May 2015 14:49:48 -0700 (PDT) In-Reply-To: <20150507155955.B8F9EC3841@www1.g3.pair.com> References: <20150507155955.B8F9EC3841@www1.g3.pair.com> From: =?UTF-8?Q?=C3=96mer_Sinan_A=C4=9Facan?= Date: Thu, 7 May 2015 17:49:48 -0400 Message-ID: To: oleg@okmij.org Cc: OCaml Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] MetaOCaml error while running generated code that needs -rectypes > Is the code that contains the Runcode.run also compiled > with -rectypes? Yes, otherwise I'm having a compile time error. > Anyway, I think forcing recursive_types flag right before Runcode.run > may help. Here is how to do it, if ruiining at the top level: > > #directory "INSTALLPREFIX/lib/ocaml/compiler-libs/";; > Clflags.recursive_types := true I'm not using REPL. I still tried to do this but (Meta)OCaml REPL is so ridiculously bad I couldn't even manage to load all the dependencies of my program... > If you compile the code first, then you need to add -I +compiler-libs > to the command line of the compiler. If the problem persists, it would > help to have a small test case. What do you mean by "compile the code first"? My program is in a Github repo, here's how to reproduce: $ git clone https://github.com/osa1/int-proj.git $ cd int-proj $ make unlambda_metaocaml $ ./unlambda_metaocaml programs/Hello.unl -compile File "_none_", line 1: Error: Unit imports from UnlambdaFuns, which uses recursive types. The compilation flag -rectypes is required Fatal error: exception Failure("Error type-checking generated code: scope extrusion?") Thanks. 2015-05-07 11:59 GMT-04:00 : > >> I'm trying to generate some code that needs -rectypes. I'm compiling all >> modules using -rectypes and things mostly work fine, except I can't run >> MetaOCaml generated code, because it's failing with: >> >> File "_none_", line 1: >> Error: Unit imports from UnlambdaFuns, which uses recursive types. >> The compilation flag -rectypes is required > > Is the code that contains the Runcode.run also compiled > with -rectypes? > > Anyway, I think forcing recursive_types flag right before Runcode.run > may help. Here is how to do it, if ruiining at the top level: > > #directory "INSTALLPREFIX/lib/ocaml/compiler-libs/";; > Clflags.recursive_types := true > > If you compile the code first, then you need to add -I +compiler-libs > to the command line of the compiler. If the problem persists, it would > help to have a small test case.