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

Add language: Mojo #6400

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Add language: Mojo #6400

merged 1 commit into from
Mar 13, 2024

Conversation

lattner
Copy link
Contributor

@lattner lattner commented May 2, 2023

Add a new programming language to Linguist, named Mojo, for file extensions .mojo and .🔥. You can learn more about Mojo at https://docs.modular.com/mojo/.

Description

Mojo is a new programming language developed by me (Chris Lattner) and my amazing team at Modular.

Because it's a brand new language, it does not meet linguist's requirements for broad use on GitHub. The team and I thought that we'd send this anyway, to see if an exception could be made, based on the success and widespread use on GitHub of some of my other programming languages (LLVM IR, MLIR, Swift). If that's not possible, no worries, and thanks for your time!

Checklist:

@lildude
Copy link
Member

lildude commented May 3, 2023

The team and I thought that we'd send this anyway, to see if an exception could be made, based on the success and widespread use on GitHub of some of my other programming languages (LLVM IR, MLIR, Swift).

Unfortunately, we can't as it sets a precedent we don't want to fight each and every time someone develops "the next greatest thing, promise on my hamster's life". Given the popularity you've mentioned, and the hype around AI, it shouldn't take long to reach the levels we require though.

@lattner
Copy link
Contributor Author

lattner commented May 3, 2023

Makes sense, thank you for the consideration!

Copy link
Collaborator

@Alhadis Alhadis left a comment

Choose a reason for hiding this comment

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

An emoji file extension. I've seen everything now…

lib/linguist/languages.yml Outdated Show resolved Hide resolved
@lattner
Copy link
Contributor Author

lattner commented May 7, 2023

An emoji file extension. I've seen everything now…

Can't stop the innovation! :)

@modocache
Copy link
Contributor

Hey all! First off thanks for your reviews since we first submitted this pull request. Originally Chris wrote:

Because it's a brand new language, it does not meet linguist's requirements for broad use on GitHub.

But I believe we may now meet those requirements. The contribution guidelines here say to look for 200 unique :user/:repo repositories, but that due to GitHub search being in flux, temporarily the requirement documented here is "at least 2000 files per extension indexed in the last year (the number you see at the top of the search results)." In a search for files named *.mojo here, I see 1.1k results -- and there a few .🔥 results as well.

Also, not sure if it's worth mentioning, but as of this patch, Vim now recognizes the .mojo and .🔥 extensions.

So, would it be possible to take another look at this and its "Pending Popularity" tag? Thanks in advance! 🙏 @lildude @Alhadis

@lildude
Copy link
Member

lildude commented Sep 13, 2023

No change. It still doesn't look popular enough, especially when you consider that mojo-lang owns most of them so excluding them drops things quite considerably, And most definitely not the emoji extension. You might want to consider removing that extension from this PR as it will only delay things. Users can always implement an override until such time as it's popular enough for addition in the future.

@lildude
Copy link
Member

lildude commented Sep 13, 2023

And further refinement shows a lot of those remaining files are XML, which whilst not popular enough for inclusion right now, would need to be explicitly added to XML in this PR too to ensure they remain correctly identified as XML (the extension takes precedence so this PR as it stands would cause all those files to be identified as Mojo and incorrect syntax highlighting will apply).

Current results if we exclude mojo-lang and XML.

@modocache
Copy link
Contributor

Gotcha, thanks for the quick & thorough response! I'll use those searches to keep tabs on things, and in the meantime update this PR to handle XML with a .mojo extension.

And most definitely not the emoji extension. You might want to consider removing that extension from this PR as it will only delay things.

I see, so I should consider the popularity of the .mojo extension as separate from the popularity of the .🔥 extension. That makes sense, thanks!

@modocache
Copy link
Contributor

Thanks for your help! I pushed an update here with heuristics for Mojo vs. XML, and removed .🔥.

I'll keep an eye on the search link you shared and ping this thread when we cross the popularity threshold. Right now I see 1.1k public Mojo files that are not XML 😃

@djkelleher
Copy link

This Google Sheet is a great way to view Mojo popularity: https://docs.google.com/spreadsheets/d/1mmS5xwRrtBIZubdEIrUpsGzZxX2mcqcc74tBjDfo6Lo/edit?usp=sharing (updated daily)
A quick look shows:

  • there are currently about 310 unique (non-fork) public Mojo repos.
  • the current rate of new Mojo file creation is about 3k a year. (1588 files/6.5ish months since launch)(12month/year) = 2932 files/year
  • sum of forks for all unique repos is over 2.3k

