Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable syntax extensions when ".syntax" is specified #11

Merged
merged 2 commits into from
Dec 21, 2012

Conversation

mk270
Copy link
Contributor

@mk270 mk270 commented Dec 21, 2012

I appreciate this is not ideal, and doesn't support syntax extensions other than those ending in .syntax, and doesn't support camlp4r at all, though both issues are fixable

@mk270
Copy link
Contributor Author

mk270 commented Dec 21, 2012

Ok, is that better?

gildor478 added a commit that referenced this pull request Dec 21, 2012
Enable syntax extensions when findlib package name ends with ".syntax".
@gildor478 gildor478 merged commit 6460e39 into ocaml:master Dec 21, 2012
@avsm
Copy link
Member

avsm commented Dec 21, 2012

Does this mean no more tags editing is needed for syntax extensions?

@mk270
Copy link
Contributor Author

mk270 commented Dec 21, 2012

@avsm - that is the intended effect, yes.

In my mental model of the world, which might be impossible to achieve in practice, you have an _oasis file, and oasis generates the _tags for you programmatically, and you don't have to then go and edit this if you want to use lwt, or any other syntax-providing package, so long as the package name is *.syntax, and it uses the camlp4o style.

I hope that this means we can just ship the _oasis file, and not have to ship the myocamlbuild.ml and setup.ml and _tags files in a repo, but maybe I'm misguided.

@avsm
Copy link
Member

avsm commented Dec 21, 2012

I'll just sit here and do a little happy dance :-) It's always been tough explaining to beginners why they need to edit _tags under some circumstances. The .syntax heuristic seems pretty good to me.

On 21 Dec 2012, at 21:17, Martin Keegan notifications@github.com wrote:

@avsm - that is the intended effect, yes.

In my mental model of the world, which might be impossible to achieve in practice, you have an _oasis file, and oasis generates the _tags for you programmatically, and you don't have to then go and edit this if you want to use lwt, or any other syntax-providing package, so long as the package name is *.syntax, and it uses the camlp4o style.

I hope that this means we can just ship the _oasis file, and not have to ship the myocamlbuild.ml and setup.ml and _tags files in a repo, but maybe I'm misguided.


Reply to this email directly or view it on GitHub.

@mk270
Copy link
Contributor Author

mk270 commented Dec 21, 2012

The heuristic is due to @thelema (of #ocaml). I am just the guy who tries to get these newbie-friendly fixes upstream

@gildor478
Copy link
Member

If people follow some convention with naming meta it is indeed a quick win. But this convention is not that common (sic).

N.B. there is an OSR for that:
http://caml.inria.fr/pub/ml-archives/caml-list/2008/03/b0d231842ff14d79af1561888c8d1111.fr.html

Although no OSR has been really endorsed and agreed upon... Which is shame to my mind.

@thelema
Copy link

thelema commented Dec 21, 2012

@gildor478 We can check for "pa_" as a prefix of ocamlfind packages to identify syntax extensions.

@mk270 I think your hope to only ship _oasis files is a bit misguided, as it seems the goal from the very beginning for a setup.ml that is independent of the oasis executable to be generated and shipped. Oasis would be much simpler if it was needed to compile packages that used it. That said, with oasis being much easier to install now, maybe it can be a standard component of ocaml installs like findlib, and this issue can go away.

@avsm
Copy link
Member

avsm commented Dec 21, 2012

I do think the goal of having all the build information in the _oasis file is very important though. Right now, it's spread across _tags and very hard to explain to beginners, and simply doesn't allow the option of having a clean repository without the autogenerated content.

On 21 Dec 2012, at 22:28, Edgar Friendly notifications@github.com wrote:

@gildor478 We can check for "pa_" as a prefix of ocamlfind packages to identify syntax extensions.

@mk270 I think your hope to only ship _oasis files is a bit misguided, as it seems the goal from the very beginning for a setup.ml that is independent of the oasis executable to be generated and shipped. Oasis would be much simpler if it was needed to compile packages that used it. That said, with oasis being much easier to install now, maybe it can be a standard component of ocaml installs like findlib, and this issue can go away.


Reply to this email directly or view it on GitHub.

@gildor478
Copy link
Member

@thelema Well the good design would be to query ocamlfind, so that it can reports itself if it is a syntax extension or not:
$ ocamlfind query -predicates "syntax,preprocessor" type-conv.syntax -a-format
pa_type_conv.cmo
$ ocamlfind query -predicates "syntax,preprocessor" oUnit -a-format
(nothing)

This can be done at the "oasis setup" time (although in myocamlbuild, but this is more expensive).

@avsm Well you can use oasis.dynrun (oasis setup --setup-update dynamic). We can avoid generating _tags in this mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants