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 E51337EEEF for ; Wed, 10 Jun 2015 10:57:04 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alavrik@piqi.org) identity=pra; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alavrik@piqi.org"; x-sender="alavrik@piqi.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alavrik@piqi.org) identity=mailfrom; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alavrik@piqi.org"; x-sender="alavrik@piqi.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f180.google.com) identity=helo; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alavrik@piqi.org"; x-sender="postmaster@mail-ig0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BMAACQ+3dVlLTVVdFcgkWBH18GgxAIvDsFTBoBCYV7AoE5B0wBAQEBAQESAQEBAQcLCwkfMIQiAQEBAQIBEhEEJysFCwkCCw0qAgIhAQ8DAQUBCxEOBwQBHAQBh3cDCggNjw+Qaz4xiz+eVQ2FNQEBAQEBBQEBAQEBAQEBARkKizmCTYFWEQFNBAeCaIFFBYtobYsvglSCO4FggTBAgzuLN4VHEiOBFYQ8TweBBTqBAQEBAQ X-IPAS-Result: A0BMAACQ+3dVlLTVVdFcgkWBH18GgxAIvDsFTBoBCYV7AoE5B0wBAQEBAQESAQEBAQcLCwkfMIQiAQEBAQIBEhEEJysFCwkCCw0qAgIhAQ8DAQUBCxEOBwQBHAQBh3cDCggNjw+Qaz4xiz+eVQ2FNQEBAQEBBQEBAQEBAQEBARkKizmCTYFWEQFNBAeCaIFFBYtobYsvglSCO4FggTBAgzuLN4VHEiOBFYQ8TweBBTqBAQEBAQ X-IronPort-AV: E=Sophos;i="5.13,586,1427752800"; d="scan'208";a="164312063" Received: from mail-ig0-f180.google.com ([209.85.213.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Jun 2015 10:57:02 +0200 Received: by igbpi8 with SMTP id pi8so30750511igb.0 for ; Wed, 10 Jun 2015 01:57:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=j/b10iYr50IdMZ50/da0Q3zE6DUJPoxIY0X4s4tl9iM=; b=lCQiYCJsW8d9xlwWEFQctQv49mwBPyGDA9k2bXU8N99EHZUv073WO/GX1HDXgoLzGG sBgvjpkgZBL3bsbw4cf9yMxTnfpnfPeE+zmgaZkfP0m0Ht6xtwLW1lcw30DAPNIrASuU nrOziMCZHXkHrm6wiPPdXkLMffnf2LvDBe9UXX2kacmQDI5G9R9TV/LfCnfgP8o0vpV/ mglda7DuBDwJN/MpW22quFozyAyE0U79klIUU8ieq6OPK4taxpMIcxEfJNQIykn1wXtT mL21baoEV3bFqh+di9mALr92WGlFf9wSlRHWzLE9WLhdGuo7HkvJRlID3IudAyCVd3jR Dj6w== X-Gm-Message-State: ALoCoQm7QXGfQ+qDRq93fWrsklfpG5dNZYw8u/LvFlwOz/IOe6Qg7rardffLMV5Vk11PqJi6uT3R X-Received: by 10.50.138.70 with SMTP id qo6mr25916037igb.15.1433926621291; Wed, 10 Jun 2015 01:57:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.90.194 with HTTP; Wed, 10 Jun 2015 01:56:21 -0700 (PDT) X-Originating-IP: [108.202.178.18] In-Reply-To: References: From: Anton Lavrik Date: Wed, 10 Jun 2015 01:56:21 -0700 Message-ID: To: piqi@googlegroups.com Cc: caml users Content-Type: multipart/alternative; boundary=001a1134bbc6e580d10518260e96 Subject: Re: [Caml-list] OCaml piqi difficulties --001a1134bbc6e580d10518260e96 Content-Type: text/plain; charset=UTF-8 Hi Kenneth, please see my comment here: https://github.com/alavrik/piqi-ocaml/issues/7 I've added a small change that should help. Anton On Tue, Jun 9, 2015 at 3:48 PM, Kenneth Adam Miller < kennethadammiller@gmail.com> wrote: > To be more clear, after I thought about it a bit more, I think what I need > is definitely one of two things, either: > > 1) to edit is the include path, either for ocamlbuild or oasis. The > problem is, the implementation for a module is already in the library > path... In this way, it will know where to find the appropriate ml, or cmi, > cmo/x > 2) tell piqi how to fully qualify the module into the other library. > -> http://piqi.org/doc/ocaml/#piqitoocamlmapping > Speak of the devil, I think that might be it! > > *edit* > OK, so I think I got it down... now it's just a piqi usage issue.I can > edit the library interface that I'm using to expose that functionality. Now > I need to know: > > .import [ module stmt .name XYZ ] > > once I expose the module name, and I should be able to force it to be > fully qualified with the above. Problem is, I need to have the module name > be Bap.Std.Bap_types.Bil_types.Bil_piqi; the periods are required. Problem: > I can't put periods or '/' in the name of the module in order to get it to > work. Variations on quotes didn't seem to make a difference either... > > How to get piqi to accept a fully qualified name? > > On Tue, Jun 9, 2015 at 4:34 PM, Kenneth Adam Miller < > kennethadammiller@gmail.com> wrote: > >> I've been using piqi for quite a while and it's done wonders for me. >> >> Lately though, I've had some issues with transforming some types provided >> by another library into a piqi representation. >> >> Essentially, I'm at a crossroads where I'm running into a compile error, >> and I'm not sure how to fix it. Here's the root of my problem: >> >> Error: This expression has type Stmt_piqi.stmt list list >> but an expression was expected of type >> Bapservice_piqi.Bapservice_piqi.lifted_region = >> Bapservice_piqi.Bapservice_piqi.stmt_list list >> Type Stmt_piqi.stmt list is not compatible with type >> Bapservice_piqi.Bapservice_piqi.stmt_list = >> Bapservice_piqi.Bapservice_piqi.stmt list >> Type Stmt_piqi.stmt is not compatible with type >> Bapservice_piqi.Bapservice_piqi.stmt = >> [ `cpuexn of Bapservice_piqi.Bapservice_piqi.cpuexn >> | `if_stmt of Bapservice_piqi.Bapservice_piqi.if_stmt >> | `jmp of Bapservice_piqi.Bapservice_piqi.jmp >> | `move of Bapservice_piqi.Bapservice_piqi.move >> | `special of Bapservice_piqi.Bapservice_piqi.special >> | `while_stmt of Bapservice_piqi.Bapservice_piqi.while_stmt ] >> >> >> >> lifted_region is defined in my piqi file as a stmt list list (a list of >> instructions). Here's the part that I don't know: in piqi do I import the >> module instead of including it in order to get the compiler to see that the >> types are equivalent? >> >> (because they are, this is very much like debugging a phantom type error. >> Stmt_piqi.stmt is the same as Bapservice_piqi.stmt). >> >> My thinking with the above question is that if I import the module in >> piqi, then the piqi command will *not* generate a whole new ml, different >> entirely to the ml that was compiled and included in the library that I'm >> using, bap (it currently *is*). In that case, the types will be equivalent >> and everything will compile nicely. >> >> But I attempted to import the module in my piqi file, and that results in >> some compile error that I don't know how to solve: >> >> Unbound module Stmt_piqi. >> >> Naturally, in my makefile for generating ml of piqi encoder/decoder ocaml >> modules, I have an include that points to the folder that contains the bap >> stmt.piqi file. So the piqi ocaml command succeeds, but now I need to tell >> ocaml how to resolve the stmt_piqi module (compiled away in >> bap.serialization). I'm using oasis, and I already have bap.serialization >> in my depends, and the generated piqi ml file is auto detected and the >> correct bap.serialization is propagated through as a specified package on >> the command line. >> >> How do I get the compiler to either see type equivalence of the >> Bapservice_piqi.stmt type or to know where to get the Stmt_piqi module? >> > > -- > You received this message because you are subscribed to the Google Groups > "piqi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to piqi+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > --001a1134bbc6e580d10518260e96 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Kenneth, please see my comment here:=C2=A0https://github.com/alavrik/pi= qi-ocaml/issues/7 I've added a small change that should help.
<= br>
Anton

On Tue, Jun 9, 2015 at 3:48 PM, Kenneth Adam Miller <kennethadammiller@gmail.com> wrote:
To be more clear, after I thought about it a= bit more, I think what I need is definitely one of two things, either:=C2= =A0

1) to edit is the include path, either for ocamlbuil= d or oasis. The problem is, the implementation for a module is already in t= he library path... In this way, it will know where to find the appropriate = ml, or cmi, cmo/x
2) tell piqi how to fully qualify the module in= to the other library.=C2=A0
=C2=A0-> http://piqi.org/doc/ocaml/#piqi= toocamlmapping
Speak of the devil, I think that might be it!<= /div>

