forked from code-golf/code-golf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
latest-langs
executable file
·45 lines (39 loc) · 1.63 KB
/
latest-langs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env perl6
use HTTP::Tiny;
use TOML::Thumb;
constant @urls = (
'Bash' => 'Bash_(Unix_shell)',
'C' => 'Tiny_C_Compiler',
'C#' => 'C_Sharp_(programming_language)',
'COBOL' => 'GnuCOBOL',
'Crystal' => 'Crystal_(programming_language)',
'F#' => 'F_Sharp_(programming_language)',
'Fortran' => 'GNU_Fortran',
'Go' => 'Go_(programming_language)',
'Haskell' => 'Glasgow_Haskell_Compiler',
'Java' => 'Java_Development_Kit',
'JavaScript' => 'V8_(JavaScript_engine)',
'Julia' => 'Julia_(programming_language)',
'Lisp' => 'CLISP',
'Lua' => 'Lua_(programming_language)',
'Nim' => 'Nim_(programming_language)',
'PHP' => 'PHP',
'Perl' => 'Perl',
'PowerShell' => 'PowerShell',
'Python' => 'Python_(programming_language)',
'Raku' => 'Rakudo',
'Ruby' => 'Ruby_(programming_language)',
'Rust' => 'Rust_(programming_language)',
'SQL' => 'SQLite',
'Swift' => 'Swift_(programming_language)',
'Zig' => 'Zig_(programming_language)',
);
my %langs = from-toml slurp 'langs.toml';
for @urls -> (:key($lang), :value($path)) {
state $ua = HTTP::Tiny.new :throw-exceptions;
my $old = %langs{$lang}<version> ~~ / <[\d.]>+ \d+ /;
my $new = $ua.get("https://en.wikipedia.org/wiki/$path")<content>.decode
~~ / < Stable Preview > ' release' .+? '>' ( '#' \d+ ' "' )? <(<[\d.]>+)> /;
printf " %*s %s → %s\n", INIT { @urls».key».chars.max }, $lang, $old, $new
unless $old eq $new or $old.starts-with("$new.");
}