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 BQN language #6623

Merged
merged 11 commits into from
Jun 7, 2024
Merged

Add BQN language #6623

merged 11 commits into from
Jun 7, 2024

Conversation

skykanin
Copy link
Contributor

@skykanin skykanin commented Dec 4, 2023

Add support for the BQN language as it's now passed the 2k unique file threshold.

Checklist:

@skykanin skykanin requested a review from a team as a code owner December 4, 2023 14:29
@lildude
Copy link
Member

lildude commented Dec 4, 2023

Add support for the BQN language as it's now passed the 2k unique file threshhold.

Not quite. 1 repo alone accounts for 380 of those files.

@skykanin
Copy link
Contributor Author

skykanin commented Dec 4, 2023

Add support for the BQN language as it's now passed the 2k unique file threshhold.

Not quite. 1 repo alone accounts for 380 of those files.

So how many files can a single repository maximally account for as a percentage of the threshold?

@lildude
Copy link
Member

lildude commented Dec 4, 2023

So how many files can a single repository maximally account for as a percentage of the threshold?

It's not about how many files a repo has but rather how widely used the extension is. If there is an indication of a single user or repo having a disproportionate impact on the usage, I'll exclude it... 2000 files spread across 200 repos is a lot more indicative of widespread usage than 2000 files in a single repo.

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.

Along with addressing the failing tests, we need the cached license file from the grammar. When you ran the script/add-grammar script, it should have downloaded a copy.

If it didn't (I've seen this a few times but haven't had the chance to look into it), you can get the file by running this line from the script:

bundle exec licensed cache -c vendor/licenses/config.yml

You'll also need to run script/list-grammars also run at the bottom of that script.

@skykanin
Copy link
Contributor Author

skykanin commented Dec 5, 2023

You'll also need to run script/list-grammars also run at the bottom of that script.

When I try to run script/list-grammars I get the following error:

./script/list-grammars
Traceback (most recent call last):
        9: from ./script/list-grammars:4:in `<main>'
        8: from ./script/list-grammars:4:in `require'
        7: from /home/skykanin/Projects/linguist/lib/linguist.rb:5:in `<top (required)>'
        6: from /home/skykanin/Projects/linguist/lib/linguist.rb:5:in `require'
        5: from /home/skykanin/Projects/linguist/lib/linguist/language.rb:9:in `<top (required)>'
        4: from /home/skykanin/Projects/linguist/lib/linguist/language.rb:9:in `require'
        3: from /home/skykanin/Projects/linguist/lib/linguist/classifier.rb:1:in `<top (required)>'
        2: from /home/skykanin/Projects/linguist/lib/linguist/classifier.rb:1:in `require'
        1: from /home/skykanin/Projects/linguist/lib/linguist/tokenizer.rb:2:in `<top (required)>'
/home/skykanin/Projects/linguist/lib/linguist/tokenizer.rb:2:in `require': cannot load such file -- linguist/linguist (LoadError)

Seems that it's unable to load linguist/linguist from lib/linguist/tokenizer.rb for some reason.

@lildude
Copy link
Member

lildude commented Dec 5, 2023

You need to install the linguist gem... or use the Codespace we recommend.

@lildude lildude changed the title add BQN language Add BQN language Dec 5, 2023
@skykanin
Copy link
Contributor Author

skykanin commented Dec 5, 2023

You need to install the linguist gem... or use the Codespace we recommend.

Is that different from the github-linguist gem? Cause I have that one installed and I can't see any gem simply called "linguist"

@lildude
Copy link
Member

lildude commented Dec 5, 2023

Yes, it's the github-linguist gem. If you've got it installed, try running bundle exec ./script/list-grammars else try the Codespace.

@lildude
Copy link
Member

lildude commented Dec 5, 2023

Oh yes, and you'll need to run it after you've sorted out the other issues reported in the test failures as the vendor/README.md file which script/list-grammars will only be updated once you've added the missing tm_scope field.

@RocketRace
Copy link

RocketRace commented Dec 7, 2023

Add support for the BQN language as it's now passed the 2k unique file threshhold.

Not quite. 1 repo alone accounts for 380 of those files.

Now, this obviously doesn't discount the issue that many of the files are concentrated in one repository. However, I think it's worth clarifying that the linked repository automatically mirrors solutions to Rosetta Code programming tasks implemented by various users of the site, as opposed to a single power user.

@mlochbaum
Copy link

mlochbaum commented Dec 8, 2023

There are quite a lot of non-indexed repositories with BQN code. I found this while looking for Advent of Code repositories for this page and this year's chart, and as I investigate it keeps getting worse...

I check whether a repository is indexed by finding a BQN file and searching for its path or a few keywords in it. For indexed repositories I'm always able to find the file. For others I can't. I've checked some of the Advent of Code repos by searching in the repo, and it says it needs to index it and then a quarter hour later or so I can find files. Today I found these on pages 5 and 6 of a repository search; these are the only ones I tried and none are indexed!

