Docs about annotations?


Hi all

Where can I find a good explanation about annotations for example @bs.val, @bs.module, @bs.send, etc?
I’ve found

But I am not sure, if it is up-to-date.





Sorry for being naive about OCaml terminology. But what are these special looking annotations in OCaml world? So far, I have seen @bs.val, @bs.module, @bs.send, @bs.send, @bs.meth, [@bs.deriving abstract], etc.

What are these entities called? Are they similar to decorators that we see in other languages? Is that syntax specific to BuckleScript or general compiler directives for OCaml or some sort of native language construct? I could not Google it as I do not really know what I should be looking for.

Any link explaining this concept would be great.


Hi, in general these annotations are called extension points and they tell the compiler to transform the parsed syntax tree in a particular way. So they are pretty similar to macros, in a limited way. Here’s a good write-up: