Open rizo opened 10 years ago
This repository was created to collect use case for what since became the "annotation and extension nodes", implemented by Alain Frisch, to be used with ppx processors. It will be included in the next release of OCaml, due around this summer. You can find more discussions and link from this blog post: http://www.lexifi.com/blog/ppx-and-extension-points
However, keep in mind that this is still rather experimental, and might change a bit in the next few versions.
Thanks for your interest!
On Mon, Aug 4, 2014 at 1:44 PM, Rizo Isrof notifications@github.com wrote:
Where can I follow the discussion about light annotations syntax? Will it be implemented someday?
- https://github.com/gasche/ocaml-syntax-extension-discussion/wiki/Use-Cases-using-light-annotations
Thanks.
— Reply to this email directly or view it on GitHub https://github.com/gasche/ocaml-syntax-extension-discussion/issues/1.
Thanks for the quick reply!
I am already familiar with the extension points and have been experimenting with the some new extensions. I was wondering if the syntax for the extensions, as described here by Alain Frisch, for attributes ([@id ... ]
), attributes on item ([@@id ...]
) and floating attributes ([@@@id ...]
) is final. And if the syntax described in Use Cases using light annotations is just "imaginary" or will actually be implemented.
As a background, I am starting to learn OCaml and find it really confusing to see so many @
applied in different contexts: @
as append operator, @@
as an alternative to Haskell's $
operator and all the @*
for the extensions.
I think the syntax is final (in the sense that it won't change before the release, and probably won't after). The syntax in those examples was indeed imaginary, although I think it corresponded to Alain's syntax proposal at the time.
If you are a beginner, I would recommend that you stay away from using those at the start -- except if you decide to use some library that provides such an extension. My experience is that there are easily overused in a way that, as you noted, hurts readability. Or at least, if you design some syntactic sugar, make the underlying library as usable as possible without it.
On Mon, Aug 4, 2014 at 2:03 PM, Rizo Isrof notifications@github.com wrote:
Thanks for the quick reply!
I am already familiar with the extension points and have been experimenting with the some new extensions. I was wondering if the syntax for the extensions, as described here http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/trunk/experimental/frisch/extension_points.txt?view=markup by Alain Frisch, for attributes ([@id ... ]), attributes on item ([@@id ...]) and floating attributes ([@@@id ...]) is final. And if the syntax described in Use Cases using light annotations https://github.com/gasche/ocaml-syntax-extension-discussion/wiki/Use-Cases-using-light-annotations is just "imaginary" or will actually be implemented.
As a background, I am starting to learn OCaml and find it really confusing to see so many @ applied in different contexts: @ as append operator, @@ as an alternative to Haskell's $ operator and all the @* for the extensions.
— Reply to this email directly or view it on GitHub https://github.com/gasche/ocaml-syntax-extension-discussion/issues/1#issuecomment-51051274 .
Thanks for the suggestion! Actually I was thinking to try to implement my own test extensions to understand how the internals of the parsing work.
Where can I follow the discussion about light annotations syntax? Will it be implemented someday?
Thanks.