User:Thundergnat: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Language Stats:: update stats)
m (→‎Language Stats:: update syats)
Line 52: Line 52:


{|class="wikitable sortable"
{|class="wikitable sortable"
|+ As of 2022-02-27
|+ As of 2022-03-06
!Language!!Task<br>Count!!Avg. #<br>Lines / Entry!!Avg. #<br>Characters!!Avg. %<br>White space!!Avg. %<br>Alphanumerics!!Avg. %Non<br>Alphanumerics!!Avg. %<br>Non-ASCII!!Syntax<br>highlighting
!Language!!Task<br>Count!!Avg. #<br>Lines / Entry!!Avg. #<br>Characters!!Avg. %<br>White space!!Avg. %<br>Alphanumerics!!Avg. %Non<br>Alphanumerics!!Avg. %<br>Non-ASCII!!Syntax<br>highlighting
|-
|-
||Phix||1517||53||1705||32.75 %||78.38 %||21.62 %||0.03 %||Phix javascript csharp r c
||Phix||1518||53||1703||32.74 %||78.38 %||21.62 %||0.03 %||Phix r csharp javascript c
|-
|-
||Wren||1509||55||1583||31.59 %||75.74 %||24.26 %||0.1 %||ecmascript c go javascript C foo xml python bar bash baz
||Wren||1512||55||1582||31.59 %||75.74 %||24.26 %||0.1 %||ecmascript c go javascript C foo bar python xml baz bash
|-
|-
||Julia||1489||33||974||27.82 %||77.1 %||22.9 %||0.27 %||julia Julia python ruby html5 lua cpp xml html
||Julia||1491||33||975||27.82 %||77.11 %||22.89 %||0.28 %||julia Julia python html5 ruby html xml cpp lua
|-
|-
||Raku||1471||30||883||28.84 %||69.31 %||30.69 %||0.57 %||perl6 c C shell XML bash xml html
||Raku||1473||30||883||28.83 %||69.3 %||30.7 %||0.57 %||perl6 c C shell xml XML html bash
|-
|-
||Go||1460||77||1817||34.43 %||75.26 %||24.74 %||0.11 %||go Go html c bash xml thrift proto html5
||Go||1460||77||1817||34.43 %||75.26 %||24.74 %||0.11 %||go Go html bash c xml proto thrift html5
|-
|-
||Perl||1436||34||918||27.02 %||68.18 %||31.82 %||0.1 %||perl Perl bash Shell latex c html5
||Perl||1441||34||919||27.01 %||68.18 %||31.82 %||0.1 %||perl Perl bash Shell html5 c latex
|-
|-
||Nim||1398||48||1326||24.65 %||75.52 %||24.48 %||1.12 %||Nim nim python Python ruby C c $1 Nimrod xml
||Nim||1398||48||1326||24.65 %||75.52 %||24.48 %||1.12 %||Nim nim python Python ruby C c $1 xml Nimrod
|-
|-
||Python||1350||71||1993||30.73 %||75.45 %||24.55 %||0.04 %||python Python html5 bash cmd c ebnf xml python3 Shell
||Python||1351||71||1997||30.73 %||75.45 %||24.55 %||0.04 %||python Python html5 bash c cmd xml python3 ebnf Shell
|-
|-
||C||1199||78||1844||28.67 %||72.52 %||27.48 %||0.01 %||c C cpp bash XML Assembly make d go perl html5 sh Shell
||C||1199||78||1846||28.68 %||72.52 %||27.48 %||0.01 %||c C cpp bash XML d Assembly go make html5 sh Shell perl
|-
|-
||REXX||1144||55||3358||40.33 %||68.44 %||31.56 %||8.48 %||rexx REXX Rexx sh cobol
||REXX||1144||55||3358||40.33 %||68.44 %||31.56 %||8.48 %||rexx REXX Rexx cobol sh
|-
|-
||Kotlin||1131||47||1363||33.21 %||77.62 %||22.38 %||0.04 %||scala kotlin Kotlin c C groovy Groovy xml scheme HTML5 java html5
||J||1134||27||755||26.92 %||69.48 %||30.52 %||6.49 %||j J bash sh %s c foo baz make C bnf html5 SNUSP python bar xml
|-
|-
||J||1131||27||749||26.83 %||69.47 %||30.53 %||6.45 %||j J bash sh %s c foo C bnf html5 SNUSP baz python make bar xml
||Kotlin||1131||47||1363||33.21 %||77.62 %||22.38 %||0.04 %||scala kotlin Kotlin c C html5 Groovy scheme xml groovy HTML5 java
|-
|-
||Java||1125||66||2061||33.42 %||78.56 %||21.44 %||0.01 %||java java5 Java Java5 c xml html5 bash make foo shell cmd Java8 bar java 12
||Java||1126||66||2061||33.42 %||78.56 %||21.44 %||0.01 %||java java5 Java Java5 c bash xml html5 make foo Java8 java 12 shell cmd bar
|-
|-
||Haskell||1113||44||1346||28.33 %||76.89 %||23.11 %||0.08 %||haskell Haskell bash c html5 sh text
||Haskell||1114||44||1347||28.34 %||76.88 %||23.12 %||0.08 %||haskell Haskell bash text html5 sh c
|-
|-
||Mathematica||1106||11||409||17.52 %||70.72 %||29.28 %||0.04 %||Mathematica mathematica foo barf baz "~~ x~~" sh bar
||Mathematica||1106||11||409||17.5 %||70.75 %||29.25 %||0.04 %||Mathematica mathematica foo baz "~~ x~~" bar barf sh
|-
|-
||Racket||1089||33||1118||26.47 %||75.05 %||24.95 %||0.29 %||racket Racket scheme C cmd html5 bash xml
||Ruby||1090||32||824||26.22 %||76.49 %||23.51 %||0.06 %||ruby Ruby bash c html5 foo tcl rust baz bar
|-
|-
||Ruby||1089||32||824||26.23 %||76.48 %||23.52 %||0.06 %||ruby Ruby bash html5 foo c baz tcl bar rust
||Racket||1089||33||1118||26.47 %||75.05 %||24.95 %||0.29 %||racket Racket scheme bash html5 xml C cmd
|-
|-
||C++||1076||73||1984||29.22 %||72.69 %||27.31 %||0.02 %||cpp Cpp C++ c CPP c++ sh html5 make text C cmake asm d bash
||C++||1085||73||1978||29.21 %||72.69 %||27.31 %||0.02 %||cpp Cpp C++ c CPP c++ sh html5 make C asm text d cmake bash
|-
|-
||zkl||1011||19||688||17.98 %||69.69 %||30.31 %||0.03 %||zkl c bash csharp html5 r
||zkl||1011||19||688||17.98 %||69.69 %||30.31 %||0.03 %||zkl c bash csharp r html5
|-
|-
||FreeBASIC||1005||46||1203||30.61 %||82.32 %||17.68 %||0.03 %||freebasic FreeBASIC FreeBasic qbasic basic c Freebasic zxbasic
||FreeBASIC||1005||46||1203||30.61 %||82.32 %||17.68 %||0.03 %||freebasic FreeBASIC FreeBasic qbasic Freebasic zxbasic basic c
|}
|}