*edit*=C2=A0
OK, so I think I got it dow= n... now it's just a piqi usage issue.I can edit the library interface = that I'm using to expose that functionality. Now I need to know:
.import [ module stmt .name XYZ ]

once= I expose the module name, and I should be able to force it to be fully qua= lified with the above. Problem is, I need to have the module name be Bap.St= d.Bap_types.Bil_types.Bil_piqi; the periods are required. Problem: I can= 9;t put periods or '/' in the name of the module in order to get it= to work. Variations on quotes didn't seem to make a difference either.= ..

How to get piqi to accept a fully qualified nam= e?

On Tue, Jun 9, 2015 at 4:34 PM, Kennet= h Adam Miller <kennethadammiller@gmail.com> wrote:=
I've been using piqi for= quite a while and it's done wonders for me.

Lately though, I've had some issues with transformin= g some types provided by another library into a piqi representation.
<= div style=3D"margin:0px;padding:0px;border:0px;vertical-align:baseline;font= -family:Arial,Helvetica,sans-serif;font-size:13px">
Essentially, I'm at a crossroads = where I'm running into a compile error, and I'm not sure how to fix= it. Here's the root of my problem:

Error: This expression has type Stmt_piqi.stmt list list
=C2=A0 = =C2=A0 =C2=A0 =C2=A0but an expression was expected of type
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi.Bapservice_piqi.lifted_region =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi.Bapservice_piqi.= stmt_list list
=C2=A0 =C2=A0 =C2=A0 =C2=A0Type Stmt_piqi.stmt list is no= t compatible with type
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi= .Bapservice_piqi.stmt_list =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= Bapservice_piqi.Bapservice_piqi.stmt list=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2= =A0Type Stmt_piqi.stmt is not compatible with type
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0Bapservice_piqi.Bapservice_piqi.stmt =3D
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0[ `cpuexn of Bapservice_piqi.Bapservice_piqi.cpuexn=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `if_stmt of Bapservice_piqi.= Bapservice_piqi.if_stmt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `jmp = of Bapservice_piqi.Bapservice_piqi.jmp
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| `move of Bapservice_piqi.Bapservice_piqi.move
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `special of Bapservice_piqi.Bapservice_piq= i.special
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `while_stmt of Baps= ervice_piqi.Bapservice_piqi.while_stmt ]



