»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
AlexDaniel weekly: perlweeklychallenge.org/blog/phili...lenge-001/ 00:52
notable6 AlexDaniel, Noted!
ugexe first challenge didnt print the number of Es 00:54
AlexDaniel actually, now that I've read the post… I'm no longer sure what it is about
ugexe: it actually does? 00:55
ugexe heh my eyes melded the $ and 5
lookatme_q m: 00:58
evalable6
lookatme_q m: $_ = 'Perl Weekly Challenge'; say +s:g/e/E/; .say;
evalable6 5
PErl WEEkly ChallEngE
AlexDaniel that's sorta what I sent 01:09
m: $_ = 'Perl Weekly Challenge'; say +t/e/E/; .say;
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/bLcBG25y8U
Missing…
AlexDaniel, Full output: gist.github.com/38f63d1d3f1aba68f7...a26a0b38b8
AlexDaniel m: $_ = 'Perl Weekly Challenge'; say +tr/e/E/; .say;
evalable6 5
PErl WEEkly ChallEngE
AlexDaniel it's sorta different because you get StrDistance back 01:10
ugexe anyone think of a polyglot way to do map between perl 5/6? that damn comma... 01:12
i was hoping something like `sub mapp(&;@_) { }` but i would at the very least need &; to be &x;, which breaks it 01:15
AlexDaniel what about 01:17
perl -E 'sub foo($_) { $_ + 1 }; say join ",", map &foo, (2,5,8)'
this works with `perl6 -e` too
ugexe hmm, why can you say `map &foo,` but not `map { ... },` 01:18
AlexDaniel map BLOCK LIST
map EXPR,LIST
Juerd ugexe: Because it uses map EXPR instead of map BLOCK
ugexe ah 01:19
Juerd &foo is the old Perl 5 function call syntax that passes @_ implicitly
&foo is like foo(@_). It's nasty. 01:20
AlexDaniel I'm surprised sub foo($_) works
Juerd AlexDaniel: Perl 5 ignores the _ 01:21
And $_ is a global
AlexDaniel Juerd: yes but you can write `sub foo($x, $y)` and I guess it does something, right?
Juerd Prototypes ignore invalid characters 01:22
AlexDaniel oh… right… obviously…
Juerd Oh, it doesn't (anymore?) 01:23
AlexDaniel v5.28.1 doesn't complain
Juerd Mine does. 01:24
1;0 juerd@cxien:~$ perl -e'sub foo($x, $y) { die $x } foo(4, 5)'
Malformed prototype for main::foo: $x, $y at -e line 1.
AlexDaniel yeah but only if you call it like that
`sub foo($x, $y) { }` by itself is legal 01:25
and so is
perl -E 'sub foo($x, $y) { $_ + 1 }; say join ",", map &foo, (2,5,8)'
Juerd Isn't that just because prototype checking is runtime?
& doen't do prototype checking
s/doen/doesn/
AlexDaniel heh… I'm happy perl 6 exists… :) 01:26
Juerd 1;0 juerd@cxien:~$ perl -e'sub three($$$) { die } &three("one")'
Died at -e line 1.
AlexDaniel someone should create a polyglot code golf website
Xliff You're joking..right? It is that time of year. :P 01:29
Xliff AlexDaniel: Mmm... Now why am I thinking about stones?! :P 01:38
Juerd ugexe: map &{ sub ($_) { $_ + 1 } }.(), 2, 4, 6
ugexe Juerd: nice, thats even better 01:39
Juerd Note that you do end up with strings in Perl 5. 01:40
AlexDaniel Xliff: stones? 01:52
like the rolling ones? 01:53
Xliff: but, not really, code-golf.io/ was a lot of fun for me but it got boring fast 01:59
so having to golf in two languages at the same time can add a little bit of spice
Xliff AlexDaniel: RosettaStone 02:06
It's not golfing, but you can definitely get tips. 02:07
AlexDaniel April 1st… today I can finally submit a bunch of stupid tickets :) 02:11
Xliff LOL! 02:13
Not quite yet here on the East Coast USA
Xliff StackOverflow got a head start. 02:13
Geth doc/master: 4 commits pushed by (JJ Merelo)++ 05:51
Geth doc: 10ff8d0ea8 | (JJ Merelo)++ | doc/Type/Junction.pod6
Documents junction.Bool refs #2703
06:01
synopsebot_ Link: doc.perl6.org/type/Junction
heince what is the module recommendation to do http client (get,post,put,delete) now in term of performance ? 07:12
lookatme_q heince, you can take a look at Cro 07:25
heince is it included in rakudo star ? 07:28
lookatme_q IDK, you can install it by yourself 07:29
heince ok thanks, testing it 07:32
lizmat weekly: perl6.eu/gather-take.html 09:06
notable6 lizmat, Noted!
tyil is there a more perly way to write `for 1,3,4,5,6,7 { say $_ }`? I want to loop through a list of numbers, but skip a given number (in this case, 2) 09:49
sena_kun `next if $_ ==`? 09:50
m: for (1..8) { next if $_ == 2; $_.say }
evalable6 1
3
4
5
6
7
8
sena_kun m: for (1..8) { next when 2; $_.say } 09:51
evalable6 1
3
4
5
6
7
8
tyil I can add a couple next if ... clauses, I was hoping to be able to make the list itself represent the iterations of the loop
instead of handling it in the for loop's body
sena_kun m: for (1..8).grep({ $_ != 2 }) { $_.say } 09:52
evalable6 1
3
4
5
6
7
8
lizmat m: .say for (1..7).grep( * != 2 ) 09:53
evalable6 1
3
4
5
6
7
sena_kun benchable6, compare HEAD for (1..8) { next if $_ == 2; $_.say } ||| for (1..8).grep({ $_ != 2 }) { $_.say }
benchable6 sena_kun, starting to benchmark the 1 given commit
sena_kun, gist.github.com/03465d31b9122609cc...3078fc4fc4
sena_kun for 100_000 iterations, the second way is a bit slower, but is not a disaster, so grepping may be an option. 09:57
lizmat I think that is because the "for 1..8 {" gets highly optimized, whereas the "(1..8).grep" case is not, but is more general and not depending on the values being numbers 10:04
sena_kun well, it is understandable that having a simple jmp for `next` on a branch would be cheaper than streaming values, just was curious how much and it isn't too much. 10:07
so pretty nice job was done in this area. :)
timotimo does anybody want to see how much gain there could be from building a "full-featured" iterator into resultsets in DBIish? so that push-until-lazy and push-all and such would be a very tight loop instead of calling pull-one over and over? 10:09
sena_kun timotimo, it depends on what "want to see" implies. ;) 10:12
AlexDaniel weekly: “Perl 5 and Perl 6 are too dissimilar” github.com/JRaspass/code-golf/issu...-478498363 10:29
notable6 AlexDaniel, Noted!
lizmat notable6: weekly 10:31
notable6 lizmat, 10 notes: gist.github.com/b24bb7d5c7497900a7...8dcaa3d93b
pmurias if I want to keep a known revision of roast that rakudo.js is known to pass is a submodule in my run-roast-in-chrome repo a good choice? 11:09
timotimo sena_kun: implement it and benchmark i guess %) 11:12
patrickb There has been this idea of a list of domain experts which helps with change proposals to Perl 6. Is this idea still a thing? 12:33
moritz yes, see github.com/perl6/problem-solving/pull/2 12:35
sena_kun github.com/perl6/problem-solving <- this?
oops, too slow
lizmat yet another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2019/04/01/...kes-today/ 12:40
tbrowder ++lizmat 12:53
i just tried "zef upgrade DBIish" and got a moarvm core dump, rakudo 2019.03 12:54
tbrowder g'day all 13:06
i'm trying to use an END block to clean up db resources. does END run after an exit statement or is it ignored. the docs are a bit hazy to me in that regard when it says "late as possible". 13:12
in the docs the LEAVE block is specifically mentioned as being ignored after an exit statement, but no mention of END. 13:15
hahainternet no idea but might be worth testing to see 13:30
i have my own question too, anyone written a graphicsmagick/imagemagick module worth looking at?
lizmat m: END say "goodbye"; exit 13:32
evalable6 goodbye
lizmat the exit will *first* run all of the END blocks 13:32
lizmat m: exit; END say "goodbye" 13:33
evalable6 goodbye
lizmat m: exit; END say "goodbye"; LEAVE say "bye now"
evalable6 goodbye
lizmat interestin 13:34
m: END say "goodbye"; LEAVE say "bye now"
evalable6 bye now
goodbye
lizmat guess that makes sense, considering that "exit" is just a sub being called with magic properties
timotimo m: my &*EXIT = -> | { say "haha" }; exit 1; say "fooled you" 13:36
evalable6 haha
fooled you
AlexDaniel hahainternet: yeah there's modules.perl6.org/dist/MagickWand:cpan:AZAWAWI but it's incomplete 13:37
hahainternet AlexDaniel: cheers, just need to generate a simple focus target image 13:38
so i thought i'd try and write a succinct p6 version
tbrowder ref my end problem: solved! duh, ... the END was placed after a pod =finish directive! ;-( 14:00
ugexe m: print("$_\n") for map &{ sub ($_) { /^0[0123456789]+/ and (0+$_) or $_ } }.(), (1,2, "01", "0002", "03030", "a", "-001"); 14:10
evalable6 1
2
01
0002
03030
a
-001
ugexe darn
hasuwiz Good evening, #Perl6 14:11
eseyman Good evening to you, hasuwiz 14:12
ugexe m: print("$_\n") for map &{ sub ($_) { /^0(0|1|2|3|4|5|6|7|8|9)+/ && (0+$_) || $_ } }.(), (1,2,"01","0002", "03030", "a", "-001"); 14:13
evalable6 1
2
1
2
3030
a
-001
Geth DBIish: 8d1749dd23 | (Tom Browder)++ (committed using GitHub Web editor) | README.pod
tweak grammar
14:15
tbrowder getting test failure for DBIish with unique constraint, but it installs anyway. i need that capability. i'm using deb 9 which uses sqlite3 version 3.16. it looks like LOTS of bug fixes to sqlite which is at version 3.27.2 now. 15:06
tbrowder any ideas other than compiling sqlite from source? 15:07
sena_kun with debian you _possibly_ can possibly get updates from custom repo... maybe a testing branch will do? 15:19
though from my experience with testing it takes some work.
sena_kun tbrowder, packages.debian.org/search?keywords=sqlite3 <- I see 3.27.2-1 available in stretch-backports. 15:22
tbrowder sena_kun: thanks! 15:25
when using backports, does that cause problems when buster is release? 15:26
*released%. 15:27
sena_kun I am not a debian user, but I don't think so. I mean, those are backports... It is not like you are changing the release. 15:30
AlexDaniel yeah, it should be fine
amosbird hi, why is perl6 20 years later? 17:23
heh github.com/perl7/perl7
tadzik why is perl 6 what 20 years later? 17:25
AlexDaniel amosbird: because we didn't invent time travel yet?
AlexDaniel or maybe we did, and sent it into the future… 17:25
amosbird oops, I mean 20 years late 17:29
perl 5 is 94
perl 3 4 5 92 93 94
lizmat amosbird: why does it matter and why do you want to know ? 17:30
amosbird ok, just found the answer that I'm looking for www.quora.com/Perl-programming-lan...ybody-care 17:36
amosbird "Perl 6 is expected to facilitate creation of domain-specific languages by making it easier to create and parse grammars. If it delivers on this promise, it will be one valuable feature that helps distinguish Perl 6 from the crowd." This actually attracts me 17:38
and this answers my question "Larry is releasing Perl 6, because 15 years ago he decided to re-write his creation from the ground up. It was a long journey, and it took them to places he didn't imagine and the quest was different in the completion than in the onset. As for the validity of why he did this, that's a dumb question. We don't often do things just for validity, most of the time we are just 17:40
scratching an intellectual itch, which he has done. I am pretty sure that some people are going to discuss it."
theangryepicbana I was readong the Perl 6 Weekly and noticed that my new module wasn't listed 17:44
*reading
lizmat theangryepicbana: :-( I forgot to check the ecosystem repo 17:47
theangryepicbana ok 17:50
next week I guess 17:51
lizmat should be there now 17:53
please reload the page
sorry for missing it, my bad 17:54
theangryepicbana no problem
I should work in it more today
lizmat it's just much easier for me if a distribution is on CPAN, specifically for updates 17:55
theangryepicbana *on
ah
lizmat updates to CPAN are automatically tweeted: twitter.com/perl6_cpan_new
theangryepicbana I don't use CPAN as much as modules.perl6
sena_kun (my two modules latest were left out too, but it was some months ago already, I believe) 17:56
lizmat :-(
please let me know if you miss something: if nobody tells me I missed something, how am I to know ?
theangryepicbana maybe make a bot that also posts additions to modules.perl6
lizmat and how would the bot know> 17:57
?
theangryepicbana well, how does the current bot know that modules are added to CPAN?
sena_kun sure, I am usually pointing out these things, just somehow was in no use module that time.
lizmat check every update to every repo that is in the ecosystem ?
theangryepicbana oh
lizmat the PAUSE mechanism has a callback mechanism, I believe... 17:58
github.com/skaji/perl6-cpan-new has the code
theangryepicbana lemme look
nvm I can't read go 17:59
maybe have it check for updates in github.com/perl6/ecosystem? 18:01
amosbird is this github.com/rakudo/rakudo the official perl6 compiler? 18:02
lizmat amosbird: it is a compiler that passes the most tests that make up Perl 6
amosbird so perl6 becomes test defined instead of implementation defined 18:04
sena_kun yes 18:04
amosbird are there similar projects like github.com/numba/numba in perl6? 18:10
sena_kun not ones I know about. there are some cool things built in, like 0.1 + 0.2 gives you what it has too, also some math and stat-related libraries, but nothing like NumPy yet. And performance benchmarks can sometimes be sad, so if you want something like Julia, R or whatever to _crunch_ numbers fast, that might be not it. 18:13
s/has too/has to/
amosbird ok, so what can I use perl6 for currently (that it's actually good at right now) 18:15
sena_kun amosbird, automating scripts, web, anything with concurrency nicely packed in, compilers... 18:16
theangryepicbana amosbird: have you never heard of Inline::Python
Geth doc: 6dd090ea59 | Coke++ | doc/Type/Junction.pod6
avoid typo, reword slightly.
18:38
doc: 1ef04d824d | Coke++ | xt/code.pws
word used in code
synopsebot_ Link: doc.perl6.org/type/Junction
doc: 36ee82e632 | Coke++ | doc/Type/Junction.pod6
rephrase to avoid neologism
timotimo once moarvm's jit learns about float ops and registers, we'll likely get better "raw number crunching" performance in some cases. that's the hope at least :) 19:11
ctilmes Would be nice to have IO of multi-dimensional arrays of packed native integers and floats (like Perl5 PDLs) 19:18
timotimo we do have .read-float32 and .read-float64 now for the buf class
that gets you pretty far already
the heap snapshot analyzer will, with its new format, grab a stream of packed integers from a file that goes through zstd and pull them into native arrays 19:19
ctilmes I saw some of that coming in -- I haven't tried it yet -- maybe that will meet my needs -- I set aside a task that needed it a while ago
timotimo i've got kind of an interest to have that be fast ;)
timotimo it actually does not yet beat the implementation i had before, but that's mostly because the parameters didn't match up quite 19:20
read-uint32 and friends take an offset, whereas my implementation shifted off the beginning of the array so it didn't have to carry an index around (but now the version with .read-uint32 had to shift the values off the beginning as well) 19:21
and i more or less cheated with my implementation by using nqp ops directly, which let me get away with zero method or sub calls :)
kawaii Does anyone from the Star team know when they'll be tagging their official Docker images for 2019.03? 21:03
melezhik Hi. Is it possible to insert comments into regexps? 22:27
timotimo i believe so, yeah
m: say "foobar" ~~ / foo #`( this is a comment ) bar /
evalable6 「foobar」
melezhik cool, thank you! 22:28
lizmat also, simple # also works: 22:31
dd "foo" ~~ /^
f # first letter
o # second letter
o # third letter
/
timotimo i was too lazy to look for a nl symbol to copypaste 22:32
lizmat sleep&
timotimo fwiw, i might end up turning that bluetooth keyboard into a full keyboard of shortcuts for stuff
could have a load of symbols on there as well
though i'll have to memorize what is where, since the keys don't have displays on them for some unfathomable reason
like, surely you can get like a hundred little oled screens into a thirty bucks bluetooth device without making it much more expensive, right? :P 22:33