<div style="padding:1em;background:#eeeeff;"><h3>Older commentary</h3>
<div style="padding:1em;background:#eeeeff;"><h3>Older commentary</h3>

Revision as of 21:05, 6 March 2022

My Favorite Languages
Language Proficiency
Perl Moderately Proficient
Perl 6 Still seems like I use it all the time
Raku Use it all the time

License:

Any code which I have submitted to Rosettacode may be used under the Unlicense.

I would appreciate that any use includes a link back to the Rosettacode page from which it was obtained (but obviously would have no way to enforce that.)


Reports:


Utilities:

Tampermonkey or Greasemonkey javascript applets


Resources:


Language Stats:

As part of my reports I generate weekly (listed above) I have started to collect some statistics on languages that have a large number of entries. (For now, the cut off is 1000.) A sufficiently large number of entries should average out outliers and give at least an reasonable overview of how different languages stack up.

Note that this is purely for my own entertainment and curiosity. I strenuously want to avoid people making efforts to optimize for one metric or another. Many of these are heavily influenced by a particular stylistic choice made by a prolific entry author. None of these are good or bad. Just observations.

Comments aren't filtered out, so entries that have lots of comments will have higher character counts. That isn't a bad thing though. Quite the opposite in fact. The whole point of Rosettacode is to learn how different languages can accomplish the same task. Lots of comments is a good thing.

How the various metrics are calculated / what they mean. Averages are the sum of all of that item in every entry divided by the total number of tasks with an entry, rounded to the nearest integer or percentage.

  • Task count - The number of tasks for which there is an entry in that language.
  • Average lines per entry - The average number of lines in code blocks per entry. Multiple versions under the same task all count as lines per task. (If there are four versions and each has 25 lines, it counts as 100 for that task.)
  • Average number of character - Average number of characters inside <lang *></lang> blocks per task including whitespace.
  • Average whitespace - How many of the above characters are white space? (Including new line characters.)
  • Average percent alpha-numerics - What percentage of the non-white space characters are alphabetic or numeric?
  • Average percent non-alpha-numerics - What percentage of the non-white space characters are not alphabetic or numeric? (Punctuation, symbols, etc)
  • Average percent non-ASCII - What percentage of the non-white space characters are not ASCII characters?
  • Syntax highlighting - What syntax highlighter does it use in order from most to least common. (Note that some variation is expected, especially for tasks like Call a foreign-language function, Rosetta Code/Find bare lang tags or probably the largest source of oddball <lang *> tags: Rosetta Code/Fix_code_tags.)
