Skip to content

Conversation

@dgurchenkov
Copy link

@dgurchenkov dgurchenkov commented Dec 12, 2025

I am updating a definition of an existing language.

Description

This PR contains updated heuristics and new examples for Mojo language. The language was added to Linguist more than a year ago and since then the language syntax has changed. In particular, we added a new keyword ("comptime") that is unique to the language and thus it makes sense to include it in the detection heuristics. I also added new examples that better reflect the current syntax of the language.

Checklist:

@dgurchenkov dgurchenkov requested a review from a team as a code owner December 12, 2025 03:39
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

We do not change samples. These samples are used to train the classifier and whilst languages evolve, the content on GitHub may not, and as such we prefer to keep samples as they were when added and prefer to add more samples.

Please revert the changes to the samples and instead add more real-world samples representing the evolution of the language. Be sure to update the PR template to link to the original source of the new samples and state their license.

@dgurchenkov
Copy link
Author

dgurchenkov commented Dec 12, 2025

We do not change samples. These samples are used to train the classifier and whilst languages evolve, the content on GitHub may not, and as such we prefer to keep samples as they were when added and prefer to add more samples.

Please revert the changes to the samples and instead add more real-world samples representing the evolution of the language. Be sure to update the PR template to link to the original source of the new samples and state their license.

Thank you Colin for looking at this so quickly!
I reverted changes to the samples, and instead added two more sample files. Links to the sample files are in the updated description. License is stated and included in the files as well.

Please let me know if the changes are in line with your expectations, happy to change it further.

Also, if you don't mind me asking -- I have updated the language grammar in the repo linked from the linguist/blob/main/vendor/README.md file (https://github.com/modular/mojo-syntax) so I don't need to do anything in this PR, the grammar change will be pulled from the linked repo automatically on the next release. Is that right?

@dgurchenkov dgurchenkov requested a review from lildude December 12, 2025 17:43
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.

2 participants