»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:00 cdg joined 00:04 cdg left, perlpilot_ left 00:07 sena_kun left 00:14 Deejizzel joined 00:15 llfourn left 00:17 comborico1611 left 00:18 comborico1611 joined 00:21 cdg joined 00:22 robinsmidsrod joined 00:26 cdg left 00:33 rindolf left 00:37 Deejizzel left 00:39 llfourn joined 00:45 nadim left
comborico1611 Quiet night. 00:49
00:54 aborazmeh joined, aborazmeh left, aborazmeh joined 00:57 patrickz_ joined 00:59 evalable6 left, evalable6 joined, ChanServ sets mode: +v evalable6 01:00 patrickz left 01:05 mniip left 01:14 ctilmes joined 01:15 char_var[buffer] joined 01:24 rgrau left 01:29 nadim joined 01:30 lookatme joined 01:32 ctilmes left, ctilmes joined 01:36 wamba left 01:43 poohman joined, Cabanossi left 01:44 mniip joined 01:45 Cabanossi joined 01:46 wander joined 01:47 comborico1611 left
wander .tell moritz I'm reading your post on perl6advent by Chrome, where code blocks display not so well, the worst thing is `grammar` looks like `arammar` 01:48
yoleaux wander: I'll pass your message to moritz.
01:50 nadim left 01:51 poohman left
wander .tell moritz it looks like style on <code>, padding is too large 01:52
yoleaux wander: I'll pass your message to moritz.
wander go to lesson&
01:52 wander left 01:53 aborazmeh left 01:55 margeas left 02:01 cdg joined 02:04 kitsunenokenja left 02:06 cdg left 02:16 cdg joined 02:20 cdg left 02:27 Cabanossi left
lookatme m: my method f($name) { f."$name"(); }; f(1, "say"); 02:27
camelia Too few positionals passed; expected 2 arguments but got 0
in method f at <tmp> line 1
in method f at <tmp> line 1
in block <unit> at <tmp> line 1
lookatme m: my method f($name) { self."$name"(); }; f(1, "say");
camelia 1
02:30 Cabanossi joined
lookatme m: my method f(|c) { say c; }; f(1, "say"); 02:31
camelia \("say")
02:33 kitsunenokenja joined 02:35 mson left 02:37 cpup joined 02:42 cdg joined 02:45 ilbot3 left 02:47 cdg left 02:48 mcmillhj joined 02:49 zakharyas joined 02:54 cdg joined 02:57 ilbot3 joined, ChanServ sets mode: +v ilbot3 03:00 kitsunenokenja left 03:09 pilne left 03:15 ctilmes left 03:18 llfourn left 03:20 R0b0t1` joined 03:21 ctilmes joined 03:27 ctilmes left 03:28 Cabanossi left 03:30 Cabanossi joined 03:35 poohman joined 03:41 zakharyas left 03:44 mcmillhj left 03:47 dj_goku joined 04:01 eliasr left 04:12 Cabanossi left 04:13 Cabanossi joined
piojo @timotimo Is there any way I can define how a class should be serialized by JSON::Fast? 04:20
Or a way for me to make its attributes serialized as attribute-name/value so it becomes a JSON hash? 04:21
I can do it by hand if it's just one instance, but that solution won't work in nested structures. 04:22
04:23 poohman left 04:39 poohman joined 04:40 mcmillhj joined 04:43 cdg left 04:45 mcmillhj left 04:55 mcmillhj joined 04:58 Cabanossi left 04:59 Cabanossi joined 05:00 mcmillhj left 05:05 wander joined 05:08 poohman left 05:09 poohman joined, poohman left, poohman joined 05:11 mcmillhj joined
lookatme piojo, I think JSON::Fast not support object serialized. Maybe you can pay attention to JSON::Class 05:14
05:16 mcmillhj left 05:24 jeffythedragonsl joined 05:27 mcmillhj joined 05:28 releasable6 left 05:29 titsuki_ joined, jeffythedragonsl left 05:32 mcmillhj left 05:34 greppable6 left 05:42 Cabanossi left 05:43 mcmillhj joined, Cabanossi joined 05:48 mcmillhj left 05:54 poohman left 05:59 mcmillhj joined 06:03 mcmillhj left 06:04 releasable6 joined, greppable6 joined, kupopo left 06:05 squashable6 joined, ChanServ sets mode: +v squashable6 06:15 mcmillhj joined
piojo lookatme: thanks, that looks like exactly what I need 06:17
06:19 khw left, mcmillhj left 06:27 khisanth_ joined 06:29 BinGOs joined 06:30 rurban joined 06:31 mcmillhj joined
piojo Though it seems to not work very well with top-level builtin types like list/hash 06:31
It's too much risk to use this library... if I ever need to deserialize an array/dictionary, JSON::Class is trouble 06:33
I guess that's why it's called "JSON::Class"--only for classes
06:35 mcmillhj left 06:39 pdcawley left 06:43 cdg joined 06:48 cdg left 06:56 rurban left, mcmillhj joined 07:01 darutoko joined, mcmillhj left 07:06 schneider- joined 07:07 steve left 07:18 domidumont joined 07:21 |oLa| joined 07:22 domidumont left 07:23 domidumont joined 07:27 geospeck joined 07:28 wamba joined 07:34 thou joined 07:35 reportable6 left, reportable6 joined, ChanServ sets mode: +v reportable6, abraxxa joined
thou I'm trying to get `unit class X::Y::Z;` and `sub MAIN()` to work together; it works with a "top-level" class (`unit class X;`), but gives «Could not find symbol '&Z'» with the "multi-level" class name. Test case: pastebin.com/9JkxqSMc 07:38
I presume there's some scoping thing I don't know about. BTW the reason I want this is that `perl6 --doc=Foo lib/Pod/To/Foo.pm` fails with «P6M Merging GLOBAL symbols failed: duplicate definition of symbol Foo» 07:40
Anyone have an idea on how to fix pastebin.com/9JkxqSMc? 07:41
AlexDaniel eval: pastebin.com/raw/9JkxqSMc 07:42
evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
(exit code 1) Could not find symbol '&Z'
in sub MAIN at /tmp/jZcaLMbBz6 line 1
in block <unit> at /tmp/jZcaLMbBz6 line 5
lookatme That code is in one file ? 07:43
07:44 |oLa| left
thou ::('X::Y::Z').wut(); 07:45
^ That works
lookatme no idea 07:46
thou eval: gist.github.com/softmoth/87fc37887...25d2559597 07:47
evalable6 thou, It looks like a URL, but mime type is ‘text/html; charset=utf-8’ while I was expecting something with ‘text/plain’ or ‘perl’ in it. I can only understand raw links, sorry. 07:48
thou eval: gist.githubusercontent.com/softmot...e1/main.p6
evalable6 thou, Successfully fetched the code from the provided URL.
hi
thou thanks for looking! 07:53
moritz \o 07:54
yoleaux 01:48Z <wander> moritz: I'm reading your post on perl6advent by Chrome, where code blocks display not so well, the worst thing is `grammar` looks like `arammar`
01:52Z <wander> moritz: it looks like style on <code>, padding is too large
moritz wander: thanks, I've changed <pre><code>...</code></pre> to just <pre>...</pre>. Hope it's better now!
08:09 lowbro joined, lowbro left, lowbro joined 08:25 lizmat joined, pdcawley joined 08:26 lizmat left 08:30 llfourn joined 08:44 pdcawley left 08:48 someuser joined 08:50 someuser_ joined
anop most used MVC web framework in perl6 ? 08:51
08:53 geospeck left
moritz Dancer, I think 08:53
anop in perl6 ?
moritz erm, Bailador, sorry
El_Che he :)
anop but Bailador is not a MVC 08:54
moritz language confusion
anop but Bailador is not a MVC web framework
moritz modules.perl6.org/search/?q=mvc seems you don't have too many choices :-) 08:55
if you really want MVC
jast in my experience most MVC web applications do MVC wrong anyway :} 08:56
lookatme rgc 08:59
sorry
09:01 lizmat joined
moritz jast: I don't know if I've ever seen MVC done right :-) 09:01
09:10 lookatme left 09:11 dakkar joined 09:14 sena_kun joined
wander moritz: so it is. ("[15:55] <moritz> wander: ...I've changed <pre><code>...</code></pre> to just <pre>...</pre>...") 09:16
09:17 pdcawley joined 09:18 parv joined 09:34 dakkar_ joined 09:38 dakkar left, rindolf joined 09:40 silug left 09:44 cdg joined, thou left
dogbert2 hmm, is there a problem with irclog.perlgeek.de ? 09:46
09:48 cdg left 09:50 geospeck joined
dogbert2 moritz: ^^^ 09:51
09:56 ntinos joined
lizmat moritz: fwiw, seems to be unresponsive for me as well 09:57
09:58 TEttinger left
moritz it had a few of these hangups in the past months :( 10:00
10:03 konsolebox left 10:04 parv left
lizmat moritz: after several minutes I got an internal server error 10:06
10:07 geospeck left
jast wouldn't happen to be an AMD-based server, would it? 10:08
10:09 konsolebox joined 10:10 parv joined
moritz jast: yes 10:13
10:13 ntinos left
moritz lizmat: it's back now 10:14
jast I've had that same issue for years, for me it's a hiccup in the AHCI chipset/driver (SB600 chipset, possibly others)
lizmat moritz: indeed :-)
jast the sata link occasionally freezes (complete with sata/ahci diagnostics message in kernel log)
moritz jast: it's not the server, just the webserver 10:15
and it's fine after a restart
jast oh well
I have that, too :) worked around it by running a responsiveness check in cron that automatically cycles the webserver 10:16
moritz I wouldn't want to do that without any protection against constant restarts 10:17
dogbert2 moritz++ 10:18
El_Che moritz: you could use a variation of the silent-cron in your book :)
moritz El_Che: that could work, yes :-) 10:20
10:34 astj left 10:35 astj joined 10:39 astj left 10:40 lizmat left 10:45 astj joined 10:46 pmurias joined 10:51 eliasr joined 10:52 astj left
Geth ecosystem: 0175dc7928 | (Alexey Melezhik)++ (committed using GitHub Web editor) | META.list
Sparky distrubution via CPAN
10:57
10:58 wamba left 11:03 parv left 11:10 ctilmes joined, araraloren joined
araraloren Hi 11:10
Some exception thrown by rakudo when I use `trace` : ideone.com/dQEV95 11:11
eval: ideone.com/dQEV95 11:15
evalable6 araraloren, It looks like a URL, but mime type is ‘text/html; charset=UTF-8’ while I was expecting something with ‘text/plain’ or ‘perl’ in it. I can only understand raw links, sorry.
wander %()
araraloren
also `;` after define %field-table 11:16
araraloren: gist.github.com/W4anD0eR96/44f7e64...27f87d1a54 11:17
araraloren eval: gist.githubusercontent.com/araralo...tfile1.txt
evalable6 araraloren, Successfully fetched the code from the provided URL.
(exit code 1) 2 (/tmp/7lGFGule4I line 6)
my %field-table = %{
'标题' …
araraloren, Full output: gist.github.com/8f32c59ed5afbd5e31...53d3dbfdf1
araraloren wander, %{} also works
wander . 11:18
araraloren eval: gist.githubusercontent.com/araralo...tfile1.txt
evalable6 araraloren, Successfully fetched the code from the provided URL.
2 (/tmp/0vGEgNzcx5 line 6)
my %field-table = %(
'标题' => …
araraloren, Full output: gist.github.com/d34b3d72519ce7b9b2...bdb0d2736c
wander not to me
araraloren m: my %h = %{'a' => 2, 'b' => 3 }; say %h 11:19
camelia {a => 2, b => 3}
araraloren see, it works ok
m: my %h = %('a' => 2, 'b' => 3 ); say %h
camelia {a => 2, b => 3}
wander weird, it also works to me, without `use trace` 11:20
araraloren without `use trace`, everything will be ok, yeah
That's what I want show u 11:21
11:23 margeas joined 11:29 itaipu joined 11:30 astj joined 11:34 astj left 11:35 dakkar_ is now known as dakkar 11:43 Cabanossi left 11:44 Cabanossi joined 11:59 astj joined 12:00 astj left, astj joined 12:09 Phlogistique joined
buggable New CPAN upload: Sparky-0.0.22.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/....22.tar.gz 12:13
Phlogistique Hi 12:15
(1,2,3)[0...*-0] == (1,2,3)[0..*-2]
I don't understand why the difference between .. and ... is 2 and not 1 in this example
what keyword should I look for in the docs to understand?
(i.e. what's the name of "..", and what's the name of "*-0"?) 12:16
12:16 wamba joined
hahainternet range and whatever star, iirc 12:16
moritz Phlogistique: .. is the range operator
DrForr .. is the range operator, and '*' of '*-0' is Whatever.
moritz and... right
wander m: say 0...*-0 12:17
camelia (0 1)
12:18 itaipu left
Phlogistique Ok, so what I was looking for is (1,2,3)[0..^*] 12:18
moritz m: say (1, 2, 3).head(*-1) 12:19
camelia (1 2)
moritz more readable, IMHO
Phlogistique ok, so "*-1" is just "whatever minus one" 12:20
moritz right
Phlogistique and the only difference between .. and ... is laziness?
moritz and in the case of lists, "whatever" usually means the number of elements
no, you can use the ... operator for all kinds of fancy stuff
m: say 1, 2, 4, 8 ... 1024
camelia (1 2 4 8 16 32 64 128 256 512 1024)
moritz m: say (1, 1, *+* ... *).head(20) 12:21
camelia (1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765)
moritz it's called the series operator
wander Phlogistique: .. produces Range while ... produces Seq
Phlogistique ok
wander moritz: say 0, 1, 2...*-1
moritz: say 0, 1, 2...*-0
m: say 0, 1, 2...*-0 12:22
camelia (0 1)
wander m: say 0, 1, 2...*-1
camelia (0)
wander moritz: looks no normal
though the code itself is weird
Phlogistique ok, and the precedence of .. is not the same as ...
so (1,2,4,8..1024) produces a list which 4th element is 8..1024 12:23
moritz wander: looks fine to me, as soon as you understand that series stops if the right-hand side evaluates to a true value
Phlogistique: right
wander what is rhs in this case? 12:24
moritz righ-hand side
erm, sorry 12:25
*-1
or *-0
moritz a bit distracted
docs.perl6.org/language/operators#infix_...
the docs search is a bit broken 12:26
Phlogistique is a variable set by the perl6 repl for the last result?
moritz I'd expect it to come up with that link when I enter ... in the search field
Phlogistique (similar to ruby "_")
moritz Phlogistique: I don't think so
Phlogistique thanks
ok, sorry for abusing your patience, one more question: what does that mean when the REPL prints "( ... )" 12:27
wander moritz: thanks, so the right-hand side is a guard :) 12:28
hahainternet Phlogistique: you're probably printing a lazy sequence 12:29
Phlogistique hahainternet: thanks
ok, and I can slice it to see the contents 12:30
thanks :)
hahainternet Phlogistique: before then, the contents didn't exist, so you're actually generating them
moritz Phlogistique: no need to apologize. This channel is the right place to ask such question. 12:31
Phlogistique thanks all for your help
hahainternet hf :)
jast some nice posts on the advent calendar so far 12:33
hahainternet it's annoying that europeans have a v hard time getting on the leaderboard
wander +1
hahainternet have to be up at like 4-5am 12:34
DrForr What leaderboard?...
hahainternet oh sorry, i misread, the advent of code one :)
there are some nice perl6 posts there too
El_Che hahainternet: we have nou trouble with leatherhosen, though
jast lederhosen! 12:35
El_Che jawuhl, give me 5 sec
Phlogistique :) I'm taking the advent of code as an opportunity to learn Perl6
hahainternet i used it last year to experiment with some features, but i didn't have the time to keep it up 12:36
this year i'm intent on doing so
Phlogistique (No Perl5 background so the doc is a little hard to follow for me)
(But it's good that there is a "Perl6 from Ruby" document)
jast I've written a tiny thing in Perl 6 but don't really have enough time to get cracking on a "small" project :) 12:37
hahainternet jast: AoC perfect then, as it's just a pair of challenges per day that people complete in literal minutes 12:39
Phlogistique well, yesterday's challenge took me rather long 12:40
hahainternet part 1 in it was quite easy, you could solve it just on paper, but part 2 was a bit tricky
took me nearly an hour to do #2, embarrassingly
jast I prefer learning on things with practical applications 12:41
12:41 Cabanossi left 12:43 wamba left 12:44 Cabanossi joined, cdg joined 12:49 cdg left 12:51 Util joined 12:52 lizmat joined 12:53 itaipu joined 12:56 mingdao joined 13:03 geospeck joined 13:05 lowbro left 13:06 lowbro joined, lowbro left, lowbro joined 13:17 scovit joined 13:32 wander left, wander joined
wander what's the difference between `let` and `temp`? 13:33
docs.perl6.org/routine/temp
docs.perl6.org/routine/let
moritz let restores the old value if the scop was left unsuceessfully 13:34
wander m: my $a = 42; { let $a = 60 }; say $a 13:36
camelia 60
wander m: my $a = 42; { temp $a = 60 }; say $a
camelia 42
wander m: my $a = 42; { my $a = 60 }; say $a
camelia 42
moritz m: my $a = 42; sub f() { let $a = 60; fail("foo") }; my $dummy = f(); say $a
camelia 42
moritz m: my $a = 42; sub f() { temp $a = 60; fail("foo") }; my $dummy = f(); say $a 13:37
camelia 42
wander m: my $a = 42; { temp $a; say $a }; say $a
camelia 42
42
wander m: my $a = 42; { let $a; say $a }; say $a 13:38
camelia 42
42
moritz kinda surprised by the outcomes of his own examples
13:38 natrys joined
perlpilot what's the surprising part? 13:39
13:40 geospeck left
perlpilot m: my $a = 42; try { let $a = 60; say $a; }; say $a 13:41
camelia 60
60
perlpilot m: my $a = 42; try { let $a = 60; say $a; fail; }; say $a
camelia 60
42
13:42 dzove855 joined, mcmillhj joined 13:50 cdg joined
perlpilot moritz: btw, the sentence in your advent post and in the book "If instead you give in to the temptation of writing down a whole grammar from top to bottom, you can spend many hours debugging why some seemingly simple thing such as an extra space makes the parse fail." probably bears repeating or highlighting or emphasis of some kind. It still happens to me occasionally where I think "oh, this is a simple grammar, I'll just write the whole thing" and 13:51
it takes a strongish act of will to NOT do that because it invariably leads to pain and suffering.
13:52 cdg left
jast or... you could simply never make any mistakes ;) 13:52
13:52 cdg joined
jast I'm still working on that bit 13:52
perlpilot jast: It is a worthy goal to not make mistakes, but a better strategy involves planning for the mistakes you are likely to make and learning how to recover from mistakes in general. :-) 13:54
moritz perlpilot: I'm glad it resonated with you :-) 13:55
I'm a afraid it's a bit too late to add highlighting to the book, because it's being printed right now :-) 13:56
perlpilot second edition then :)
in fact, I'd say parsing or not parsing whitespace is probably the biggest source of consternation when making a grammar. 13:57
(or any ubiquitous but invisible characters) 13:58
moritz I don't have enough data to claim that myself, but it's certainly in the top 3
13:58 geospeck joined 14:00 pdcawley left
moritz it certainly felt as if I could have made the book twice as thick 14:01
though that would have taken another year 14:02
perlpilot so ... second edition? ;)
moritz *and* I would have liked to fix :dba(...) in rakudo, and implemented :: and/or ::: in regexes, *and* high-water mark built in to rakudo, and ... 14:03
perlpilot: I won't commit to anything right now ;)
timotimo moritz: "if you parse a mathematical expression, an operator can be an arbitrary expression inside a pair of parentheses" - operator sounds strange here 14:12
moritz timotimo: fixed. Should be "a term can be an ..." 14:13
I fixed it for the book, but forgot to check it back into my source repo
timotimo the next sentence also sounds strange; "this is a ... structure, or more precisely a ... parser" 14:15
bbl
moritz meh, I should've open-sourced the whole book, waited for three months of proof-reading, and then sent it for publishing :-) 14:16
lizmat
.oO( a book is a bit like a programming language )
14:17
moritz it's full of bugs? :-)
lizmat and never finished :-)
moritz and a PITA to write
... and doesn't pay off financially 14:18
the list could go on :-)
14:18 geospeck left 14:21 pdcawley joined
lizmat see? see? :-) 14:21
14:22 ctilmes left 14:26 pdcawley left 14:42 mcmillhj left 14:53 mcmillhj joined 14:55 schneider- left 14:57 Cabanossi left 14:58 Cabanossi joined
pmurias why do we even have <:ascii>? 15:00
jast moritz: I think proofreading only ever reaches maximum efficiency after printing has started :) 15:02
pmurias it doesn't seem to be an unicode property name :/
buggable New CPAN upload: Sparrowdo-0.0.36.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/....36.tar.gz 15:03
15:10 silug joined 15:11 comborico1611 joined
pmurias ahh, ascii is just matching the ASCII block 15:12
15:24 wander left 15:25 araraloren left
timotimo easier to remember than <[\0..\127]> 15:25
15:26 srandon111_ joined 15:29 khw joined
srandon111_ guys is perl6 used by some companies nowadays ? 15:33
also is it fast compared to other high level languages such as python/ruby ? 15:34
moritz srandon111_: I know it's used in some internal tooling in some companies
nothing public facing that I'm aware of yet
mspo it's fast for some stuff in some cases ;)
moritz mostly it's not so fast yet :(
15:35 mson joined
timotimo it's slower than ruby or python, but at unlike those two it can run stuff with multiple threads properly 15:38
jast if you're using ruby or python clearly you don't care about speed in the first place ;o)
15:39 itaipu left
[Coke] . 15:40
15:42 geospeck joined, geospeck left
tadzik well, some things aren't fast, but are Fast Enough :) 15:42
15:43 pmurias left
tadzik and for some intents and purposes, Perl 6 will be one of these things 15:43
but as much as we like to dodge that topic, it's still quite a bit slower than python/ruby in general, in my experience :/
jast yeah, that's pretty much what I wanted to hint at
Voldenet Is there any good way to make the $_ in map mutable? 15:44
jast I'm testing on an ARMv7 system to maximize the experience
Voldenet m: say map { my ($x, $y) = ("", $_); repeat { $x = ($y % 2 ?? "1" !! "0") ~ $x } while ($y div= 2) > 0; $x }, 1..10 15:45
camelia (1 10 11 100 101 110 111 1000 1001 1010)
Voldenet I wish $_ was mutable in this case, would make things more readable
15:47 Pilu joined, Pilu_ joined
Voldenet srandon111_: perl6 is used in some companies, they don't even know it, but I'm taking care of it ;) 15:49
15:49 mcmillhj left
srandon111_ Voldenet: sorry ? 15:49
what do you mean
?
jast m: say (1..10)>>.base(2)
camelia (1 10 11 100 101 110 111 1000 1001 1010)
Pilu does anybody use perl6 for something serious? I mean what are its advantages over other esoteric languages such as lisp, haskell, prolog (excepting its infamous regex)?
Voldenet ninja scripting
15:49 pmurias joined
jast that's more readable, I think ;) 15:49
15:50 mcmillhj joined
mspo Pilu: I think perl6 is Larry Wall's vision after too much haskell 15:50
[Coke] I regularly use p6 here at $DAYJOB for the concurrency support.
jast by definition none of those are esoteric languages
they're just... less popular :)
Voldenet jast: I know, but I wanted a non-immutable "map" for this 15:51
mspo jast: prolog is probably getting there
Voldenet srandon111_: basically, you can use perl6 whenever you need to write some processing tool - one would write it in python or something that company uses for such tools, but I find it a lot easier to write a lot of them in perl6 15:52
jast to me personally, the nice thing about Perl 6 is that it takes the spirit of previous Perls (making easy things easy and hard things possible) and takes it much, much further
15:52 geospeck joined
Voldenet the thing I like about perl6 is brevity, for example all the *f* operators family 15:54
lizmat jast: wish there were more of you
srandon111_ Voldenet: what are *f* operators ?
Voldenet all the flipflops
lizmat a lot of people entrenched in Perl 5 do not take that view :-)
jast I haven't quite wrapped my head around the flipflop operators yet. I mean, I know their definition, but that doesn't translate into reading or writing them easily yet. :) 15:55
pmurias Pilu: lisp/haskell/prolog are all vastly different and have different strengths and weaknesses
Voldenet for example lisp's strength is pretending to not have a syntax at all 15:56
pmurias lizmat: isn't most of the Perl 5 opposition to the implementation/effect on Perl 5 rather than the language itself
Voldenet: it's also it's biggest weakness ;)
jast lizmat: well, there are plenty of annoying limitations in Perl 5. personally I'm a fan of the "batteries included" mindset. I don't appreciate combining modules in a project and suddenly having three different implementations of object orientiation in my list of dependencies...
that doesn't mean there shouldn't be plenty of options to customize behaviour, of course. Perl 6 checks both boxes, it doesn't get better than that 15:57
srandon111_ jast: well it comes down to personal preference at some point
jast of course
Voldenet I'm sure though, that perl6 code is bound to be a lot shorter than perl5 code 15:58
since perl 5 doesn't really do much in terms of threading, error handling, oop and even some simple array/hash operations, one is condemned to write everything from scratch 16:01
Pilu pmurias: so it's all about regex, isn't it? 16:02
jast regex is Perl 5 standard fare
timotimo m: my @a = 1..10; @a.map({ $_ = 9 }); say @a
camelia [9 9 9 9 9 9 9 9 9 9]
timotimo Voldenet: it's mutable, but only if what you're mapping over has containers
jast in Perl 6 you have grammars, the likes of which very few languages have built in
16:02 troys joined
timotimo mapping over 1..10 gives you a list, which is immutable. and container-less by default 16:02
Voldenet smacks his head 16:03
of course, thanks
timotimo YW :)
m: my @a = 1..10; for @a <-> $_ { $_ = 9 }; say @a
camelia [9 9 9 9 9 9 9 9 9 9]
timotimo m: my @a = 1..10; for @a { $_ = 9 }; say @a
camelia [9 9 9 9 9 9 9 9 9 9]
timotimo ^ also works
Voldenet m: say map { $_ *= 2 }, (1..10).Array 16:04
camelia (2 4 6 8 10 12 14 16 18 20)
16:06 virtualsue joined
lizmat m: say map -> $_ is copy { $_ *= 2 }, 1..10 # Voldenet: yet another way 16:06
camelia (2 4 6 8 10 12 14 16 18 20)
lizmat on large ranges this is probably easier on memory as it won't need to create the array 16:07
Pilu what is the best programming book you've ever read? do you have any recommendation? My one is still SICP ... I still think lisps have something special
Voldenet hm, I wouldn't really use map over large ranges though, for seems like a better choice 16:08
16:08 ChoHag left
timotimo if you map over a range you can consume the result lazily in the next step 16:09
m: say (map -> $_ is copy { say "processing $_"; $_ * 2 }, 1..10000)[^10];
camelia processing 1
processing 2
processing 3
processing 4
processing 5
processing 6
processing 7
processing 8
processing 9
processing 10
(2 4 6 8 10 12 14 16 18 20)
Voldenet I guess they all have their uses, the last way would be more suitable to db-like approach, for example where you need to operate on large sorted sets 16:11
srandon111_ Voldenet: also will perl6 fix some of the problems of perl5 ? 16:13
Voldenet srandon111_: It already have fixed threading
srandon111_ Voldenet: nice... the fact is that perl5 is nice but lacks modules for data science/machine learning/statistics/big data 16:14
PDL is not comparable to numpy for example
16:16 virtualsue left 16:20 Pilu_ left, Pilu left 16:23 geospeck left, luiz_lha joined, geospeck joined 16:24 luiz_lha is now known as Guest44465 16:26 Guest44465 is now known as luiz_lha, ctilmes joined 16:27 Cabanossi left 16:28 Cabanossi joined 16:29 domidumont left
scovit srandon111_: I think that numpy is not comparable with matlab 16:30
Voldenet scovit: matlab is extremely unreadable 16:32
scovit nah, is just a language like the others. It is not the syntax his strength 16:33
Voldenet I believe "nargin" to be extremely unreadable, and it's _basics_ 16:34
also, things like `size(M, 2)` 16:35
scovit Voldenet may I just agree with you that it sucks but still think that it is much better than numpy for the specific purpose? 16:37
16:37 srandon111_ left
Voldenet Uh, some its features are great, but not the language itself. 16:38
scovit ye
16:48 lowbro left 16:56 Ven`` joined, abraxxa left 17:00 troys left
pmurias Voldenet: isn't familiarity a huge part of readability? 17:12
Voldenet it is, that's why most programming languages just use english
"arguments.length" in js still feels hacky, but it's easy to remember 17:13
17:15 itaipu joined
Voldenet and I doubt familiarity is a huge part of readability, it has a fair share of it, but even without using python much I can say it's made for readability 17:23
17:23 Ven`` left
Voldenet while some languages (haskell, I'm looking at you) did have elegance in mind, without minding the readability at all 17:23
mspo which haskell? :) 17:24
Voldenet (;
mspo the sugary version?
Voldenet a regular GHC version, not sure which one is it 17:26
timotimo i find the "readability" of python doesn't hold up; being so wordy can make things super difficult to understand, because you drown in a thousand words 17:27
17:30 ChoHag joined, sftp joined
pmurias Voldenet: readability by people who don't know the language and those who do are two different things 17:30
timotimo i was using python for like 6 years at the point i got annoyed 17:31
moritz python has this weird mixture of a powerful and concise slice syntax, and then very verbose syntax for other stuff 17:35
like ternary operator
Voldenet I didn't know python had ternary operator 17:36
17:36 domidumont joined
moritz x = "foo" if condition else "bar" 17:36
17:37 domidumont left
moritz x = (condition and "foo") or "bar 17:37
(doens't work for false "foo")
17:37 domidumont joined, dakkar left
Voldenet huh, I thought it'd have something that looks like an actual ternary operator 17:38
also, I'm not sure how readability by people who don't and do know the language differs, it's not a switch, it looks more fluid 17:43
from "I've never seen anything like it" to "I've programmed in the language that looked exactly like it for 5 years" ;P
17:45 mson left
Voldenet so for the people that programmed in C-like languages functional languages might seem odd and vice versa 17:48
17:48 DickClarke joined 17:49 robertle left, luiz_lha left
Voldenet I have no idea, but I'm interested in researches on the topic, I'll better hide before people smack me for being ignorant... 17:50
Phlogistique did the "user-defined array indexing" described here design.perl6.org/S09.html#User-def...y_indexing actually land? 17:55
p6: my int @ints{-1...1} 17:57
camelia 5===SORRY!5=== Error while compiling <tmp>
The {} shape syntax with the @ sigil is reserved
at <tmp>:1
------> 3my int @ints{-1...17⏏5}
expecting any of:
statement end
statement modifier
statement mo…
17:59 virtualsue joined, sena_kun left 18:01 ChoHag left
Phlogistique what is the idiom for element-wise addition in Perl6? 18:08
ilmari m: say (1,2,3) Z+ (4,5,6) 18:09
camelia (5 7 9)
ilmari that's the Z metoperator applied to +
it can be applied to any infix operator
Phlogistique thanks ilmari
18:10 mson joined
ilmari docs.perl6.org/routine/Z 18:10
18:13 hankache joined
timotimo heyo Phlogistique 18:20
are you the one i know from the lojban community?
[Coke] crap, my initial thought for an advent article isn't panning out; good thing i have a few weeks left. :)
Phlogistique timotimo: yes :)
timotimo: nice to see you there!
will you be at CCC?
timotimo potentially 18:21
Phlogistique nice! We should catch up there
18:24 raiph joined
Phlogistique Is there a broadcasting equivalent to Z ? 18:25
timotimo what si broadcast?
Phlogistique [1,2,3,4] BROADCASTING-Z [foo,bar] would be [[1 foo][2 bar][3 foo][4 bar]]
it's called "broadcasting" in the context of numeric computing 18:26
timotimo oh, yeah, the hyperoperators do tthat
m: say [1, 2, 3, 4] >>,>> [<foo bar>];
camelia [(1 foo) (2 bar) (3 foo) (4 bar)]
timotimo you point them at the side that you'd like to expand
if you point both sides inwards to the operator it'll complain if the arrays aren't the same size 18:27
Phlogistique ok!
18:28 kyan joined
Phlogistique so the Matlab "broadcasting" + would be "<<+>>" 18:29
hankache hello #perl6
Phlogistique which looks nice, and I can choose when I want broadcasting
18:30 darutoko left
timotimo <<+>> will repeat the shorter list until the longer list is exhausted, i believe 18:31
m: say <1 2 3 4 5> <<,>> [<a b>]
camelia ((1 a) (2 b) (3 a) (4 b) (5 a))
Phlogistique hm, it's not really the same thing as multi-dimensional broadcasting
m: say [[1,2],[3,4]] <<+>> [1,2]
camelia [[2 3] [5 6]]
Phlogistique m: say [[1,2],[3,4]] <<+>> [[1],[2]]
camelia [[2 3] [5 6]]
Phlogistique alright 18:32
18:33 virtualsue left
comborico1611 Hello, Hank 18:33
18:33 rmusial joined
hankache hello comborico1611 18:36
18:42 Cabanossi left 18:44 Cabanossi joined
Phlogistique can I specify the shape of my list arguments? 18:46
i.e sub foo(@bar[2]) {...}
moritz m: sub foo(@bar[2]) {... 18:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub foo(@bar[2]) {...7⏏5<EOL>
expecting any of:
statement end
statement modifier
statement modifier loop
Phlogistique m: sub foo(@bar[2]) { say @bar } 18:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@bar' is not declared
at <tmp>:1
------> 3sub foo(@bar[2]) { say 7⏏5@bar }
19:00 virtualsue joined
[Coke] ponders refactoring the doc tests so they could be loaded as modules in a single test file that could then use rakudo concurrency to run -all- the tests instead of only in a single test. 19:00
Voldenet Phlogistique: if you only want to constrain them, then I think you can, not sure if there's an easier syntax 19:02
m: use Test; sub a (*@x where { @_.elems == 2 }) { }; my (@n2, @n3) = ([1,2], [1,2,3]); dies-ok { a(@n3); }; lives-ok { a(@n2) } 19:03
camelia ok 1 -
ok 2 -
19:03 rgrau joined
Voldenet actually 19:03
m: use Test; sub a (@x where { .elems == 2 }) { }; my (@n2, @n3) = ([1,2], [1,2,3]); dies-ok { a(@n3); }; lives-ok { a(@n2) }
camelia ok 1 -
ok 2 -
El_Che m: sub foo(@bar where @bar.elems == 2) { say @bar }; say foo((1,2)); say foo((1,2,3)) 19:05
camelia (1 2)
Constraint type check failed in binding to parameter '@bar'; expected anonymous constraint to be met but got List ($(1, 2, 3))
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1

True
El_Che m: sub foo(@bar where @bar.elems == 2) { say @bar }; say foo((1,2))
camelia (1 2)
True
El_Che m: sub foo(@bar where @bar.elems == 2) { say @bar }; say foo((1,2,3)) 19:06
camelia Constraint type check failed in binding to parameter '@bar'; expected anonymous constraint to be met but got List ($(1, 2, 3))
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
19:10 cdg left
Voldenet m: use Test; sub a (*@x where .elems == 3) { }; dies-ok { a(1, 2); }; lives-ok { a(1, 2, 3) } 19:12
camelia ok 1 -
ok 2 -
19:14 virtualsue left
comborico1611 Does anyone know how to keep the stupid YouTube mobile app playlist to the bottom, instead of it going back to the top, requiring you to scroll all the way back to the bottom? 19:18
Phlogistique Voldenet: thanks! 19:20
19:20 xcm left 19:22 xcm joined
Phlogistique m: my @a[1,2,3]; say @a.shape 19:22
camelia (1 2 3)
Phlogistique m: say Array.new(:shape(1,2,3)).shape 19:23
camelia (1 2 3)
Phlogistique m: my @a = Array.new(:shape(1,2,3)); say @a.shape
camelia (*)
Phlogistique Why? :(
timotimo because you're doing array assignment 19:24
that iterates over the array on the right and puts the stuff into the array on the left
what you want there is binding instead of assignment :)
Phlogistique oh. ok.
timotimo the advent blog post from yesterday explains that in nice detail
Phlogistique thanks timotimo 19:26
another why:
m: say [1], [[1]], [[1],]
camelia [1][1][[1]]
timotimo "single-argument rule"; most things iterate over things if they get passed a single thing
Phlogistique ok 19:27
timotimo m: say [<foo bar baz>] # it's how you get an array of strings with the < > syntax rather than just a list
camelia [foo bar baz]
Phlogistique thanks again :)
timotimo m: for (1, 2, 3), (4) { say "oh my, $_" }
camelia oh my, 1 2 3
oh my, 4
19:27 mcmillhj left
timotimo m: for (1, 2, 3) { say "oh my, $_" } 19:27
camelia oh my, 1
oh my, 2
oh my, 3
19:27 Cabanossi left 19:28 virtualsue joined 19:29 Cabanossi joined, mcmillhj joined
Phlogistique Partially dimensioned views of shaped arrays not yet implemented. Sorry. <- :(( 19:36
19:36 unicodable6 left, unicodable6 joined, bisectable6 left, committable6 left, bisectable6 joined, committable6 joined
timotimo yes :( 19:36
perlpilot That would be an excellent grant proposal for someone: Give Perl 6 a little PDL-love 19:38
19:39 virtualsue left
DrForr I've got a nascent OpenCV thing... 19:39
19:40 domidumont left 19:47 hankache left, hankache_ joined 19:54 comborico1611 left 19:56 comborico1611 joined 19:58 virtualsue joined 20:05 comborico1611 left 20:07 comborico1611 joined, rgrau left
[Coke] wonders if we should consider targetting wasm 20:07
20:09 virtualsue left 20:18 ChoHag joined
El_Che [Coke]: don't tease us :) 20:21
20:25 troys joined 20:26 ChoHag left 20:32 benchable6 left 20:33 benchable6 joined, ChanServ sets mode: +v benchable6 20:35 hankache_ left 20:36 patrickz_ is now known as patrickz 20:41 pmurias left 20:42 Cabanossi left 20:44 Cabanossi joined
hahainternet is it possible to take a reference to a method? I remember this being possible in some form because dispatch is unified between them 20:47
but i can't remember the specifics
TimToady m: say Int.^lookup('abs').WHAT 20:50
camelia (Method)
TimToady m: say Int.^lookup('abs')(-42) 20:51
camelia 42
20:51 timo joined
TimToady m: say Int.can('abs')[0](-42) 20:51
camelia 42
El_Che explosive
20:51 timo is now known as timotimo
AlexDaniel hahainternet: see also: docs.perl6.org/routine/lookup (note how it mentions find_method) 20:58
hahainternet AlexDaniel: cheers :) sorry i missed your reply TimToady 20:59
teatime huggable: hug someone. 21:03
huggable hugs someone.
teatime huggable: hug someone else.
huggable hugs someone else.
DickClarke thank you :3
teatime huggable: what's on top of a house? who was the greatest baseball player ever to live?
huggable teatime, nothing found
AlexDaniel teatime: you better ask ZofBot on #perl6-dev channel :) 21:04
21:12 ctilmes left
DickClarke teatime: babe ruth 21:17
hahainternet what's the most succinct way to grep a list for defined items? 21:20
(specifically, not Anys)
timotimo grep(*.defined) 21:21
hahainternet thought as much, cheers :)
21:21 natrys left
perlpilot hahainternet: golfing? 21:23
hahainternet perlpilot: sorta 21:31
21:41 Cabanossi left 21:43 Cabanossi joined
hahainternet a question in that vein, is there a nice list of when you can use funcname: args instead of funcname(args)? I expected it to work using the ==> operator, but alas it does not appear to 21:46
21:49 kitsunenokenja joined
perlpilot hahainternet: show the code; it's probably a precedence problem. 21:51
hahainternet perlpilot: oh it's been refactored since then, i just wondered if there were some docs on it i could bookmark
or a formal name, i think i've probably asked this before :)
21:55 cdg joined 21:59 mcmillhj left, cdg left 22:05 mson left 22:07 cdg joined 22:08 geospeck left 22:13 TreyHarris left 22:20 AndChat|688961 joined, comborico1611 left 22:26 TreyHarris joined 22:33 AndChat|688961 left, comborico1611 joined
AlexDaniel hahainternet: I think the question was about methods? 22:46
hahainternet AlexDaniel: sorry?
AlexDaniel hahainternet: any “.method: args” will work, for subroutines you just write “sub args”
hahainternet AlexDaniel: sorry it was more when you are permitted to use the colon form 22:47
AlexDaniel hahainternet: you can use it with any method
if I got the question right
hahainternet AlexDaniel: right, i think i was using the bare grep with ==> so that'd be why
as it does the implicit passing of the subject or topic or whatever self is :p 22:48
comborico1611 Apache written in Perl6. 22:49
22:52 dogbert17 joined
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/12/04/...ieventing/ 22:57
22:58 TEttinger joined
hahainternet i felt the HN response to day 1 was overly harsh 22:58
i hope to see another article posted in a week or so, mindshare is important
comborico1611 Thanks, lizmat!
hahainternet yes, gj lizmat 22:59
23:07 pat_js joined
AlexDaniel lizmat++ 23:12
23:22 kyan left, mcmillhj joined 23:23 kitsunenokenja left 23:27 Cabanossi left 23:29 Cabanossi joined 23:39 troys is now known as troys_, cdg_ joined 23:42 cdg left
timotimo can someone build that sonnet slang from the hackernews thread? 23:50
23:54 Voldenet left 23:58 cdg_ left, cdg joined