As of 2022-03-06
Language Task
Count
Avg. #
Lines / Entry
Avg. #
Characters
Avg. %
White space
Avg. %
Alphanumerics
Avg. %Non
Alphanumerics
Avg. %
Non-ASCII
Syntax
highlighting
Phix 1518 53 1703 32.74 % 78.38 % 21.62 % 0.03 % Phix r csharp javascript c
Wren 1512 55 1582 31.59 % 75.74 % 24.26 % 0.1 % ecmascript c go javascript C foo bar python xml baz bash
Julia 1491 33 975 27.82 % 77.11 % 22.89 % 0.28 % julia Julia python html5 ruby html xml cpp lua
Raku 1473 30 883 28.83 % 69.3 % 30.7 % 0.57 % perl6 c C shell xml XML html bash
Go 1460 77 1817 34.43 % 75.26 % 24.74 % 0.11 % go Go html bash c xml proto thrift html5
Perl 1441 34 919 27.01 % 68.18 % 31.82 % 0.1 % perl Perl bash Shell html5 c latex
Nim 1398 48 1326 24.65 % 75.52 % 24.48 % 1.12 % Nim nim python Python ruby C c $1 xml Nimrod
Python 1351 71 1997 30.73 % 75.45 % 24.55 % 0.04 % python Python html5 bash c cmd xml python3 ebnf Shell
C 1199 78 1846 28.68 % 72.52 % 27.48 % 0.01 % c C cpp bash XML d Assembly go make html5 sh Shell perl
REXX 1144 55 3358 40.33 % 68.44 % 31.56 % 8.48 % rexx REXX Rexx cobol sh
J 1134 27 755 26.92 % 69.48 % 30.52 % 6.49 % j J bash sh %s c foo baz make C bnf html5 SNUSP python bar xml
Kotlin 1131 47 1363 33.21 % 77.62 % 22.38 % 0.04 % scala kotlin Kotlin c C html5 Groovy scheme xml groovy HTML5 java
Java 1126 66 2061 33.42 % 78.56 % 21.44 % 0.01 % java java5 Java Java5 c bash xml html5 make foo Java8 java 12 shell cmd bar
Haskell 1114 44 1347 28.34 % 76.88 % 23.12 % 0.08 % haskell Haskell bash text html5 sh c
Mathematica 1106 11 409 17.5 % 70.75 % 29.25 % 0.04 % Mathematica mathematica foo baz "~~ x~~" bar barf sh
Ruby 1090 32 824 26.22 % 76.49 % 23.51 % 0.06 % ruby Ruby bash c html5 foo tcl rust baz bar
Racket 1089 33 1118 26.47 % 75.05 % 24.95 % 0.29 % racket Racket scheme bash html5 xml C cmd
C++ 1085 73 1978 29.21 % 72.69 % 27.31 % 0.02 % cpp Cpp C++ c CPP c++ sh html5 make C asm text d cmake bash
zkl 1011 19 688 17.98 % 69.69 % 30.31 % 0.03 % zkl c bash csharp r html5
FreeBASIC 1005 46 1203 30.61 % 82.32 % 17.68 % 0.03 % freebasic FreeBASIC FreeBasic qbasic Freebasic zxbasic basic c

Older commentary

Second pass through after a lot of minor patches to the site and custom syntax highlighting filtering added. Should be a lot more accurate less inaccurate now. Numbers probably still don't mean anything, but they aren't quite as large outright whoppers. J numbers are still way overstated due to the very common decision to just include the output inside the language tags rather than in a separate output section. Not really sure what to do about it (if anything.) I really don't want to take on trying to untangle that mess. --Thundergnat (talk) 21:29, 13 February 2022 (UTC)

Some observations: Phix numbers are completely bogus due to the custom syntax highlighting code polluting every entry. Eventually I'll look into filtering. This is a very preliminary first whack at it. I expected Raku to have a higher percent of non-ASCII characters and was very surprised by J and REXX having so much. On closer investigation, J and REXX entries make heavy use of box line drawing characters... which aren't ASCII. Syntax highlighting directives are all over the place. Case doesn't matter but spelling nominally does. Though, to be fair, most of the syntax highlighting are very minor variations, so getting it wrong probably doesn't change much. There are a whole bunch of obvious typos in there too though. Sigh. --Thundergnat (talk), 08 February

Sorry about the Phix syntax highlighting mess. I'd love to use standard Geshi, and in fact do on my own site, but waited 6 years and nothing happened. In a lovely world there would be a special page on RC containing the geshi highlighting files for all languages, that anyone could edit in the usual way with the usual single-click to undo any vandalism, and periodically (bi-annual would be plenty) some admin pushes updates into the geshi dir. I guess you could even have a <lang PhixRC> mechanism whereby "release candidate" geshi updates could be tried out on selected pages without risking damaging the whole site. Alternatively it should actually be fairly straightforward for a man of your talents to html-strip the Phix entries (just sayin), and/or I'm not above being tasked to go and clean up my own mess, which one day I still hope to be able to do (trust me, I too despise my own minor updates showing up as complete gobbledeygook). I also wonder if it would be at all useful for the syntax highlighting column to contain (first/random) links to offending pages, so I could find out what page it thinks is using say "PL/1" or "Phi"? --Pete Lomax (talk) 10:04, 10 February 2022 (UTC)