linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add `.wx` extension to Monkey language

Open seyhajin opened this issue 2 years ago • 20 comments

Added Wonkey extension to Monkey language.

Description

Wonkey is a up to date fork of Monkey2 programming language for the creation of cross-platform video games (very similar to BlitzBasic/BlitzMax but with oriented object programming).

preview:

struct Vec2<T>
    field x:T
    field y:T

    method new( x:T, y:T )
	self.x = x
	self.y = y
    end

    operator+:Vec2( v:Vec2 )
        return new Vec2( x + v.x, y + v.y )
    end

    operator to:string()
        return "Vec2(" + x + ", " + y + ")"
    end
end

alias Vec2<float> Vec2f

'main entry
function main()
   local v0:= new Vec2f( 10,20 )
   local v1:= new Vec2f( 30,40 )
   print v0 + v1
end

Wonkey : https://github.com/wonkey-coders/wonkey Monkey2 : https://github.com/blitz-research/monkey2

Checklist:

  • [x] I am associating a language with a new file extension.
    • [x] The new extension is used in hundreds of repositories on GitHub.com
      • Search results for each extension:
        • https://github.com/search?q=extension%3Awx&type=Code
        • Another users/repos : https://github.com/search?l=&p=2&q=extension%3Awx+-user%3A%22Wonkey-Coders%22&ref=advsearch&type=Code
          • User: https://github.com/abakobo
          • Repo: https://github.com/DoctorWhoof/Wonkey-FPS-Test
    • [x] I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s): explicitly added in this PR (commit 41e1e812f2dee9d9278af05d61c24cd132299d79) => samples/Monkey/vec2.wx
      • Sample license(s): Wonkey license
    • [x] I have included a change to the heuristics to distinguish my language from others using the same extension.

seyhajin avatar Jul 05 '22 20:07 seyhajin

First, please fill out the pull-request template. It's there for a reason.

Second, a little background on what "Wonkey" is would be nice. I notice that you're adding .wx as an extension, not .wonkey, so adding a link or a short explanation explaining what "Wonkey" is would help to clear up any confusion.

Alhadis avatar Jul 06 '22 01:07 Alhadis

OK, i have updated my pull request description with more informations.

seyhajin avatar Jul 06 '22 13:07 seyhajin

I'd add the sample myself, however you've not granted maintainers write access to your branch so I can't. Accordingly, this PR will miss the release I'm making today.

lildude avatar Jul 13 '22 08:07 lildude

No you haven't 😉 Please add the sample to the PR.

@lildude , Ok i added a Vec2 sample

I'd add the sample myself, however you've not granted maintainers write access to your branch so I can't. Accordingly, this PR will miss the release I'm making today.

It seems not possible to "Allow edits from maintainers" from organization account pull request, see https://github.com/orgs/community/discussions/5634.

seyhajin avatar Jul 26 '22 09:07 seyhajin

@lildude , Ok i added a Vec2 sample

Where did you get this from? Please update the OP to link directly to the file.

lildude avatar Aug 10 '22 08:08 lildude

@lildude , Ok i added a Vec2 sample

Where did you get this from? Please update the OP to link directly to the file.

Link updated and i added this file in PR.

seyhajin avatar Aug 10 '22 08:08 seyhajin

Errm, we need a link to the original source, not your fork of Linguist 😉

lildude avatar Aug 10 '22 09:08 lildude

Errm, we need a link to the original source, not your fork of Linguist 😉

Cause i have added this file in this pull request but ok i have changed link from original vec2 source now. :)

seyhajin avatar Aug 10 '22 10:08 seyhajin

Cause i have added this file in this pull request but ok i have changed link from original vec2 source now. :)

🤔 those two files don't match. If you've written the sample explicitly for this PR, then that's fine. You can state that instead of linking to a source.

lildude avatar Aug 10 '22 11:08 lildude

🤔 those two files don't match. If you've written the sample explicitly for this PR, then that's fine. You can state that instead of linking to a source.

I explicitly added a sample file in my linguist fork in the "samples/Monkey/vec2.wx" folder and integrated it into this PR. What link do you want me to put in this PR? I updated the link, tell me if it's good

seyhajin avatar Aug 10 '22 11:08 seyhajin

@lildude Do you expect other actions from me before to merge this PR?

seyhajin avatar Aug 25 '22 08:08 seyhajin

