Add KoLMafia ASH language by midgleyc · Pull Request #5401 · github-linguist/linguist · GitHub
Skip to content

Add KoLMafia ASH language - #5401

Merged
lildude merged 10 commits into
github-linguist:mainfrom
midgleyc:kolmafia-ash
Sep 15, 2025
Merged

lildude merged 10 commits into
github-linguist:mainfrom
midgleyc:kolmafia-ash

Conversation

@midgleyc

Copy link
Copy Markdown
Contributor

Adds the new language "KoLMafia ASH".

Closes #5022.

Description

ASH is a currently unrecognised language used for scripting KoLMafia, a program for playing the online game "Kingdom of Loathing". There is documentation available at the KoLMafia wiki.

All ASH scripts have the ".ash" extension, currently owned by AGS Scripts.

As this is a conflicting extension, I should run the "Bayesian classifier" and add a heuristic if it doesn't classify well enough. How do I do this? Compiling into docker and running that against the files in the samples directory found them as "AGS Script", which makes me think that's not the right thing to do.

Checklist:

@midgleyc
midgleyc requested a review from a team as a code owner May 31, 2021 10:18
@lildude

lildude commented Jul 12, 2021

Copy link
Copy Markdown
Member

@midgleyc

Copy link
Copy Markdown
Contributor Author

That said, if get_property is expected to appear in every file as per your search query

It's not, but I was hoping that would be enough alone. How do I check the unique public user / repos given a search term?

This one is problematic because the extension is shared with "AGS script" (and some other, less used languages, like Acorn script). get_property was chosen because it is almost certain to not appear in another language's file. If I search for something generic like "string":
https://github.com/search?p=1&q=extension%3A.ash+string&type=Code

then on the first two pages, 16 are KoLMafia ASH and 4 are AGS script.

For something more specific like "item":
https://github.com/search?p=1&q=extension%3A.ash+item&type=Code

I have to go further before I get to an AGS script, but I can see some matches on the final page.

As an aside, two of the samples in this PR was waaaay too big for inclusion

Sorry, I had assumed that larger was better. What size should I aim for?

@lildude

lildude commented Jul 12, 2021

Copy link
Copy Markdown
Member

How do I check the unique public user / repos given a search term?

You can use Harvester or the script I've been testing with for a while at https://github.com/lildude/linguist/blob/lildude/download-corpus/script/github-ext-pop - warning: this last one will poke GitHub's API abuse limits.

Regarding the search: you can add multiple qualifiers and keywords which might help get a better result. I don't know if void is valid in "AGS Script", but it appears to occur in all this language's file from what I can see. A quick search for this returns only 1092 files which I suspect may still be too low for inclusion.

Sorry, I had assumed that larger was better. What size should I aim for?

We don't have a specific size limit (though 2.48MB is massive!!) rather we aim for overall general representation of the language as it is used. Repeated syntax only bloats the file and doesn't add much value to training the classifier.

@midgleyc

midgleyc commented Jul 12, 2021 •

Copy link
Copy Markdown
Contributor Author

void is valid in AGS script. All runnable ASH files should have a void main function (except those that just run everything at base level), but that's also valid in AGS.

There are non-runnable ASH files (libraries), but I'd expect every repo to have at least one runnable file.

@midgleyc

Copy link
Copy Markdown
Contributor Author

Yeah, "void main item" gives 64 uniques (including some that only show up in smola's language-dataset), so nowhere near enough.

@lildude lildude added the Pending Popularity Language doesn't need minimum usage requirements. Reassessed when new releases are made. label Nov 29, 2021
@lildude lildude changed the title Add KoLMafia ASH language (fixes #5022) Add KoLMafia ASH language Jul 1, 2022
@lildude lildude mentioned this pull request Apr 4, 2024
6 tasks done
@lildude

lildude commented Jun 2, 2025 •

Copy link
Copy Markdown
Member

@lildude lildude removed the Pending Popularity Language doesn't need minimum usage requirements. Reassessed when new releases are made. label Jun 2, 2025
hashimihamid020-sys786

This comment was marked as spam.

@midgleyc
midgleyc requested a review from a team as a code owner September 15, 2025 13:18
Comment thread vendor/README.md

@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.

LGTM. Thanks.

Important

The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.

@lildude
lildude added this pull request to the merge queue Sep 15, 2025
Merged via the queue into github-linguist:main with commit 83805ad Sep 15, 2025
5 checks passed
@midgleyc
midgleyc deleted the kolmafia-ash branch September 15, 2025 21:02
JesusValeraDev pushed a commit to phel-lang/linguist that referenced this pull request Apr 18, 2026
* feat: add kolmafia-ash grammar

* ash: add samples

* ash: add ID

* fix(ash): list-grammars

* ash: add another sample

* fix(ash): remove codemirror from language file

* fix: remove too-large samples

* Update vendor/README.md

* Sort language entries

---------

Co-authored-by: Colin Seymour <colin@github.com>
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.

ASH scripts misidentified as AGS

3 participants