lifted_= region is defined in my piqi file as a stmt list list (a list of instructio= ns). Here's the part that I don't know: in piqi do I import the mod= ule instead of including it in order to get the compiler to see that the ty= pes are equivalent?=C2=A0

(because they are, this is very much l= ike debugging a phantom type error. Stmt_piqi.stmt is the same as Bapservic= e_piqi.stmt).

My thinking with the above question is that if I i= mport the module in piqi, then the piqi command will *not* generate a whole= new ml, different entirely to the ml that was compiled and included in the= library that I'm using, bap (it currently *is*). In that case, the typ= es will be equivalent and everything will compile nicely.

But = I attempted to import the module in my piqi file, and that results in some = compile error that I don't know how to solve:

Unbound modu= le Stmt_piqi.=C2=A0

Naturally, in my makefile for generating ml = of piqi encoder/decoder ocaml modules, I have an include that points to the= folder that contains the bap stmt.piqi file. So the piqi ocaml command suc= ceeds, but now I need to tell ocaml how to resolve the stmt_piqi module (co= mpiled away in bap.serialization). I'm using oasis, and I already have = bap.serialization in my depends, and the generated piqi ml file is auto det= ected and the correct bap.serialization is propagated through as a specifie= d package on the command line.

How do I get the compiler to eith= er see type equivalence of the Bapservice_piqi.stmt type or to know where t= o get the Stmt_piqi module?

--
You received this message because you are subscribed to the Google Groups &= quot;piqi" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to piqi+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--001a1134bbc6e580d10518260e96--