Make the interface and implementation fields of a dialect optional#7757
Make the interface and implementation fields of a dialect optional#7757nojb merged 10 commits intoocaml:mainfrom gpetiot:optional-dialect-intf
interface and implementation fields of a dialect optional#7757Conversation
nojb
left a comment
There was a problem hiding this comment.
I'm not fond of the dummy extension. The type Ml_kind.Dict is used in many other places apart from being used for dialects. What about defining a type specifically for dialects that has an optional intf?
|
I added a new module |
nojb
left a comment
There was a problem hiding this comment.
I left a few comments. Also, as a general rule, I am not fond of infix operators such as @@, but that's my personal preference. I don't know if the other Dune devs have a preference. cc @rgrinberg @emillon @Alizter
|
Regarding |
|
Just thinking out loud: we plan to add some formatting-only dialects (for example if you want to set a formatter for JSON files in a project). We just need to make sure that there's no syntax clash. But I don't think that these are going to use |
Indeed what you describe is a different concept that |
interface field of a dialect optional
interface field of a dialect optionalinterface and implementation fields of a dialect optional
nojb
left a comment
There was a problem hiding this comment.
Just to confirm: when, say, (implementation) is missing, then it is still possible to provide one by using .ml? I would add a test showing this.
I added a test and it works as expected. |
Signed-off-by: Guillaume Petiot <guillaume@tarides.com>
nojb
left a comment
There was a problem hiding this comment.
LGTM. A Changes entry and the manual need to be updated.
Signed-off-by: Guillaume Petiot <guillaume@tarides.com>
Signed-off-by: Guillaume Petiot <guillaume@tarides.com>
|
Looks OK to go to me. @emillon does it look OK to you? |
Later I think we should just document the latest version of the language (and omit changelog bits from the manual), but we're not completely there yet. In the meantime I think it's better to use directives than prose for this so I pushed some suggestions. |
Signed-off-by: Etienne Millon <etienne.millon@gmail.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com> Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com> Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
CHANGES: - Validate file extension for `$ dune ocaml top-module`. (ocaml/dune#8005, fixes ocaml/dune#8004, @3Rafal) - Include the time it takes to read/write state files when `--trace-file` is enabled (ocaml/dune#7960, @rgrinberg) - Add `dune show` command group which is an alias of `dune describe`. (ocaml/dune#7946, @Alizter) - Include source tree scans in the traces produced by `--trace-file` (ocaml/dune#7937, @rgrinberg) - Cinaps: The promotion rules for cinaps would only offer one file at a time no matter how many promotions were available. Now we offer all the promotions at once (ocaml/dune#7901, @rgrinberg) - Do not re-run OCaml syntax files on every iteration of the watch mode. This is too memory consuming. (ocaml/dune#7894, fix ocaml/dune#6900, @rgrinberg) - Remove some compatibility code for old version of dune that generated `.merlin` files. Now dune will never remove `.merlin` files automatically (ocaml/dune#7562) - Add `dune show env` command and make `dune printenv` an alias of it. (ocaml/dune#7985, @Alizter) - Add additional metadata to the traces provided by `--trace-file` whenever `--trace-extended` is passed (ocaml/dune#7778, @rleshchinskiy) - Extensions used in `(dialect)` can contain periods (e.g., `cppo.ml`). (ocaml/dune#7782, fixes ocaml/dune#7777, @nojb) - Allow `(include_subdirs qualified)` to be used when libraries define a `(modules ...)` field (ocaml/dune#7797, fixes ocaml/dune#7597, @anmonteiro) - `$ dune describe` is now a command group, so arguments to subcommands must be passed after subcommand itself. (ocaml/dune#7919, @Alizter) - The `interface` and `implementation` fields of a `(dialect)` are now optional (ocaml/dune#7757, @gpetiot) - Add commands `dune show targets` and `dune show aliases` that display all the available targets and aliases in a given directory respectively. (ocaml/dune#7770, grants ocaml/dune#265, @Alizter) - Allow multiple globs in library's `(stdlib (internal_modules ..))` (@anmonteiro, ocaml/dune#7878) - Attach melange rules to the default alias (ocaml/dune#7926, @haochenx) - In opam constraints, reject `(and)` and `(or)` with no arguments at parse time (ocaml/dune#7730, @emillon) - Compute digests and manage sandboxes in background threads (ocaml/dune#7947, @rgrinberg) - Add `(build_if)` to the `(test)` stanza. When it evaluates to false, the executable is not built. (ocaml/dune#7899, fixes ocaml/dune#6938, @emillon) - Add necessary parentheses in generated opam constraints (ocaml/dune#7682, fixes ocaml/dune#3431, @Lucccyo)
CHANGES: - Validate file extension for `$ dune ocaml top-module`. (ocaml/dune#8005, fixes ocaml/dune#8004, @3Rafal) - Include the time it takes to read/write state files when `--trace-file` is enabled (ocaml/dune#7960, @rgrinberg) - Add `dune show` command group which is an alias of `dune describe`. (ocaml/dune#7946, @Alizter) - Include source tree scans in the traces produced by `--trace-file` (ocaml/dune#7937, @rgrinberg) - Cinaps: The promotion rules for cinaps would only offer one file at a time no matter how many promotions were available. Now we offer all the promotions at once (ocaml/dune#7901, @rgrinberg) - Do not re-run OCaml syntax files on every iteration of the watch mode. This is too memory consuming. (ocaml/dune#7894, fix ocaml/dune#6900, @rgrinberg) - Add `--all` option to `dune rpc status` to show all Dune RPC servers running. (ocaml/dune#8011, fix ocaml/dune#7902, @Alizter) - Remove some compatibility code for old version of dune that generated `.merlin` files. Now dune will never remove `.merlin` files automatically (ocaml/dune#7562) - Add `dune show env` command and make `dune printenv` an alias of it. (ocaml/dune#7985, @Alizter) - Add additional metadata to the traces provided by `--trace-file` whenever `--trace-extended` is passed (ocaml/dune#7778, @rleshchinskiy) - Extensions used in `(dialect)` can contain periods (e.g., `cppo.ml`). (ocaml/dune#7782, fixes ocaml/dune#7777, @nojb) - Allow `(include_subdirs qualified)` to be used when libraries define a `(modules ...)` field (ocaml/dune#7797, fixes ocaml/dune#7597, @anmonteiro) - `$ dune describe` is now a command group, so arguments to subcommands must be passed after subcommand itself. (ocaml/dune#7919, @Alizter) - The `interface` and `implementation` fields of a `(dialect)` are now optional (ocaml/dune#7757, @gpetiot) - Add commands `dune show targets` and `dune show aliases` that display all the available targets and aliases in a given directory respectively. (ocaml/dune#7770, grants ocaml/dune#265, @Alizter) - Allow multiple globs in library's `(stdlib (internal_modules ..))` (@anmonteiro, ocaml/dune#7878) - Attach melange rules to the default alias (ocaml/dune#7926, @haochenx) - In opam constraints, reject `(and)` and `(or)` with no arguments at parse time (ocaml/dune#7730, @emillon) - Compute digests and manage sandboxes in background threads (ocaml/dune#7947, @rgrinberg) - Add `(build_if)` to the `(test)` stanza. When it evaluates to false, the executable is not built. (ocaml/dune#7899, fixes ocaml/dune#6938, @emillon) - Add necessary parentheses in generated opam constraints (ocaml/dune#7682, fixes ocaml/dune#3431, @Lucccyo)
Suggested by @emillon in ocaml/ocaml.org#1181 (comment)
Our usecase is defining a dialect for
.emlfiles, that don't have interface files.If I had changed the
Ml_kind.Dict.intfinto an option type there would be too many changes to propagate (I tried) and it makes the code harder to follow (harder to keep the impl/intf abstraction when reading the fields).