linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add Octave language with its own language distinct from MATLAB

Open pr0m1th3as opened this issue 1 year ago • 4 comments

Description

This PR is adding a distinction between MATLAB and GNU Octave languages, which both use .m files for their code files. Although GNU Octave is often described as the open source MATLAB alternative due to their similarities, the reality is that it is a separate programming language. Most importantly, although MATLAB syntax can be interpreted by GNU Octave, the opposite is not true. Octave syntax includes # for comment lines, and endif, endfor, endfunction, endclassdef etc as block's closing statements, which are explicitly recognized by the Octave interpreter, but cannot be parsed/run in MATLAB. As a result of these differences, GitHub falsely recognizes Octave code as MATLAB and by using MATLAB's syntax highlighting grammar results into mis-displaying code, which is written explicitly for the Octave language.

Besides the mis-highlighted code syntax of files containing Octave code, this is also confusing for users who might consider that code written for Octave may work in MATLAB, since GitHub reports all Octave code as MATLAB. GNU Octave is a community driven open source project, which has been in constant development for more than 30 years now, and with a reasonably large user base across academic and industrial sectors, especially in engineering fields. Thus, there is also an ethical aspect towards our community of developers and users that the Octave language should not be misclassified as another proprietary language by the worlds largest developer platform, GitHub, which gratefully provides free hosting for a myriad of open source projects.

Checklist:

pr0m1th3as avatar Jul 11 '24 17:07 pr0m1th3as

Spotted this PR and just wanted to add that, while octave and matlab do indeed share an odd relationship, matlab is not the only language with which github language detection clashes with, particularly when ".m" files are involved, which are also used by objective-c, wolfram mathematica, and mercury-lang as well.

So I would say this is less a case of "making octave distinct from matlab" specifically per se, but more about adding octave as a proper language, and disambiguating octave files among all the above languages that also use the ".m" extension, including matlab (whose syntax is indeed different, despite the many similarities).

E.g. if one searches github for "language:Objective-C octave" (or indeed "language:Objective-C matlab") one will witness this confusion, and that it's not necessarily octave/matlab-exclusive.

tpapastylianou avatar Jul 12 '24 11:07 tpapastylianou

@lildude I have made all necessary changes to the best of my understanding of the errors produced from the automated tests. Please, run once again the testing worklfow and give me some guidance about the necessary changes that might still be required. Thank you very much for your help.

pr0m1th3as avatar Jul 12 '24 16:07 pr0m1th3as

@lildude Are there any other changes required before this PR can be merged?

pr0m1th3as avatar Aug 18 '24 04:08 pr0m1th3as

@lildude Are there any other changes required before this PR can be merged?

Yup. See the test failure.

lildude avatar Aug 18 '24 08:08 lildude