I've finally looked into the usage and there are a couple of issues:

Your search string suggests usage is nowhere near popular enough with only 904 file, most of which are owned by one user. Removing that user gives only 162 files indexed which is a long way from the documented and even temporarily relaxed requirements. I've tried several other combinations of the search for Wonkey specific keywords and I can't find a result that satisfies the requirements. If you can generate a representative search, please do so.

More importantly... inverting your search to exclude the word "import" (and exclude the wonkey-coders user) reveals this is going to misclassify a lot of other users of the .wx extension that are definitely not Wonkey.

In order to prevent this, you're going to need to identify at least one of those languages and add support to this PR along with two representative samples of both languages to ensure the classifier has a chance of getting things right. If the two languages are similar, you will need to implement a heuristic too.

lildude avatar Sep 02 '22 09:09 lildude

I've finally looked into the usage and there are a couple of issues:

Your search string suggests usage is nowhere near popular enough with only 904 file, most of which are owned by one user. Removing that user gives only 162 files indexed which is a long way from the documented and even temporarily relaxed requirements. I've tried several other combinations of the search for Wonkey specific keywords and I can't find a result that satisfies the requirements. If you can generate a representative search, please do so.

More importantly... inverting your search to exclude the word "import" (and exclude the wonkey-coders user) reveals this is going to misclassify a lot of other users of the .wx extension that are definitely not Wonkey.

In order to prevent this, you're going to need to identify at least one of those languages and add support to this PR along with two representative samples of both languages to ensure the classifier has a chance of getting things right. If the two languages are similar, you will need to implement a heuristic too.

Ok i've changed search filters by adding original "Monkey, Monkey2" extensions and removing 'import' keyword because is a same language, only extension name has been simplified for Wonkey. I find it very complicated just for adding an extension at existing language :-/

seyhajin avatar Sep 03 '22 10:09 seyhajin

Ok i've changed search filters by adding original "Monkey, Monkey2" extensions and removing 'import' keyword because is a same language, only extension name has been simplified for Wonkey. I find it very complicated just for adding an extension at existing language :-/

It's not that complicated... it's just that we need to ensure each extension meets the popularity requirements before inclusion so adding the Monkey extensions to your query doesn't help illustrate the popularity of the .wx extension 😁. We also need to ensure that other languages that share the extension are not incorrectly classified.

lildude avatar Sep 05 '22 08:09 lildude

It's not that complicated... it's just that we need to ensure each extension meets the popularity requirements before inclusion so adding the Monkey extensions to your query doesn't help illustrate the popularity of the .wx extension 😁. We also need to ensure that other languages that share the extension are not incorrectly classified.

@lildude I've reduced extension filter to only '.wx' and of course, Wonkey is not the only one to use this extension, should we add more code examples to facilitate the classification or it would not be useful?

seyhajin avatar Sep 06 '22 09:09 seyhajin

@lildude I've reduced extension filter to only '.wx' and of course, Wonkey is not the only one to use this extension, should we add more code examples to facilitate the classification or it would not be useful?

Yes. I think we're also going to need to identify the other predominant user of this extension and add support for it with at least two samples to this PR too.

lildude avatar Oct 20 '22 11:10 lildude

@lildude I've reduced extension filter to only '.wx' and of course, Wonkey is not the only one to use this extension, should we add more code examples to facilitate the classification or it would not be useful?

Yes. I think we're also going to need to identify the other predominant user of this extension and add support for it with at least two samples to this PR too.

I added more Wonkey samples

seyhajin avatar Oct 28 '22 11:10 seyhajin

I added more Wonkey samples

Woah! Some of those are bigger than we need. If the diff view collapses the file, it's too big. Please remove these large samples.

You're still going to need to identify the language of at least one other user of the .wx extension and add it as part of this PR.

lildude avatar Nov 14 '22 10:11 lildude

Woah! Some of those are bigger than we need. If the diff view collapses the file, it's too big. Please remove these large samples.

OK i've removed large sample files.

You're still going to need to identify the language of at least one other user of the .wx extension and add it as part of this PR.

I've updated the PR.

seyhajin avatar Nov 18 '22 18:11 seyhajin

You're still going to need to identify the language of at least one other user of the .wx extension and add it as part of this PR.

👆

lildude avatar Jan 21 '24 10:01 lildude