linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add support for MiniScript

Open ayecue opened this issue 7 months ago • 7 comments

From the MiniScript manual:

MiniScript is a modern scripting language designed to be clean, simple, and easy to learn. It was designed from the ground up by borrowing only the best ideas from other languages such as Python, Lua, Basic, and C#. If you know pretty much any other programming language, you’ll pick up MiniScript almost immediately.

And if you’ve never written a line of code in your life, don’t panic! MiniScript is the friendliest and most fun way to get started. It’s much easier than you probably expect.

Important: MiniScript is designed as an embedded programming language. That means you will usually use it inside some other program, such as a video game. You should find another document that describes how to access and use MiniScript within that other program. This document only describes the MiniScript language itself, and the intrinsic functions that are common to most MiniScript applications.

More informations about MiniScript can be found here:

  • https://miniscript.org/
  • https://github.com/JoeStrout/miniscript
  • https://miniscript.org/wiki/Main_Page

Following changes are performed in this PR:

  • add MiniScript entry to languages.yml
  • add MiniScript samples from https://github.com/JoeStrout/miniscript repo
  • add MiniScript grammar from https://github.com/ayecue/miniscript-textmate-linguist
  • add heuristics related to the file extension .ms

Checklist:

  • [x] I am adding a new language.
    • [x] The extension of the new language is used in hundreds of repositories on GitHub.com.
      • Search results for each extension:
        • https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.ms+%2F%5E%5Cs*%5Cbend+%28%3F%3Afunction%7Cwhile%7Cif%7Cfor%29%5Cb%7C%5Cs%5Cb%28%3F%3Aisa%29%5Cb%5Cs%2F
    • [x] I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s):
        • https://github.com/JoeStrout/miniscript/tree/master/MiniScript-cpp/demo
      • Sample license(s):
        • https://github.com/JoeStrout/miniscript/blob/master/LICENSE
    • [x] I have included a syntax highlighting grammar: https://github.com/ayecue/miniscript-textmate-linguist
    • [x] I have added a color
      • Hex value: #494247
      • Rationale: Color of the fur of the MiniScript mascot.
    • [x] I have updated the heuristics to distinguish my language from others using the same extension.

ayecue avatar May 17 '25 14:05 ayecue

samples/MiniScript/superstartrek.ms and samples/MiniScript/textAdventure.ms are way too big for our needs - if the diff suppresses the content, it's too big. Please remove them.

Done. Both large MiniScript samples have been removed.

Please also update the search query in the PR template to use your heuristics so we can assess popularity and your heuristics.

I've updated the query to include some of the keywords and special variables. While it might not catch every single MiniScript related file, it should cover the majority.

ayecue avatar May 19 '25 09:05 ayecue

I've updated the query to include some of the keywords and special variables. While it might not catch every single MiniScript related file, it should cover the majority.

You can use regex in GitHub's search too.

lildude avatar May 19 '25 09:05 lildude

I've reduced the complexity of the heuristics pattern significantly now. Mainly relying on the end block keyword. Additionally I added two more extensions since those should also be relevant to MiniScript.

ayecue avatar May 21 '25 12:05 ayecue

Commenting mainly to get notifications on this issue (I can't find a Subscribe or Watch button). But just to be sure I understand:

With the Pending Popularity tag, this issue is on hold until we cross some threshold? Is it for this search to return 2000 files, or something else?

JoeStrout avatar May 27 '25 16:05 JoeStrout

With the Pending Popularity tag, this issue is on hold until we cross some threshold? Is it for this search to return 2000 files, or something else?

Essentially, yes. More deets in https://github.com/github-linguist/linguist/issues/5756

lildude avatar Jun 02 '25 09:06 lildude

Is it possible for this pr to get accepted before the 2000 files mark, or is that a hard requirement?

EntitySeaker avatar Jun 04 '25 21:06 EntitySeaker

Hard requirement. If we make an exception for one there's no point having the restriction and we'd have no choice but to accept every submission, even for hobby languages that no one uses.

lildude avatar Jun 05 '25 07:06 lildude