@djkelleher
Copy link

Update: currently 4479 Mojo🔥 files across ~355 confirmed Mojo🔥 repos 🎉🎉

@tairov
Copy link

tairov commented Dec 3, 2023

@lildude I think we're good to go

image

@modocache
Copy link
Contributor

Hah, thank you to all of our community members pinging this -- it does indeed look like we're above the 2k source file threshold! Reviewers, please take a look at your earliest convenience, thanks!

@lildude
Copy link
Member

lildude commented Dec 5, 2023

Hah, thank you to all of our community members pinging this -- it does indeed look like we're above the 2k source file threshold! Reviewers, please take a look at your earliest convenience, thanks!

Not quite. Three users are having an undue influence on the figures with one repo accounting for over 1000 of the results. Excluding them and forks brings things down quite a bit.

@modocache modocache force-pushed the mojo branch 2 times, most recently from 65d34db to 65d8b97 Compare December 5, 2023 14:19
@modocache
Copy link
Contributor

Aha, gotcha -- thanks! Sorry for all the pings, the idea of getting highlighted on GitHub is very exciting 🤩

I'll try to keep an eye on the search, and comment here once it looks like we've reached 2k, excluding any users with an outsized number of files. Thanks for all your help!

@lildude
Copy link
Member

lildude commented Dec 5, 2023

I'll try to keep an eye on the search, and comment here once it looks like we've reached 2k, excluding any users with an outsized number of files.

Please don't. PRs are only merged when I'm getting close to making a new release and I will check all usage of pending PRs at that time.

@modocache
Copy link
Contributor

modocache commented Dec 5, 2023

Ah OK, thanks for the clarification, sorry if I missed that -- no pinging it is. Thanks!

@djkelleher
Copy link

djkelleher commented Dec 5, 2023

I'll try to make this my last annoying comment 🙂

I think the count shown in the sheet is more accurate than that query. There are more non-fork Mojo repos that show up when you leave off the fork:false parameter, and also more that show up using different queries and API endpoints, as well as a few that seem to be not indexed at all.

The way to get the most accurate count seemed to be to try a bunch of queries (via HTTP API), use the fork boolean in the JSON responses to filter out forks, then check the file content/extension.

Everything in the sheet has been gone through by multiple people and the file count as of today is 4585 with one outlier of 2579. Excluding outlier: 4585-2579=2006 files

@iamtimdavis
Copy link

iamtimdavis commented Mar 12, 2024

@lildude - Just wanted to check if we need to do anything else here? Want to make sure you have everything you need from us. Thanks so much again

@lildude
Copy link
Member

lildude commented Mar 12, 2024

Almost... I can't update the PR to merge in master as maintainers haven't been granted write perms on this PR and can't approve CI to run for some reason.

Usage looks good though.

@modocache
Copy link
Contributor

Almost... I can't update the PR to merge in master as maintainers haven't been granted write perms on this PR and can't approve CI to run for some reason.

Amazing! Sorry, small parse error on my end for this sentence -- do I need to, or can I, update write permissions on this PR? Or are you saying that for some reason write permissions don't seem to have been granted by some automated process, and it's not something I can fix?

Add a new programming language to Linguist, named Mojo, for the file
extension `.mojo`. You can learn more about Mojo at
https://docs.modular.com/mojo/.

Co-authored-by: Chris Lattner <lattner@users.noreply.github.com>
@lildude
Copy link
Member

lildude commented Mar 13, 2024

Almost... I can't update the PR to merge in master as maintainers haven't been granted write perms on this PR and can't approve CI to run for some reason.

Amazing! Sorry, small parse error on my end for this sentence -- do I need to, or can I, update write permissions on this PR? Or are you saying that for some reason write permissions don't seem to have been granted by some automated process, and it's not something I can fix?

It's something you do when creating the PR and can be updated on current PRs. See the docs here.

@lildude
Copy link
Member

lildude commented Mar 13, 2024

NM. You can't because your fork is owned by an org. It's only an option for personally owned forks.

@lildude lildude added this pull request to the merge queue Mar 13, 2024
Merged via the queue into github-linguist:master with commit 288e97a Mar 13, 2024
5 checks passed
@lattner
Copy link
Contributor Author

lattner commented Mar 13, 2024

Thank you @lildude !

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants