<p dir="ltr">I think making the application of a ppx look more like a functor application solves the name spacing issue for the most part.</p>
<div class="gmail_quote">Den 6 maj 2014 06:29 skrev "Alain Frisch" <<a href="mailto:alain@frisch.fr">alain@frisch.fr</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 5/2/2014 4:29 PM, Peter Zotov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have just released the first version of ppx_protobuf, a complete<br>
Protocol Buffers implementation.<br>
</blockquote>
<br>
This is a very cool project, and a good first public use of extension points!<br>
<br>
An aspect of attributes that is not fully settled is how to use namespacing in order to ensure that multiple tools interact nicely.<br>
This topic will hopefully be explored by the community to reach a good consensus.<br>
<br>
For instance, ppx_protobuf relies on attributes with quite generic names such as @default or @key, that might also be useful to other tools.  It might very well be the case that the same @default attribute (with the same value) would actually be useful to both ppx_protobuf and another deriving-like extension.  This is good, since attributes are not designed to be necessarily targeted to only one specific tool.  But in some cases, one might want to use a different @default attribute for different tools.  What about supporting both a short form @default and a more qualified one @protobuf.default?  This should support both situations.<br>

<br>
Another point: for record fields, you interpret attributes at the toplevel of their type. I did not look precisely at the semantics of ppx_protobuf, but it seems that it might be more logical to attach them to the field directly (do you confirm?):<br>

<br>
  type defaults = {<br>
     results [@key 1] [@default 10]: int;<br>
  } [@@protobuf]<br>
<br>
I understand that this form is syntactically "more intrusive" in the non-decorated type definition.  Is it the reason to use:<br>
<br>
  type defaults = {<br>
     results : int [@key 1] [@default 10];<br>
  } [@@protobuf]<br>
<br>
?<br>
<br>
I don't see anything wrong with doing so, although it might be worth supporting both forms.<br>
<br>
<br>
-- Alain<br>
<br>
-- <br>
Caml-list mailing list.  Subscription management and archives:<br>
<a href="https://sympa.inria.fr/sympa/arc/caml-list" target="_blank">https://sympa.inria.fr/sympa/<u></u>arc/caml-list</a><br>
Beginner's list: <a href="http://groups.yahoo.com/group/ocaml_beginners" target="_blank">http://groups.yahoo.com/group/<u></u>ocaml_beginners</a><br>
Bug reports: <a href="http://caml.inria.fr/bin/caml-bugs" target="_blank">http://caml.inria.fr/bin/caml-<u></u>bugs</a><br>
</blockquote></div>