Changes between Version 2 and Version 3 of RFC/7_LanguageStandardsSupport


Ignore:
Timestamp:
Mar 22, 2021, 1:59:03 AM (3 years ago)
Author:
nila
Comment:

Lift out Python from this RFC

Legend:

Unmodified
Added
Removed
Modified
  • RFC/7_LanguageStandardsSupport

    v2 v3  
    99The code base of GRASS GIS consists today (Feb. 2021) of predominantly C code (ca 50 %), Python (ca 30 %) and a smaller amount of C++ (ca 5 %). Each of these languages have evolved significantly in the last 10–20 years. There is, however, no clearly stated policy of supported language standard(s), nor mechanism to update this policy when needed or wanted. This result in uncertainty for contributors for what may be allowed and solutions that may not be optimal.
    1010
    11 This RFC aims at setting a policy for GRASS GIS project regarding language standard support for C and C++, as well as setting the minimum version support for Python.
     11This RFC aims at setting a policy for GRASS GIS project regarding language standard support for C and C++.
    1212
    1313In addition, this is also intended to set a precedent for future updates on this subject.
     
    1515== Background ==
    1616Throughout its long history, soon 40 years, GRASS GIS has evolved and steps have been taken to adapt and modernize. The latest big modernization of the C code was done in 2002–2006 ([https://lists.osgeo.org/pipermail/grass-dev/2021-February/094955.html summary]), when it was updated to conform to C89 (ANSI C) standard. A major job, which has payed-off well. However, during the years, language features of successive standards have slipped into the code base, which is no longer strictly C89 (nor C90) conformant. There are no compelling reasons to revert the existing code to strict C89, therefore the community has to decide which standard to adhere to.
    17 
    18 Similarly, the integration of Python within GRASS GIS – driving the GUI and to a large extent replacing shell scripts (bash/sh) for scripting – has gone through a challenging period with the transition from Python 2 to 3. This transition can now be considered completed, but this fact need to be formalised and the minimum version of Python 3 support must be stated.
    1917
    2018The small amount of C++ code in GRASS GIS has never been formalised and officially made to conform to any specific standard.
     
    3129Regarding C++, there are the C++98, C++03, C++11, C++14 and C++17 standards to consider. The platform and compiler support for all of these are significantly better. However, C++11 is at this date in general considered the standard and until compelling reasons argue otherwise, the C++11 standard should be policy of the GRASS GIS project.
    3230
    33 The GRASS GIS support for C and C++ standards will most likely not be a subject to change too frequently. The minimum support for Python will, in contrast, likely change more often, due to each (minor) version’s 5-years life-time. At this date, the oldest still-alive Python version is 3.6, to be retired in December 2021.
    34 
    3531== Proposed Language Standards Support ==
    3632
    37 === C ===
     33=== C Language ===
    3834C11 with core (mandatory) features [https://en.wikipedia.org/wiki/C11_(C_standard_revision) brief summary]
    3935
    4036Optional features may be used if availability is tested with macro, and if not supported, alternative fallback code must be provided.
    4137
    42 === C++ ===
     38=== C++ Language===
    4339C++11 [https://en.wikipedia.org/wiki/C%2B%2B11 summary]
    4440
    45 === Python ===
    46 Python 3.6 [https://docs.python.org/3.6/whatsnew/3.6.html features]
    47