List of 35 AoC repos I believe aren't indexed, out of <90 checked (but as I'm using manual searches, there's probably an error or two in here). These account for 308 bqn files based on local clones. Biased for 2023 because I can only find non-indexed repos by searching repo names/descriptions and commit messages, and it doesn't include the two or three I force-indexed.

Non-indexed Advent of Code

https://github.com/AlexDikelsky/puzzles
https://github.com/alephno/aoc2021
https://github.com/alvinvoo/aoc2021
https://github.com/arwn/aoc2021
https://github.com/bddean/aoc-2021 (renamed; merge with bddean/aoc)
https://github.com/dancek/bqn-advent2021
https://github.com/frasiyav/AoC2021
https://github.com/m-lima/advent-of-code-2021
https://github.com/mathiasmagnusson/advent-of-code-21 (deleted)
https://github.com/AugustUnderground/AoC2022
https://github.com/Choram/AoC2022BQN
https://github.com/DavidCromp/aoc2022 (renamed)
https://github.com/Nhlest/AoC2022
https://github.com/SamuelSarle/advent
https://github.com/akamayu-ouo/AoC
https://github.com/asherbhs/aoc2022 (deleted)
https://github.com/axelbdt/aoc (deleted)
https://github.com/bddean/aoc
https://github.com/dancek/bqn-advent2022
https://github.com/dankeyy/aoc22
https://github.com/dgkf/advent-of-code
https://github.com/eissplitter/aoc (renamed to aoc-2022, not indexed)
https://github.com/extorious/aoc2022
https://github.com/felixr/advent-of-code
https://github.com/juriad/advent2022
https://github.com/mpizzzle/AdventOfCode
https://github.com/saltysylvi/bqn-aoc2022
https://github.com/DataKinds/aoc2023
https://github.com/GoldsteinE/aoc2023
https://github.com/RKBethke/aoc23-bqn
https://github.com/azenna/advent-of-code-2023
https://github.com/icendoan/aoc
https://github.com/qqii/advent-of-code-2023
https://github.com/saltysylvi/bqn-aoc
https://github.com/timmarinin/aoc2023

So I'm fairly certain we could go past the 2k requirement by searching in some repositories. I'm also sure there are over 200 repositories containing BQN code and could probably come up with a list if that's acceptable. Thoughts?

@mlochbaum
Copy link

mlochbaum commented Jan 8, 2024

I've indexed the following 28 Advent of Code repositories, which brings this search up to 2k. I did find that some repositories I listed earlier were actually deleted or renamed, which I hadn't thought to check, and have updated that list to indicate them. Three of the 2023 repositories had also been indexed since I made that list.

repo:AlexDikelsky/puzzles OR repo:alephno/aoc2021 OR repo:alvinvoo/aoc2021 OR repo:arwn/aoc2021 OR repo:dancek/bqn-advent2021 OR repo:frasiyav/AoC2021 OR repo:m-lima/advent-of-code-2021 OR repo:AugustUnderground/AoC2022 OR repo:Choram/AoC2022BQN OR repo:Nhlest/AoC2022 OR repo:SamuelSarle/advent OR repo:akamayu-ouo/AoC OR repo:bddean/aoc OR repo:dancek/bqn-advent2022 OR repo:dankeyy/aoc22 OR repo:dgkf/advent-of-code OR repo:eissplitter/aoc-2022 OR repo:extorious/aoc2022 OR repo:felixr/advent-of-code OR repo:juriad/advent2022 OR repo:mpizzzle/AdventOfCode OR repo:saltysylvi/bqn-aoc2022 OR repo:RKBethke/aoc23-bqn OR repo:azenna/advent-of-code-2023 OR repo:icendoan/aoc OR repo:qqii/advent-of-code-2023 OR repo:timmarinin/aoc2023 OR repo:dlozeve/aoc2023

I note that file totals frequently don't add up right: the full search of added files gives 286, while this half returns 150 and this half returns 157, totalling 307 (after updating local clones I see 308). And these "286" files were needed to increase BQN's total from 1.8k to 2k, as earlier 255 wasn't enough.

@lildude
Copy link
Member

lildude commented Jan 8, 2024

Popularity really isn't the priority right now... passing tests is 😉

@mlochbaum
Copy link

Apologies, I'd just talked to skykanin who believed popularity was the only remaining issue. I'm asking around to see if I can find someone to help.

@skykanin
Copy link
Contributor Author

@lildude could you approve the workflow? I was able to get rid of all the test failures locally 🙂

@skykanin
Copy link
Contributor Author

@lildude Github's search indexing now shows that BQN has 3.4k unique files so I think this PR should be good to merge after the tests are rerun.

@lildude lildude added this pull request to the merge queue Jun 7, 2024
Merged via the queue into github-linguist:master with commit c808119 Jun 7, 2024
5 checks passed
@skykanin skykanin deleted the add-bqn branch June 7, 2024 12:10
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