linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add Roc Language

Open ryanb opened this issue 2 years ago • 8 comments

This adds syntax grammar for Roc, an up and coming functional language.

@lildude It would be amazing to get this in before 7.28.0 is deployed tomorrow. A lot of us are doing Advent of Code with Roc this year and would really appreciate some syntax highlighting.

Checklist:

  • [x] I am adding a new language.
    • [x] The extension of the new language is used in hundreds of repositories on GitHub.com.
      • Search results for each extension:
        • https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.roc+app
    • [x] I have included a real-world usage sample for all extensions added in this PR:
    • [x] I have included a syntax highlighting grammar: https://github.com/ivan-demchenko/roc-vscode-unofficial
      • Even though this repo says "unofficial", it was requested to be used by Richard Feldman, the creator of Roc.
    • [x] I have added a color
      • Hex value: #7c38f5
      • Rationale: Primary color on https://roc-lang.org
    • [ ] I have updated the heuristics to distinguish my language from others using the same extension.

ryanb avatar Dec 12 '23 05:12 ryanb

@lildude I updated the samples with real-world code and rebased off master. Let me know if you need anything else.

ryanb avatar Dec 12 '23 17:12 ryanb

@lildude do the samples need to be complete and compile on their own, or can they be snippets of a larger file or library?

ryanb avatar Dec 20 '23 19:12 ryanb

They need to be real world examples… we want samples that demonstrate how people really use the language, not contrived hogwash. We don't care if they compile or not as all we're doing is using them to train the classified.

lildude avatar Dec 20 '23 20:12 lildude

@lildude I updated the samples to match the requirements. Let me know if there are any other issues.

ryanb avatar Jan 10 '24 23:01 ryanb

@ryanb @lildude Would it be better to use a tree-sitter grammar? This one is complete and i suspect would provide better highlighting than a textmate style one: https://github.com/faldor20/tree-sitter-roc

faldor20 avatar Jan 30 '24 05:01 faldor20

@ryanb @lildude Would it be better to use a tree-sitter grammar? This one is complete and i suspect would provide better highlighting than a textmate style one: https://github.com/faldor20/tree-sitter-roc

Nope as linguist has no control over the use of tree-sitter grammars as this is entirely up to the team that maintains the highlighting engine as mentioned previously in https://github.com/github-linguist/linguist/discussions/6073. As with the same question in https://github.com/github-linguist/linguist/pull/6689#issuecomment-1913086778 this is not likely to happen any time soon given the low usage of this language.

lildude avatar Jan 30 '24 08:01 lildude

Ahh, thanks for clarifying, that's a shame. I'll raise this again sometime in the next decade if roc achieves some level of success 😅

faldor20 avatar Jan 30 '24 08:01 faldor20

@lildude any update on the status of this? Do you need anything else from me?

ryanb avatar Feb 15 '24 22:02 ryanb

Thanks for merging! Looking forward to seeing it live.

ryanb avatar Mar 08 '24 17:03 ryanb