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

Document that Reason dialect is supported out of the box #10284

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

Leonidas-from-XIV
Copy link
Collaborator

Today I learned that we support Reason code out of the box with no additional configuration, which is fairly nice but doesn't appear to be documented so this PR is a suggestion to add a paragraph about that.

Its a fairly neat feature and I assume it could be used more if people were aware of how easy it is to use.

@emillon also suggested that a general howto on how to use reason in a dune project could be useful and that could be a good next step. It's fairly easy after all but if it is not documented, people won't know.

@Leonidas-from-XIV Leonidas-from-XIV force-pushed the default-dialects branch 2 times, most recently from d16d3c7 to 6f17e68 Compare March 19, 2024 09:47
Comment on lines 80 to 84
When ``(using melange)`` is enabled in the `dune-project` a third dialect is
enabled:

* ``rescript`` for the ReScript syntax which is used in `.res` and `.resi`
files. The formatter in this case is ``rescript_syntax``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be specified, rescript_syntax only works in Melange v1 and it doesn't support the entire rescript language (as newer versions) in any form in dune

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As someone who is a bit out of touch with Rescript and Melange, does that mean that rescript_syntax can only be used in Melange v1 (and not v2 or v3) and even then only supports an older subset of the language?

I don't know to which extent Melange v1 + ReScript are used but this sounds like a serious restriction and makes me wonder if supporting something of progressively lower relevance as time goes on and Rescript evolves makes sense overall.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, rescript_syntax (https://opam.ocaml.org/packages/rescript-syntax/) was a tool to help people migrate from ReScript to Melange. It's not a feature dune should keep up, since rescript-syntax isn't up-to-date with https://github.com/rescript-lang/rescript-compiler in any form.

Copy link
Collaborator

@anmonteiro anmonteiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional language tweaks

doc/reference/files/dune-project/dialect.rst Outdated Show resolved Hide resolved
doc/reference/files/dune-project/dialect.rst Outdated Show resolved Hide resolved
doc/reference/files/dune-project/dialect.rst Outdated Show resolved Hide resolved
Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV merged commit cd6f2e4 into ocaml:main Mar 21, 2024
27 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the default-dialects branch March 21, 2024 13:52
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