Jump to content

Rosetta Code/Rank languages by number of users: Difference between revisions

m
(Updated URL from ""http://rosettacode.org/mw/api.php?" to ""http://rosettacode.org/w/api.php?". Updated output.)
m (→‎{{header|Wren}}: Minor tidy)
Line 2,004:
 
We can in fact get all the information needed for this task just by parsing the 'Special:Categories' page. Note however that the HTML for this page contains some invisible Unicode right-to-left and left-to-right characters - a well known security risk but apparently harmless here - which need to be allowed for when extracting the number of users.
<syntaxhighlight lang="ecmascriptwren">/* rc_rank_languages_by_number_of_usersRosetta_Code_Rank_languages_by_number_of_users.wren */
 
import "./pattern" for Pattern
Line 2,055:
}
over100s.sort { |a, b| a[1] > b[1] }
System.print("Languages with at least 100 users as at 43 JanuaryFebruary, 20222024:")
var rank = 0
var lastScore = 0
Line 2,074:
<br>
We now embed this script in the following C program, build and run.
<syntaxhighlight lang="c">/* gcc rc_rank_languages_by_number_of_usersRosetta_Code_Rank_languages_by_number_of_users.c -o rc_rank_languages_by_number_of_usersRosetta_Code_Rank_languages_by_number_of_users -lcurl -lwren -lm */
 
#include <stdio.h>
Line 2,248:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "rc_rank_languages_by_number_of_usersRosetta_Code_Rank_languages_by_number_of_users.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 2,268:
{{out}}
<pre>
Languages with at least 100 users as at 93 SeptemberFebruary, 20222024:
1 C 441434
2 Java 321326
3 Python 319323
4 C++ 314306
5 JavaScript 291287
6 PHP 190188
7 Perl 186181
8 SQL 167166
9 UNIX Shell 151146
10 Pascal 133128
11 10= BASIC 132128
11=12 C sharp 132124
13 Haskell 115107
14 Ruby 107101
</pre>
 
9,490

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.