Commit a9727eff authored by Jacques-Henri Jourdan's avatar Jacques-Henri Jourdan
parents 7bf66e89 43ff328b
* understand whether/why --depend needs a mock [.mli] file too * document that --depend may produce inaccurate dependencies
for parser.cmi and that it is recommended to use --raw-depend
--ocamldep "ocamldep -modules" and work from there (which is
what ocamlbuild does).
* Confirm and understand why the code back-end slows down by 50% * Confirm and understand why the code back-end slows down by 50%
between 4.01.0 and 4.02.1. Use the tag last309 for this purpose, between 4.01.0 and 4.02.1. Use the tag last309 for this purpose,
......
...@@ -94,9 +94,11 @@ let () = ...@@ -94,9 +94,11 @@ let () =
(* The purpose of [--depend] and [--raw-depend] is to support [--infer]. (* The purpose of [--depend] and [--raw-depend] is to support [--infer].
Indeed, [--infer] is implemented by producing a mock [.ml] file (which Indeed, [--infer] is implemented by producing a mock [.ml] file (which
contains just the semantic actions) and invoking [ocamlc]. This requires contains just the semantic actions) and invoking [ocamlc]. This requires
certain [.cmi] files to exist. So, [--depend] is a way for us to announce certain [.cmi] files to exist. So, [--(raw-)depend] is a way for us to
which [.cmi] files we need. It is implemented by producing the mock [.ml] announce which [.cmi] files we need. It is implemented by producing the
file and running [ocamldep] on it. *) mock [.ml] file and running [ocamldep] on it. We also produce a mock
[.mli] file, even though in principle it should be unnecessary -- see
comment in [nonterminalType.mli]. *)
(* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *)
......
...@@ -15,9 +15,20 @@ val tnonterminalgadt: IL.typ -> IL.typ ...@@ -15,9 +15,20 @@ val tnonterminalgadt: IL.typ -> IL.typ
val nonterminalgadtdef: UnparameterizedSyntax.grammar -> IL.typedef list val nonterminalgadtdef: UnparameterizedSyntax.grammar -> IL.typedef list
(* When in [--depend] mode, we are asked to produce a mock [.mli] file before (* When in [--(raw-)depend] mode, we are asked to produce a mock [.mli] file
[--infer] has run, which means that we are usually not able to construct before [--infer] has run, which means that we are usually not able to
the definition of the [nonterminal] GADT. This implies that the mock [.mli] construct the definition of the [nonterminal] GADT. This implies that the
file is a subset of the final [.mli] file. It is not clear at this point mock [.mli] file is a subset of the final [.mli] file. I believe that, when
whether this can cause a problem. *) working with [ocamlbuild], this is not a problem. In fact, the mock [.mli]
file could just as well be empty or absent, and things would still work: in
principle, it is enough for us to publish which files we need in order to
be able to type-check the real [.ml] file used by [--infer]. However, when
working with [make], which is unable to mix the production of targets and
the computation of dependencies, we additionally need to predict which
files one will need in order to compile the real [.mli] and [.ml] files.
Here, the fact that the mock [.mli] file is incomplete could in theory be a
problem, leading to incomplete dependencies. The problem does not lie in
the line [parser.ml parser.mli: ...] that we add; it lies in the lines
produced by [ocamldep] itself, where the line [parser.cmi: ...] is missing
some dependencies. *)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment