User:Thundergnat: Difference between revisions

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


{|class="wikitable sortable"
{|class="wikitable sortable"
|+ As of 2022-07-24
|+ As of 2022-08-14
!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
|-
|-
||Wren||1558||57||1649||31.56 %||75.84 %||24.16 %||0.09 %||ecmascript c go javascript C foo xml bar bash baz python
||Wren||1561||57||1648||31.56 %||75.83 %||24.17 %||0.09 %||ecmascript c go javascript C foo xml bar bash baz python
|-
|-
||Phix||1557||55||1791||32.7 %||78.26 %||21.74 %||0.04 %||Phix c csharp javascript r
||Phix||1559||55||1791||32.7 %||78.25 %||21.75 %||0.04 %||Phix c csharp javascript r
|-
|-
||Julia||1527||34||1010||27.94 %||77.18 %||22.82 %||0.27 %||julia Julia ruby html5 python cpp html lua xml
||Julia||1530||34||1009||27.93 %||77.17 %||22.83 %||0.27 %||julia Julia ruby html5 python cpp html lua xml
|-
|-
||Raku||1502||30||893||28.86 %||69.32 %||30.68 %||0.58 %||perl6 bash c C html rust shell xml XML
||Raku||1507||30||895||28.85 %||69.31 %||30.69 %||0.59 %||perl6 bash C c html rust shell XML xml
|-
|-
||Go||1496||76||1809||34.57 %||75.22 %||24.78 %||0.1 %||go Go html bash c xml ecmascript futurebasic html5 proto thrift
||Go||1497||76||1808||34.57 %||75.23 %||24.77 %||0.1 %||go Go html bash c xml ecmascript futurebasic html5 proto thrift
|-
|-
||Perl||1465||34||922||27.01 %||68.16 %||31.84 %||0.1 %||perl Perl bash Shell c html5 latex
||Perl||1467||34||924||27.03 %||68.14 %||31.86 %||0.1 %||perl Perl bash Shell c html5 latex
|-
|-
||Nim||1401||48||1325||24.66 %||75.53 %||24.47 %||1.12 %||Nim nim python Python ruby c C $1 Nimrod xml
||Nim||1402||48||1324||24.66 %||75.53 %||24.47 %||1.12 %||Nim nim python Python ruby c C $1 Nimrod xml
|-
|-
||Python||1391||72||2012||30.85 %||75.52 %||24.48 %||0.04 %||python Python bash html5 c cmd python3 ebnf QB64 Shell xml
||Python||1394||72||2023||30.86 %||75.52 %||24.48 %||0.04 %||python Python bash html5 c cmd python3 ebnf QB64 Shell xml
|-
|-
||J||1234||27||772||28.34 %||69.21 %||30.79 %||6.74 %||j J bash sh %s C c foo bar baz bnf html5 make python SNUSP xml
||J||1267||27||758||26.95 %||69.62 %||30.38 %||6.63 %||j J bash sh %s C c foo bar baz bnf html5 make python SNUSP xml
|-
|-
||C||1211||79||1864||28.74 %||72.54 %||27.46 %||0.01 %||c C cpp bash XML Assembly d go html5 make perl sh Shell
||C||1214||79||1863||28.74 %||72.56 %||27.44 %||0.01 %||c C cpp bash XML Assembly d go html5 make perl sh Shell
|-
|-
||Mathematica||1157||11||410||17.47 %||70.84 %||29.16 %||0.04 %||Mathematica mathematica foo Wolfram Language "~~ x~~" bar barf baz sh
||Mathematica||1177||11||410||17.43 %||70.89 %||29.11 %||0.04 %||Mathematica mathematica foo Wolfram Language "~~ x~~" bar barf baz sh
|-
|-
||REXX||1145||55||3356||40.33 %||68.44 %||31.56 %||8.48 %||rexx REXX Rexx cobol sh
||REXX||1146||55||3355||40.32 %||68.44 %||31.56 %||8.47 %||rexx REXX Rexx cobol sh
|-
|-
||Java||1135||66||2072||33.53 %||78.55 %||21.45 %||0.01 %||java java5 Java Java5 c bash html5 xml foo make bar cmd java 12 java8 Java8 python shell
||Java||1137||66||2071||33.54 %||78.56 %||21.44 %||0.01 %||java java5 Java Java5 c bash html5 xml foo make bar cmd java 12 java8 Java8 python shell
|-
|-
||Kotlin||1131||47||1366||33.21 %||77.61 %||22.39 %||0.03 %||scala kotlin Kotlin C c groovy Groovy html5 HTML5 java Scheme scheme xml
||Haskell||1135||45||1351||28.34 %||76.86 %||23.14 %||0.08 %||haskell Haskell bash c html5 sh text
|-
|-
||Haskell||1126||45||1355||28.34 %||76.85 %||23.15 %||0.08 %||haskell Haskell bash c html5 sh text
||Kotlin||1132||47||1365||33.21 %||77.61 %||22.39 %||0.03 %||scala kotlin Kotlin C c Groovy groovy html5 HTML5 java Scheme scheme xml
|-
|-
||C++||1109||73||1968||29.27 %||72.69 %||27.31 %||0.02 %||cpp Cpp C++ c c++ CPP sh html5 asm bash C cmake d make text
||C++||1112||73||1971||29.28 %||72.7 %||27.3 %||0.02 %||cpp Cpp C++ c c++ CPP sh html5 asm bash C cmake d make text
|-
|-
||Ruby||1100||32||832||26.18 %||76.5 %||23.5 %||0.06 %||ruby Ruby bash c foo html5 bar baz rust tcl
||Ruby||1103||32||832||26.17 %||76.49 %||23.51 %||0.06 %||ruby Ruby bash c foo html5 bar baz rust tcl
|-
|-
||Racket||1091||33||1139||26.49 %||75.09 %||24.91 %||0.29 %||racket Racket scheme bash C cmd html5 xml
||Racket||1091||33||1139||26.49 %||75.09 %||24.91 %||0.29 %||racket Racket scheme bash C cmd html5 xml

Revision as of 20:31, 14 August 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 I Generate:


Utilities I Wrote:

Tampermonkey or Greasemonkey javascript applets


Resources I Host:


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 characters - 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-08-14
Language Task
Count
Avg. #
Lines / Entry
Avg. #
Characters
Avg. %
White space
Avg. %
Alphanumerics
Avg. %Non
Alphanumerics
Avg. %
Non-ASCII
Syntax
highlighting
Wren 1561 57 1648 31.56 % 75.83 % 24.17 % 0.09 % ecmascript c go javascript C foo xml bar bash baz python
Phix 1559 55 1791 32.7 % 78.25 % 21.75 % 0.04 % Phix c csharp javascript r
Julia 1530 34 1009 27.93 % 77.17 % 22.83 % 0.27 % julia Julia ruby html5 python cpp html lua xml
Raku 1507 30 895 28.85 % 69.31 % 30.69 % 0.59 % perl6 bash C c html rust shell XML xml
Go 1497 76 1808 34.57 % 75.23 % 24.77 % 0.1 % go Go html bash c xml ecmascript futurebasic html5 proto thrift
Perl 1467 34 924 27.03 % 68.14 % 31.86 % 0.1 % perl Perl bash Shell c html5 latex
Nim 1402 48 1324 24.66 % 75.53 % 24.47 % 1.12 % Nim nim python Python ruby c C $1 Nimrod xml
Python 1394 72 2023 30.86 % 75.52 % 24.48 % 0.04 % python Python bash html5 c cmd python3 ebnf QB64 Shell xml
J 1267 27 758 26.95 % 69.62 % 30.38 % 6.63 % j J bash sh %s C c foo bar baz bnf html5 make python SNUSP xml
C 1214 79 1863 28.74 % 72.56 % 27.44 % 0.01 % c C cpp bash XML Assembly d go html5 make perl sh Shell
Mathematica 1177 11 410 17.43 % 70.89 % 29.11 % 0.04 % Mathematica mathematica foo Wolfram Language "~~ x~~" bar barf baz sh
REXX 1146 55 3355 40.32 % 68.44 % 31.56 % 8.47 % rexx REXX Rexx cobol sh
Java 1137 66 2071 33.54 % 78.56 % 21.44 % 0.01 % java java5 Java Java5 c bash html5 xml foo make bar cmd java 12 java8 Java8 python shell
Haskell 1135 45 1351 28.34 % 76.86 % 23.14 % 0.08 % haskell Haskell bash c html5 sh text
Kotlin 1132 47 1365 33.21 % 77.61 % 22.39 % 0.03 % scala kotlin Kotlin C c Groovy groovy html5 HTML5 java Scheme scheme xml
C++ 1112 73 1971 29.28 % 72.7 % 27.3 % 0.02 % cpp Cpp C++ c c++ CPP sh html5 asm bash C cmake d make text
Ruby 1103 32 832 26.17 % 76.49 % 23.51 % 0.06 % ruby Ruby bash c foo html5 bar baz rust tcl
Racket 1091 33 1139 26.49 % 75.09 % 24.91 % 0.29 % racket Racket scheme bash C cmd html5 xml
FreeBASIC 1070 47 1234 30.88 % 82.38 % 17.62 % 0.03 % freebasic FreeBASIC FreeBasic qbasic basic c Freebasic zxbasic
zkl 1011 19 688 17.98 % 69.69 % 30.31 % 0.03 % zkl c bash csharp html5 r
Sidef 1003 22 545 30.82 % 70.17 % 29.83 % 0.45 % ruby sidef shell html5

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)