Skip to content

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

Merged
Leonidas-from-XIV merged 1 commit intoocaml:mainfrom
Leonidas-from-XIV:default-dialects
Mar 21, 2024
Merged

Document that Reason dialect is supported out of the box#10284
Leonidas-from-XIV merged 1 commit intoocaml:mainfrom
Leonidas-from-XIV:default-dialects

Conversation

@Leonidas-from-XIV
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV merged commit cd6f2e4 into ocaml:main Mar 21, 2024
@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.

4 participants