[wg-camlp4] Pending issues
pierre.chambart at ocamlpro.com
Tue Feb 12 20:12:26 GMT 2013
Le Mon, 11 Feb 2013 15:45:52 +0100,
Alain Frisch <alain.frisch at lexifi.com> a écrit :
> 4. What to do with attributes in the type-checker
> A related question is related to the current work on runtime types.
> Attributes on type declarations could be kept in the runtime
> representation of the declarations, allowing libraries to interpret
> them as they want. (LexiFi's version of OCaml has been extended with
> attributes on type declarations precisely to do that.) Having
> attributes defined as general expressions, however, means that those
> libraries would need to link with compiler-libs, or at least be
> compiled against some of its .cmi, in order to be able to analyze the
> Parsetree. I don't see it is as a big problem, and it would also be
> possible to restrict which expressions are reflected in runtime types
> (e.g. to structured constants). Comments are welcome!
I think it is usualy a bad idea to need to link against compiler-libs.
Doing so almost certainly prevent you from being able to compile
against different version of the compiler. This ast should be
fixed once and be provided in the stdlib. I would also prefer to
restrict that kind of annotation to a small subset of the expression
language avoiding as much as possible duplication. This would simplify
the code using those annotations. Maybe only list, Variant, record and
string literals/identifiers would be sufficient. Maybe also let in ?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
More information about the wg-camlp4