-
Notifications
You must be signed in to change notification settings - Fork 8
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
Moving away from mustache #95
Comments
I've just learned about an OCaml templating project: https://github.com/EmileTrotignon/embedded_ocaml_templates Together with YAY, this might be enough to move away from mustache without having to learn Ruby. |
@Zimmi48 just told me about this issue; |
FTR, if YAY was not a satisfying solution and we wanted a true YAML library, we wouldn't need to go through such a route: there's also https://github.com/avsm/ocaml-yaml which provides OCaml bindings on top of the libyaml C library. |
In my humble opinion it would be nice to keep the non-OCaml dependencies to a minimum. The Coq ecosystem is already coupled to OCaml. It may be expedient to write the tooling in Python or Ruby, but doing so adds Yet Another Language Ecosystem to the stack of things a user would need to setup in order to use the tool. Instead of complicating our tech stack with extra language dependencies, I'd like to advocate for making the proper investments into OCaml to make it suitable for this task - especially if the primary consideration is whether or not there's a YAML parser that's up to the task. |
We (Karl and I) are in agreement that it's better to depend on the OCaml ecosystem because it will make it easier for Coq users to contribute than if we were to use, say Ruby. So this is what we plan for the v2 of the templates. Regarding the question of a YAML parser, there are actually two options: the YAY (full OCaml) parser and the ocaml-yaml library (both were mentioned above). So we should be fine. |
Mustache is a pretty limited template language. In particular with respect to conditionals. Here are some options for moving away from it:
Use Ruby. I don't know this language yet but I heard it's pretty well suited for advanced templating (in particular with ERB IIUC).
Parse the
meta.yml
file and generate everything in OCaml. IINM, there doesn't exist a YAML parser in OCaml but there is a new parser for a variant of it which is probably very suitable for what we do with this language: https://github.com/chetmurthy/yayThe text was updated successfully, but these errors were encountered: