github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.22k stars 4.22k forks source link

Add language: ISPC #5042

Open cwfitzgerald opened 3 years ago

cwfitzgerald commented 3 years ago

Preliminary Steps

Please confirm you have...

Problem Description

ISPC (Intel SPMD Program Compiler) is a language designed for writing SIMD optimized programs. It is seeing more and more adoption in the game industry and I'm kind of surprised it isn't already detected.

Ispc uses two file extensions: .ispc for source files and .isph for headers.

URL of the affected repository:

https://github.com/BinomialLLC/bc7e
https://github.com/GameTechDev/ISPCTextureCompressor

There are many others: https://github.com/search?q=.ispc&type=code

Last modified on:

2020-10-11

Expected language:

ISPC

Detected language:

None

lildude commented 3 years ago

I'm kind of surprised it isn't already detected.

That'll be because no one has submitted a PR to add support 😉 . If the usage of either or both extensions meets our inclusion requirements detailed in the CONTRIBUTING.md file, please feel free to submit a PR to add support.

cwfitzgerald commented 3 years ago

Sounds good :). My main question would be what to do about the grammar. I don't know of a easy to set up grammar for the language (nor really have the energy to make one), but at the same time it's a C derivative, so C grammars work okay for highlighting it.

lildude commented 3 years ago

Peeps normally use the same grammar they use in Textmate, Atom or VSCode. They're all compatible with Linguist, so if you use any of those editors, you could use the same grammar in Linguist. You could also use the C grammar if you think it'll suffice.

cwfitzgerald commented 3 years ago

Aha, thank you! It appears it does have a VSCode plugin, which is compatibly licensed, just need to find its source and use that grammar.

Nixinova commented 3 years ago

Pending popularity: https://github.com/github/linguist/pull/5191#issuecomment-775813662

pbrubaker commented 6 months ago

https://github.com/github-linguist/linguist/pull/5191#issuecomment-2017684553

Asking for reconsideration now that DreamWorks Moonray is now open source, and there are many files in Unreal Engine 5.

pbrubaker commented 6 months ago

Hey @lildude. I am not able to get all the stats you posted in the closed issue. so I would appreciate your help checking the current stats.

Are you able to include private repos like Unreal? As the evangelist for this at Intel, I know there's way more usage out there than is represented in the stats for public repos.

We have TreeSitter and TextMate grammars we can share that we use in the vscode extension.

lildude commented 6 months ago

I am not able to get all the stats you posted in the closed issue. so I would appreciate your help checking the current stats.

I can't get them anymore because of the changes to the Search API which in turn has resulted in https://github.com/github-linguist/linguist/issues/5756 which details how I assess popularity.

Are you able to include private repos like Unreal?

No. Everything about private repos is, erm, private, including the language stats.

We have TreeSitter and TextMate grammars we can share that we use in the vscode extension.

Linguist only accepts TextMate-compatible grammars for feeding into the highlighting engine with is slowly moving to tree-sitter grammars, but there's currently no way of submitting these. The maintainers of the engine are switching grammars as they assess them, and based on the fact linguist knows about the language.

Feel free to submit a new PR and I'll take a quick Look at popularity then. I aim to make a new release approximately quarterly to ensure the next Enterprise Server release goes out with the latest languages etc. This has just happened to the next release won't be for a few months.

samayala22 commented 2 months ago

@pbrubaker I know this is low priority but any updates on this ? I would create the PR but the TextMate grammar has not been submitted to a textmate repo yet.

pbrubaker commented 2 months ago

@pbrubaker I know this is low priority but any updates on this ? I would create the PR but the TextMate grammar has not been submitted to a textmate repo yet.

It will be part of a larger release. We are releasing the vscode extension (that contains the grammar file) as open source and all of that is going through legal and open source scanning at the moment. I'm hoping that it's soon. @ethandav would be able to provide a more up to date status as I'm no longer at the company.