Add BQN language by skykanin · Pull Request #6623 · github-linguist/linguist · GitHub
Skip to content

Add BQN language#6623

Merged
lildude merged 11 commits into
github-linguist:masterfrom
skykanin:add-bqn
Jun 7, 2024
Merged

Add BQN language#6623
lildude merged 11 commits into
github-linguist:masterfrom
skykanin:add-bqn

Conversation

@skykanin

@skykanin skykanin commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

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

Checklist:

  • I am adding a new language.

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

lildude commented Dec 4, 2023

Copy link
Copy Markdown
Member

@skykanin

skykanin commented Dec 4, 2023

Copy link
Copy Markdown
Contributor Author

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

lildude commented Dec 4, 2023

Copy link
Copy Markdown
Member

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.

@lildude lildude left a comment

Copy link
Copy Markdown
Member

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

skykanin commented Dec 5, 2023

Copy link
Copy Markdown
Contributor Author

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

lildude commented Dec 5, 2023

Copy link
Copy Markdown
Member

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

skykanin commented Dec 5, 2023

Copy link
Copy Markdown
Contributor Author

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

lildude commented Dec 5, 2023

Copy link
Copy Markdown
Member

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

lildude commented Dec 5, 2023

Copy link
Copy Markdown
Member

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.

@pulustelu

pulustelu commented Dec 7, 2023

Copy link
Copy Markdown

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

mlochbaum commented Dec 8, 2023

Copy link
Copy Markdown

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

mlochbaum commented Jan 8, 2024

Copy link
Copy Markdown

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

lildude commented Jan 8, 2024

Copy link
Copy Markdown
Member

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

@mlochbaum

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

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

@skykanin

Copy link
Copy Markdown
Contributor Author

@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
@skykanin skykanin deleted the add-bqn branch June 7, 2024 12:10
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants