Board index Other Hangar talk

FlightGear top programming languages

Talk about (almost) anything, as long as it is no serious FlightGear talk and does not fit in the other subforums.
Forum rules
Please refrain from discussing politics.

FlightGear top programming languages

Postby Zequinha » Wed Jun 28, 2017 2:26 pm

Stats on black duck: https://www.openhub.net/p/flightgear/an ... es_summary

I wonder... what is C++ (49.2%) used for? And C (40.8%)?

Why are C and C++ mixed in the FlightGear project?
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: FlightGear top programming languages

Postby sanhozay » Wed Jun 28, 2017 3:01 pm

There are some C source files, but I think those statistics are over-stating the proportion. The project is predominantly C++.

The Nasal language is implemented in C, as is LaRCSim. There are also some third party libraries included as C source files, e.g. Flite+HTS for voice synthesis, and iaxclient, which I think is used by FGCom. These files make up the bulk of the C source files in Flightgear and are not really project files as such.

As a rough count of files, rather than lines:

Code: Select all
Flightgear: 283 (244 library) C files, 514 CXX files
Simgear: 62 C files, 334 CXX files

So if you exclude those libraries, you are looking at a ratio of about 8:1 between C++ and C source files.
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 12:57 pm
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: FlightGear top programming languages

Postby bugman » Wed Jun 28, 2017 3:52 pm

This is correct. Here is a detailed breakdown of the code:

Code: Select all
$ sloccount --addlangall /flightgear/src/flightgear-simgear_clean/
[snip]
Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Computing results.


SLOC    Directory       SLOC-by-Language (Sorted)
89800   simgear         cpp=75553,ansic=14247
16952   3rdparty        ansic=16670,makefile=152,sh=130
4       CMakeModules    ansic=4
0       package         (none)
0       top_dir         (none)


Totals grouped by language (dominant language first):
cpp:          75553 (70.77%)
ansic:        30921 (28.96%)
makefile:       152 (0.14%)
sh:             130 (0.12%)




Total Physical Source Lines of Code (SLOC)                = 106,756
Development Effort Estimate, Person-Years (Person-Months) = 26.97 (323.61)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 1.87 (22.48)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 14.40
Total Estimated Cost to Develop                           = $ 3,642,953
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."


Code: Select all
$ sloccount --addlangall /flightgear/src/flightgear-flightgear_clean/
[snip]

Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Computing results.


SLOC    Directory       SLOC-by-Language (Sorted)
324149  3rdparty        ansic=301618,sh=16969,cpp=4897,asm=642,perl=23
70562   src_FDM         cpp=66547,ansic=4015
20615   src_Instrumentation cpp=20615
18906   utils           cpp=14791,ansic=1491,python=1457,perl=1072,sh=95
14796   src_GUI         cpp=14796
11865   src_Network     cpp=11865
8602    src_Main        cpp=8566,perl=36
7977    src_AIModel     cpp=7977
7912    src_Navaids     cpp=7912
6677    src_Viewer      cpp=6677
5606    src_Scripting   cpp=5606
5584    scripts         perl=3344,python=973,sh=686,java=314,cpp=152,ansic=115
4459    src_Cockpit     cpp=4459
3542    src_Airports    cpp=3542
3411    src_Environment cpp=3411
3160    src_ATC         cpp=3160
3093    src_Aircraft    cpp=3093
3000    src_Input       cpp=3000
2731    src_Autopilot   cpp=2731
1955    src_Radio       cpp=1955
1940    src_MultiPlayer cpp=1940
1815    tests           cpp=1815
1640    src_Scenery     cpp=1640
1397    src_Sound       cpp=1397
1350    src_Traffic     cpp=1350
881     src_EmbeddedResources cpp=881
796     src_Time        cpp=659,ansic=137
790     src_Systems     cpp=790
726     src_Model       cpp=726
703     src_Canvas      cpp=703
92      examples        cpp=92
84      package         sh=84
13      src_Include     ansic=13
0       CMakeModules    (none)
0       docs-mini       (none)
0       icons           (none)
0       man             (none)
0       src_top_dir     (none)
0       top_dir         (none)


Totals grouped by language (dominant language first):
ansic:       307389 (56.84%)
cpp:         207745 (38.41%)
sh:           17834 (3.30%)
perl:          4475 (0.83%)
python:        2430 (0.45%)
asm:            642 (0.12%)
java:           314 (0.06%)




Total Physical Source Lines of Code (SLOC)                = 540,829
Development Effort Estimate, Person-Years (Person-Months) = 148.16 (1,777.97)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 3.58 (42.94)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 41.40
Total Estimated Cost to Develop                           = $ 20,014,954
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."


Code: Select all
$ sloccount --addlangall /flightgear/flightgear-fgdata/
[snip]
Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Computing results.


SLOC    Directory       SLOC-by-Language (Sorted)
171     top_dir         python=171
167     Docs            python=167
128     Aircraft        sh=73,python=55
18      Textures        perl=18
15      Phi             sh=15
0       AI              (none)
0       Aircraft-uiuc   (none)
0       Airports        (none)
0       Astro           (none)
0       ATC             (none)
0       Effects         (none)
0       Environment     (none)
0       Fonts           (none)
0       Geodata         (none)
0       gui             (none)
0       HLA             (none)
0       hud_lat_lon_format (none)
0       Huds            (none)
0       Input           (none)
0       Lighting        (none)
0       Materials       (none)
0       Models          (none)
0       MP              (none)
0       Nasal           (none)
0       Navaids         (none)
0       Protocol        (none)
0       Shaders         (none)
0       Sounds          (none)
0       Timezone        (none)
0       Translations    (none)
0       Video           (none)


Totals grouped by language (dominant language first):
python:         393 (78.76%)
sh:              88 (17.64%)
perl:            18 (3.61%)




Total Physical Source Lines of Code (SLOC)                = 499
Development Effort Estimate, Person-Years (Person-Months) = 0.10 (1.16)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 0.22 (2.64)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 0.44
Total Estimated Cost to Develop                           = $ 13,021
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."


For the flightgear repository, you can see that most of the C code comes from the /3rdparty directory!

Regards,
Edward
bugman
Moderator
 
Posts: 1808
Joined: Thu Mar 19, 2015 10:01 am
Version: next


Return to Hangar talk

Who is online

Users browsing this forum: No registered users and 3 guests