-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revisiting language groups #4291
Comments
Analogous to the SCSS-CSS argument, Pug (Jade) and other templating languages that are radically different from HTML should also be considered, as they currently fall in the HTML group. |
Agreed. Personally, I think most (if not all) templating languages should be decoupled from their target output. There's a reason they're templating languages, after all... and it isn't "just HTML" if I open a Pug template in a browser and see a weird mix of half-empty tags and loops. 😉 I think if a parent language is unambiguous and well-specified (as HTML and CSS are), a child language should be either a subset or a hybrid of different languages. Conversely, Assembly and Shell are umbrella terms of sorts which cover numerous dialects and implementations, so having them as parent languages makes more sense, IMHO. |
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions. |
I think this is a pretty good list to start with and I doubt we'll be able to have a comprehensive list (we don't know and use all languages Linguist supports ourselves). To move forward, should we agree on a short guideline to decide if languages should be grouped in the future (so that we can better handle future cases we missed here)? I think that comment by @Alhadis is a pretty good starting point:
@lildude What's your opinion on this? |
I've pulled JSX from the list. For a start, it's not as clear-cut as TypeScript is (Flow typing and JSX tags both fall under the umbrella of "JSX", more or less). Plus the distinction itself is problematic for reasons I've explained here. |
Whoops, lost this in my inbox at some point and was just reminded by @Alhadis in #4353.
Seems reasonable to me.
... as does this. Do it. |
I'm gonna enjoy this... |
Just an FYI: this might take a while because of conflicting colour proximities. 😅 |
We might be able to get rid of that soon 🤞 I had a chat with a colleague and your suggestion at #4331 (comment) may become a thing 🔜. |
Guys, I've pushed a WIP branch for the degrouped languages I'm familiar with, but I'll hold off from submitting a PR until some time has elapsed (or until the potential changes have been reified). In the meantime, feel free to push any changes you think are missing or necessary. 👍 |
... of course, when pushing topic branches, it'd help if I actually had commits to go with them. Remind me not to leave changes staged for several hours, because my crap memory will have me believing they've already been committed. 😁 |
@lildude I realised another reason why the colour-proximity thing is strangling us — Language authors gravitate toward vibrant colours when deciding their project's logo/branding/colour-scheme. So over time, more and more languages will be added to Linguist with clashing colours: bright red, dark blue, bright blue, purple, warm yellow, etc. So the remaining "available colours" we can assign them will inevitably be sickly shades of pale green, washed out red, white-ish pink, etc. The current constellation of colour choices is already proving this: when adding Asymptote, I noticed its official colour was Having said that, there's no way I'm gonna add 12 uncoloured/grey languages that were degrouped from their parent languages, most of which have branding with vibrant, distinctive colour choices. Nor do I want to drop 12 grossly inaccurate colour-choices into the language bar to represent Less, SASS, etc. |
@Alhadis I hear you, and hopefully we can remove this once #4291 (comment) happens. It's on a team's radar, just need to see it come to fruition. |
Especially for you @Alhadis 😘 |
This is the happiest day of my life, holy shit. 😀 What should we do about the colour-proximity check? |
Would this mean existing languages will be able to get their official colour after the proximity changes now that there's a separator? |
Yes! |
Should we keep some semblance of color proximity detection though? If only to prevent all colors from becoming blue... I was thinking we could simply relax our proximity constraint? |
That's a non-issue, and only likely to be noticed in repositories which contain multiple languages that incidentally use almost identical colours. |
Isn't this a kind of birthday paradox and therefore the probability of that happening is actually higher than one might expect? :p @Alhadis Do you think we should remove the constraint on colors entirely? |
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions. |
Could you post a code sample of what you mean? I can't fathom how HTML markup could be making code generation easier... In any case, unusual use-cases of a language benefit from a |
ERB filenames have a preceding filetype in their name. A HTML ERB would have the filename It seems like we could infer the language type of an ERB file from it's preceding filename. How do you feel about this? 👍 👎 Examples of ERBs being used for code generation
|
Ah, I see. So it's really more of a generic templating system that (naturally) lends itself well to server-side HTML rendering? If it isn't HTML-centric, it might make sense to rename it to However, that'd still be of minimal benefit to syntax highlighting and language classification. Because Linguist is limited to classifying languages that've been registered ahead of time, it'd be impossible to classify files as, say, I'm really not the right person to be discussing anything Ruby-related, though. Since I've no knowledge of what ERB files are really used for, I can't confidently assert my suggestions are suitable (are these code-generation cases only 10% of ERB-using repositories? A third? ~50%?). @lildude would be right person to ask about this, but since he's currently @busydude, it's probably safer to leave this matter be for now. =) |
The idea of renaming it to embedded ruby –a child language of ruby seem acceptable to me. I would speculate that |
Yes, I think so. Exceptions can always use a |
I don’t mind proposing the change in a PR 😄 |
Renaming a language is a simple procedure (though that wasn't always the case…). You can use #4171 as an example. Basically, it's just:
SidenoteI just realised we could always keep Again, I'd wait for @lildude's input before rushing off to submit a PR. Should my solution be found preferable, well, your PR will have been in vain. 😉 |
I agree with this 👍 I'll wait on @lildude input before tackling this. |
Svelte should be removed from the HTML group. It's similar to Vue which is already on its own. |
The language Sage is really built on top of Python and their syntaxes are almost the same, but they are not 100% equal. For example, Besides the syntax, the other features are very different. For instance, Python treats mathematical expressions numerically, while Sage treats them symbolically, thus, 1/3 is 0.3333 in Python, but it is a fraction in Sage, and sqrt(2) is 1.4142 in Python, but it is, well, sqrt(2) in Sage. Even if one has never declared x anywhere, the following is a valid Sage script which prints -1:
All that said, I would like to invite you to consider degrouping Python and Sage. |
@hilder-vitor You should submit a pull-request to degroup them; this thread is chiefly for discussing languages whose "independence" is ambiguous and open to debate. There's clearly no ambiguity or room for subjectivity in what you've described. |
@ObserverOfTime I missed your comment when you posted it. I've added Svelte to the list. |
This issue is a continuation of what @pchaigno started with #3093:
There are several languages on GitHub which presently fall under the usage statistics of another, "parent" language, which certainly deserve reconsideration — or at the very least, some public discussion for highlighting the reasons why they fall under another language's umbrella.
To start, here are the languages which I believe are valid candidates for degrouping. I'll extend this list over time as discussion from other users confirms other candidates:
Languages which should be degrouped
JSONFixed in #4345Moreover, there's little point in retaining a connection with JavaScript. JSON is classed as a data language, so it won't appear in usage statistics anyway.
I've refrained from bringing up any languages I've never worked with or lack familiarity with (such as PostCSS and Stylus), each of which might be candidates as well. Comments are welcome.
Good examples of language groups
Here are some languages which are justifiable in having a parent language:
HTML+…
languages (HTML+Django, HTML+ECR, HTML+ERB, etc)/cc @pchaigno, @lildude, @controversial, @nazar-pc, @EmmaRamirez, @plibither8
Footnotes
Pic is interesting because it can be compiled to other languages that aren't Roff (like SVG or TeX),
but the language itself is based upon Roff syntax and even permits low-level Roff constructs to be used inline. In other words, it's not so cleanly separated, and demonstrates why transpilation targets are fallacious reasoning w.r.t. whether Sass should be distinguished from CSS or not.
The text was updated successfully, but these errors were encountered: