Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-12-04

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 cdg joined #perl6
00:14 Deejizzel joined #perl6
00:18 comborico1611 joined #perl6
00:21 cdg joined #perl6
00:22 robinsmidsrod joined #perl6
00:39 llfourn joined #perl6
00:49 comborico1611 Quiet night.
00:54 aborazmeh joined #perl6
00:54 aborazmeh joined #perl6
00:57 patrickz_ joined #perl6
00:59 evalable6 joined #perl6
01:14 ctilmes joined #perl6
01:15 char_var[buffer] joined #perl6
01:29 nadim joined #perl6
01:30 lookatme joined #perl6
01:32 ctilmes left #perl6
01:32 ctilmes joined #perl6
01:43 poohman joined #perl6
01:44 mniip joined #perl6
01:45 Cabanossi joined #perl6
01:46 wander joined #perl6
01:48 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:52 wander .tell moritz it looks like style on <code>, padding is too large
01:52 yoleaux wander: I'll pass your message to moritz.
01:52 * wander go to lesson&
02:01 cdg joined #perl6
02:16 cdg joined #perl6
02:27 lookatme m: my method f($name) { f."$name"(); }; f(1, "say");
02:27 camelia rakudo-moar c9699ab2c: OUTPUT: «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␤␤»
02:27 lookatme m: my method f($name) { self."$name"(); }; f(1, "say");
02:27 camelia rakudo-moar c9699ab2c: OUTPUT: «1␤»
02:30 Cabanossi joined #perl6
02:31 lookatme m: my method f(|c) { say c; }; f(1, "say");
02:31 camelia rakudo-moar c9699ab2c: OUTPUT: «\("say")␤»
02:33 kitsunenokenja joined #perl6
02:37 cpup joined #perl6
02:56 cdg joined #perl6
02:57 ilbot3 joined #perl6
02:57 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:20 R0b0t1` joined #perl6
03:21 ctilmes joined #perl6
03:30 Cabanossi joined #perl6
03:35 poohman joined #perl6
03:47 dj_goku joined #perl6
04:13 Cabanossi joined #perl6
04:20 piojo @timotimo Is there any way I can define how a class should be serialized by JSON::Fast?
04:21 piojo Or a way for me to make its attributes serialized as attribute-name/value so it becomes a JSON hash?
04:22 piojo I can do it by hand if it's just one instance, but that solution won't work in nested structures.
04:39 poohman joined #perl6
04:40 mcmillhj joined #perl6
04:55 mcmillhj joined #perl6
04:59 Cabanossi joined #perl6
05:05 wander joined #perl6
05:09 poohman joined #perl6
05:09 poohman joined #perl6
05:11 mcmillhj joined #perl6
05:14 lookatme piojo, I think JSON::Fast not support object serialized. Maybe you can pay attention to JSON::Class
05:24 jeffythedragonsl joined #perl6
05:27 mcmillhj joined #perl6
05:29 titsuki_ joined #perl6
05:43 mcmillhj joined #perl6
05:43 Cabanossi joined #perl6
05:59 mcmillhj joined #perl6
06:04 releasable6 joined #perl6
06:04 greppable6 joined #perl6
06:05 squashable6 joined #perl6
06:15 mcmillhj joined #perl6
06:17 piojo lookatme: thanks, that looks like exactly what I need
06:27 khisanth_ joined #perl6
06:29 BinGOs joined #perl6
06:30 rurban joined #perl6
06:31 mcmillhj joined #perl6
06:31 piojo Though it seems to not work very well with top-level builtin types like list/hash
06:33 piojo It's too much risk to use this library... if I ever need to deserialize an array/dictionary, JSON::Class is trouble
06:33 piojo I guess that's why it's called "JSON::Class"--only for classes
06:43 cdg joined #perl6
06:56 mcmillhj joined #perl6
07:01 darutoko joined #perl6
07:06 schneider- joined #perl6
07:18 domidumont joined #perl6
07:21 |oLa| joined #perl6
07:23 domidumont joined #perl6
07:27 geospeck joined #perl6
07:28 wamba joined #perl6
07:34 thou joined #perl6
07:35 reportable6 joined #perl6
07:35 abraxxa joined #perl6
07:38 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:  https://pastebin.com/9JkxqSMc
07:40 thou 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:41 thou Anyone have an idea on how to fix https://pastebin.com/9JkxqSMc?
07:42 AlexDaniel eval: https://pastebin.com/raw/9JkxqSMc
07:42 evalable6 AlexDaniel, Successfully fetched the code from the provided URL.
07:42 evalable6 AlexDaniel, rakudo-moar c9699ab2c: OUTPUT: «(exit code 1) Could not find symbol '&Z'␤  in sub MAIN at /tmp/jZcaLMbBz6 line 1␤  in block <unit> at /tmp/jZcaLMbBz6 line 5␤␤»
07:43 lookatme That code is in one file ?
07:44 |oLa| left #perl6
07:45 thou ::('X::Y::Z').wut();
07:45 thou ^ That works
07:46 lookatme no idea
07:47 thou eval: https://gist.github.com/softmoth/87fc3788745c77b0ccdc1c25d2559597
07:48 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: https://gist.githubusercontent.com/softmoth/87fc3788745c77b0ccdc1c25d2559597/raw/12d33d5e8dd0da0ce0d9be93c14aae6c10373be1/main.p6
07:48 evalable6 thou, Successfully fetched the code from the provided URL.
07:48 evalable6 thou, rakudo-moar c9699ab2c: OUTPUT: «hi␤»
07:53 thou thanks for looking!
07:54 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`
07:54 yoleaux 01:52Z <wander> moritz: it looks like style on <code>, padding is too large
07:54 moritz wander: thanks, I've changed <pre><code>...</code></pre> to just <pre>...</pre>. Hope it's better now!
08:09 lowbro joined #perl6
08:09 lowbro joined #perl6
08:25 lizmat joined #perl6
08:25 pdcawley joined #perl6
08:30 llfourn joined #perl6
08:48 someuser joined #perl6
08:50 someuser_ joined #perl6
08:51 anop most used MVC web framework in perl6 ?
08:53 moritz Dancer, I think
08:53 anop in perl6 ?
08:53 moritz erm, Bailador, sorry
08:53 El_Che he :)
08:54 anop but Bailador is not a MVC
08:54 moritz language confusion
08:54 anop but Bailador is not a MVC web framework
08:55 moritz http://modules.perl6.org/search/?q=mvc seems you don't have too many choices :-)
08:55 moritz if you really want MVC
08:56 jast in my experience most MVC web applications do MVC wrong anyway :}
08:59 lookatme rgc
08:59 lookatme sorry
09:01 lizmat joined #perl6
09:01 moritz jast: I don't know if I've ever seen MVC done right :-)
09:11 dakkar joined #perl6
09:14 sena_kun joined #perl6
09:16 wander moritz: so it is. ("[15:55] <moritz> wander: ...I've changed <pre><code>...</code></pre> to just <pre>...</pre>...")
09:17 pdcawley joined #perl6
09:18 parv joined #perl6
09:34 dakkar_ joined #perl6
09:38 rindolf joined #perl6
09:44 cdg joined #perl6
09:46 dogbert2 hmm, is there a problem with irclog.perlgeek.de ?
09:50 geospeck joined #perl6
09:51 dogbert2 moritz: ^^^
09:56 ntinos joined #perl6
09:57 lizmat moritz: fwiw, seems to be unresponsive for me as well
10:00 moritz it had a few of these hangups in the past months :(
10:06 lizmat moritz: after several minutes I got an internal server error
10:08 jast wouldn't happen to be an AMD-based server, would it?
10:09 konsolebox joined #perl6
10:10 parv joined #perl6
10:13 moritz jast: yes
10:14 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)
10:14 lizmat moritz: indeed  :-)
10:14 jast the sata link occasionally freezes (complete with sata/ahci diagnostics message in kernel log)
10:15 moritz jast: it's not the server, just the webserver
10:15 moritz and it's fine after a restart
10:15 jast oh well
10:16 jast I have that, too :) worked around it by running a responsiveness check in cron that automatically cycles the webserver
10:17 moritz I wouldn't want to do that without any protection against constant restarts
10:18 dogbert2 moritz++
10:18 El_Che moritz: you could use a variation of the silent-cron in your book :)
10:20 moritz El_Che: that could work, yes :-)
10:35 astj joined #perl6
10:45 astj joined #perl6
10:46 pmurias joined #perl6
10:51 eliasr joined #perl6
10:57 Geth ¦ ecosystem: 0175dc7928 | (Alexey Melezhik)++ (committed using GitHub Web editor) | META.list
10:57 Geth ¦ ecosystem: Sparky distrubution via CPAN
10:57 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/0175dc7928
11:10 ctilmes joined #perl6
11:10 araraloren joined #perl6
11:10 araraloren Hi
11:11 araraloren Some exception thrown by rakudo when I use `trace` : https://ideone.com/dQEV95
11:15 araraloren eval: https://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.
11:15 wander %()
11:15 wander araraloren
11:16 wander also `;` after define %field-table
11:17 wander araraloren: https://gist.github.com/W4anD0eR96/44f7e64d98daac9f1a0e2d27f87d1a54
11:17 araraloren eval: https://gist.githubusercontent.com/araraloren/9e088472525b6d369204db20d3d8c9ba/raw/b91abf9745dfcfad1221077f584c5f9beadf62ad/gistfile1.txt
11:17 evalable6 araraloren, Successfully fetched the code from the provided URL.
11:17 evalable6 araraloren, rakudo-moar 76158136f: OUTPUT: «(exit code 1) 2 (/tmp/7lGFGule4I line 6)␤my %field-table = %{␤                '标题'    …»
11:17 evalable6 araraloren, Full output: https://gist.github.com/8f32c59ed5afbd5e31628853d3dbfdf1
11:17 araraloren wander, %{} also works
11:18 wander .
11:18 araraloren eval: https://gist.githubusercontent.com/araraloren/9e088472525b6d369204db20d3d8c9ba/raw/ca269a3088d5b0b6621287ebb184a567bc93b932/gistfile1.txt
11:18 evalable6 araraloren, Successfully fetched the code from the provided URL.
11:18 evalable6 araraloren, rakudo-moar 76158136f: OUTPUT: «2 (/tmp/0vGEgNzcx5 line 6)␤my %field-table = %(␤                '标题'               => …»
11:18 evalable6 araraloren, Full output: https://gist.github.com/d34b3d72519ce7b9b2cd1ebdb0d2736c
11:18 wander not to me
11:19 araraloren m: my %h = %{'a' => 2, 'b' => 3 }; say %h
11:19 camelia rakudo-moar 76158136f: OUTPUT: «{a => 2, b => 3}␤»
11:19 araraloren see, it works ok
11:19 araraloren m: my %h = %('a' => 2, 'b' => 3 ); say %h
11:19 camelia rakudo-moar 76158136f: OUTPUT: «{a => 2, b => 3}␤»
11:20 wander weird, it also works to me, without `use trace`
11:20 araraloren without `use trace`, everything will be ok, yeah
11:21 araraloren That's what I want show u
11:23 margeas joined #perl6
11:29 itaipu joined #perl6
11:30 astj joined #perl6
11:44 Cabanossi joined #perl6
11:59 astj joined #perl6
12:00 astj joined #perl6
12:09 Phlogistique joined #perl6
12:13 buggable New CPAN upload: Sparky-0.0.22.tar.gz by MELEZHIK https://cpan.metacpan.org/authors/id/M/ME/MELEZHIK/Perl6/Sparky-0.0.22.tar.gz
12:15 Phlogistique Hi
12:15 Phlogistique (1,2,3)[0...*-0] == (1,2,3)[0..*-2]
12:15 Phlogistique I don't understand why the difference between .. and ... is 2 and not 1 in this example
12:15 Phlogistique what keyword should I look for in the docs to understand?
12:16 Phlogistique (i.e. what's the name of "..", and what's the name of "*-0"?)
12:16 wamba joined #perl6
12:16 hahainternet range and whatever star, iirc
12:16 moritz Phlogistique: .. is the range operator
12:16 DrForr .. is the range operator, and '*' of '*-0' is Whatever.
12:16 moritz and... right
12:17 wander m: say 0...*-0
12:17 camelia rakudo-moar 76158136f: OUTPUT: «(0 1)␤»
12:18 Phlogistique Ok, so what I was looking for is (1,2,3)[0..^*]
12:19 moritz m: say (1, 2, 3).head(*-1)
12:19 camelia rakudo-moar 76158136f: OUTPUT: «(1 2)␤»
12:19 moritz more readable, IMHO
12:20 Phlogistique ok, so "*-1" is just "whatever minus one"
12:20 moritz right
12:20 Phlogistique and the only difference between .. and ... is laziness?
12:20 moritz and in the case of lists, "whatever" usually means the number of elements
12:20 moritz no, you can use the ... operator for all kinds of fancy stuff
12:20 moritz m: say 1, 2, 4, 8 ... 1024
12:20 camelia rakudo-moar 76158136f: OUTPUT: «(1 2 4 8 16 32 64 128 256 512 1024)␤»
12:21 moritz m: say (1, 1, *+* ... *).head(20)
12:21 camelia rakudo-moar 76158136f: OUTPUT: «(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765)␤»
12:21 moritz it's called the series operator
12:21 wander Phlogistique: .. produces Range while ... produces Seq
12:21 Phlogistique ok
12:21 wander moritz: say 0, 1, 2...*-1
12:21 wander moritz: say 0, 1, 2...*-0
12:22 wander m: say 0, 1, 2...*-0
12:22 camelia rakudo-moar 76158136f: OUTPUT: «(0 1)␤»
12:22 wander m: say 0, 1, 2...*-1
12:22 camelia rakudo-moar 76158136f: OUTPUT: «(0)␤»
12:22 wander moritz: looks no normal
12:22 wander though the code itself is weird
12:22 Phlogistique ok, and the precedence of .. is not the same as ...
12:23 Phlogistique 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
12:23 moritz Phlogistique: right
12:24 wander what is rhs in this case?
12:24 moritz righ-hand side
12:25 moritz erm, sorry
12:25 moritz *-1
12:25 moritz or *-0
12:25 * moritz a bit distracted
12:25 moritz https://docs.perl6.org/language/operators#infix_...
12:26 moritz the docs search is a bit broken
12:26 Phlogistique is a variable set by the perl6 repl for the last result?
12:26 moritz I'd expect it to come up with that link when I enter ... in the search field
12:26 Phlogistique (similar to ruby "_")
12:26 moritz Phlogistique: I don't think so
12:26 Phlogistique thanks
12:27 Phlogistique ok, sorry for abusing your patience, one more question: what does that mean when the REPL prints "( ... )"
12:28 wander moritz: thanks, so the right-hand side is a guard :)
12:29 hahainternet Phlogistique: you're probably printing a lazy sequence
12:29 Phlogistique hahainternet: thanks
12:30 Phlogistique ok, and I can slice it to see the contents
12:30 Phlogistique thanks :)
12:30 hahainternet Phlogistique: before then, the contents didn't exist, so you're actually generating them
12:31 moritz Phlogistique: no need to apologize. This channel is the right place to ask such question.
12:31 Phlogistique thanks all for your help
12:31 hahainternet hf :)
12:33 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
12:33 * wander +1
12:34 hahainternet have to be up at like 4-5am
12:34 DrForr What leaderboard?...
12:34 hahainternet oh sorry, i misread, the advent of code one :)
12:34 hahainternet there are some nice perl6 posts there too
12:34 El_Che hahainternet: we have nou trouble with leatherhosen, though
12:35 jast lederhosen!
12:35 El_Che jawuhl, give me 5 sec
12:35 Phlogistique :) I'm taking the advent of code as an opportunity to learn Perl6
12:36 hahainternet i used it last year to experiment with some features, but i didn't have the time to keep it up
12:36 hahainternet this year i'm intent on doing so
12:36 Phlogistique (No Perl5 background so the doc is a little hard to follow for me)
12:36 Phlogistique (But it's good that there is a "Perl6 from Ruby" document)
12:37 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:39 hahainternet jast: AoC perfect then, as it's just a pair of challenges per day that people complete in literal minutes
12:40 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
12:40 hahainternet took me nearly an hour to do #2, embarrassingly
12:41 jast I prefer learning on things with practical applications
12:44 Cabanossi joined #perl6
12:44 cdg joined #perl6
12:51 Util joined #perl6
12:52 lizmat joined #perl6
12:53 itaipu joined #perl6
12:56 mingdao joined #perl6
13:03 geospeck joined #perl6
13:06 lowbro joined #perl6
13:06 lowbro joined #perl6
13:17 scovit joined #perl6
13:32 wander joined #perl6
13:33 wander what's the difference between `let` and `temp`?
13:33 wander https://docs.perl6.org/routine/temp
13:33 wander https://docs.perl6.org/routine/let
13:34 moritz let restores the old value if the scop was left unsuceessfully
13:36 wander m: my $a = 42; { let $a = 60 }; say $a
13:36 camelia rakudo-moar 76158136f: OUTPUT: «60␤»
13:36 wander m: my $a = 42; { temp $a = 60 }; say $a
13:36 camelia rakudo-moar 76158136f: OUTPUT: «42␤»
13:36 wander m:  my $a = 42; { my $a = 60 }; say $a
13:36 camelia rakudo-moar 76158136f: OUTPUT: «42␤»
13:36 moritz m: my $a = 42; sub f() { let $a = 60; fail("foo") }; my $dummy =  f(); say $a
13:36 camelia rakudo-moar 76158136f: OUTPUT: «42␤»
13:37 moritz m: my $a = 42; sub f() { temp $a = 60; fail("foo") }; my $dummy =  f(); say $a
13:37 camelia rakudo-moar 76158136f: OUTPUT: «42␤»
13:37 wander m: my $a = 42; { temp $a; say $a }; say $a
13:37 camelia rakudo-moar 76158136f: OUTPUT: «42␤42␤»
13:38 wander m: my $a = 42; { let $a; say $a }; say $a
13:38 camelia rakudo-moar 76158136f: OUTPUT: «42␤42␤»
13:38 * moritz kinda surprised by the outcomes of his own examples
13:38 natrys joined #perl6
13:39 perlpilot what's the surprising part?
13:41 perlpilot m: my $a = 42; try { let $a = 60; say $a; }; say $a
13:41 camelia rakudo-moar 76158136f: OUTPUT: «60␤60␤»
13:41 perlpilot m: my $a = 42; try { let $a = 60; say $a; fail; }; say $a
13:41 camelia rakudo-moar 76158136f: OUTPUT: «60␤42␤»
13:42 dzove855 joined #perl6
13:42 mcmillhj joined #perl6
13:50 cdg joined #perl6
13:51 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 perlpilot it takes a strongish act of will to NOT do that because it invariably leads to pain and suffering.
13:52 jast or... you could simply never make any mistakes ;)
13:52 cdg joined #perl6
13:52 jast I'm still working on that bit
13:54 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:55 moritz perlpilot: I'm glad it resonated with you :-)
13:56 moritz 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  :)
13:57 perlpilot in fact, I'd say parsing or not parsing whitespace is probably the biggest source of consternation when making a grammar.
13:58 perlpilot (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 #perl6
14:01 moritz it certainly felt as if I could have made the book twice as thick
14:02 moritz though that would have taken another year
14:02 perlpilot so ... second edition?  ;)
14:03 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 moritz perlpilot: I won't commit to anything right now ;)
14:12 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:13 moritz timotimo: fixed. Should be "a term can be an ..."
14:13 moritz I fixed it for the book, but forgot to check it back into my source repo
14:15 timotimo the next sentence also sounds strange; "this is a ... structure, or more precisely a ... parser"
14:15 timotimo bbl
14:16 moritz meh, I should've open-sourced the whole book, waited for three months of proof-reading, and then sent it for publishing :-)
14:17 lizmat .oO( a book is a bit like a programming language )
14:17 moritz it's full of bugs? :-)
14:17 lizmat and never finished :-)
14:17 moritz and a PITA to write
14:18 moritz ... and doesn't pay off financially
14:18 moritz the list could go on :-)
14:21 pdcawley joined #perl6
14:21 lizmat see?  see?  :-)
14:53 mcmillhj joined #perl6
14:55 schneider- left #perl6
14:58 Cabanossi joined #perl6
15:00 pmurias why do we even have  <:ascii>?
15:02 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 :/
15:03 buggable New CPAN upload: Sparrowdo-0.0.36.tar.gz by MELEZHIK https://cpan.metacpan.org/authors/id/M/ME/MELEZHIK/Perl6/Sparrowdo-0.0.36.tar.gz
15:10 silug joined #perl6
15:11 comborico1611 joined #perl6
15:12 pmurias ahh, ascii is just matching the ASCII block
15:25 timotimo easier to remember than <[\0..\127]>
15:26 srandon111_ joined #perl6
15:29 khw joined #perl6
15:33 srandon111_ guys is perl6 used by some companies nowadays  ?
15:34 srandon111_ 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
15:34 moritz nothing public facing that I'm aware of yet
15:34 mspo it's fast for some stuff in some cases ;)
15:34 moritz mostly it's not so fast yet :(
15:35 mson joined #perl6
15:38 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:40 [Coke] .
15:42 geospeck joined #perl6
15:42 tadzik well, some things aren't fast, but are Fast Enough :)
15:43 tadzik and for some intents and purposes, Perl 6 will be one of these things
15:43 tadzik 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 :/
15:43 jast yeah, that's pretty much what I wanted to hint at
15:44 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
15:45 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 rakudo-moar 76158136f: OUTPUT: «(1 10 11 100 101 110 111 1000 1001 1010)␤»
15:45 Voldenet I wish $_ was mutable in this case, would make things more readable
15:47 Pilu joined #perl6
15:47 Pilu_ joined #perl6
15:49 Voldenet srandon111_: perl6 is used in some companies, they don't even know it, but I'm taking care of it ;)
15:49 srandon111_ Voldenet: sorry  ?
15:49 srandon111_ what do you mean
15:49 srandon111_ ?
15:49 jast m: say (1..10)>>.base(2)
15:49 camelia rakudo-moar 76158136f: OUTPUT: «(1 10 11 100 101 110 111 1000 1001 1010)␤»
15:49 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)?
15:49 Voldenet ninja scripting
15:49 pmurias joined #perl6
15:49 jast that's more readable, I think ;)
15:50 mcmillhj joined #perl6
15:50 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.
15:50 jast by definition none of those are esoteric languages
15:50 jast they're just... less popular :)
15:51 Voldenet jast: I know, but I wanted a non-immutable "map" for this
15:51 mspo jast: prolog is probably getting there
15:52 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 #perl6
15:54 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
15:54 srandon111_ Voldenet: what are *f* operators ?
15:54 Voldenet all the flipflops
15:54 lizmat a lot of people entrenched in Perl 5 do not take that view  :-)
15:55 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
15:56 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
15:56 pmurias Voldenet: it's also it's biggest weakness ;)
15:56 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...
15:57 jast 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
15:57 jast of course
15:58 Voldenet I'm sure though, that perl6 code is bound to be a lot shorter than perl5 code
16:01 Voldenet 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:02 Pilu pmurias: so it's all about regex, isn't it?
16:02 jast regex is Perl 5 standard fare
16:02 timotimo m: my @a = 1..10; @a.map({ $_ = 9 }); say @a
16:02 camelia rakudo-moar 752299767: OUTPUT: «[9 9 9 9 9 9 9 9 9 9]␤»
16:02 timotimo Voldenet: it's mutable, but only if what you're mapping over has containers
16:02 jast in Perl 6 you have grammars, the likes of which very few languages have built in
16:02 troys joined #perl6
16:02 timotimo mapping over 1..10 gives you a list, which is immutable. and container-less by default
16:03 * Voldenet smacks his head
16:03 Voldenet of course, thanks
16:03 timotimo YW :)
16:03 timotimo m: my @a = 1..10; for @a <-> $_ { $_ = 9 }; say @a
16:03 camelia rakudo-moar 752299767: OUTPUT: «[9 9 9 9 9 9 9 9 9 9]␤»
16:03 timotimo m: my @a = 1..10; for @a { $_ = 9 }; say @a
16:03 camelia rakudo-moar 752299767: OUTPUT: «[9 9 9 9 9 9 9 9 9 9]␤»
16:03 timotimo ^ also works
16:04 Voldenet m: say map { $_ *= 2 }, (1..10).Array
16:04 camelia rakudo-moar 752299767: OUTPUT: «(2 4 6 8 10 12 14 16 18 20)␤»
16:06 virtualsue joined #perl6
16:06 lizmat m: say map -> $_ is copy { $_ *= 2 }, 1..10   # Voldenet: yet another way
16:06 camelia rakudo-moar 752299767: OUTPUT: «(2 4 6 8 10 12 14 16 18 20)␤»
16:07 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
16:08 Voldenet hm, I wouldn't really use map over large ranges though, for seems like a better choice
16:09 timotimo if you map over a range you can consume the result lazily in the next step
16:09 timotimo m: say (map -> $_ is copy { say "processing $_"; $_ * 2 }, 1..10000)[^10];
16:09 camelia rakudo-moar 752299767: OUTPUT: «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)␤»
16:11 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:13 srandon111_ Voldenet: also will perl6 fix some of the problems of perl5  ?
16:13 Voldenet srandon111_: It already have fixed threading
16:14 srandon111_ Voldenet: nice... the fact is that perl5 is nice but lacks modules for data science/machine learning/statistics/big data
16:14 srandon111_ PDL is not comparable to numpy for example
16:23 luiz_lha joined #perl6
16:23 geospeck joined #perl6
16:26 ctilmes joined #perl6
16:28 Cabanossi joined #perl6
16:30 scovit srandon111_: I think that numpy is not comparable with matlab
16:32 Voldenet scovit: matlab is extremely unreadable
16:33 scovit nah, is just a language like the others. It is not the syntax his strength
16:34 Voldenet I believe "nargin" to be extremely unreadable, and it's _basics_
16:35 Voldenet also, things like `size(M, 2)`
16:37 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:38 Voldenet Uh, some its features are great, but not the language itself.
16:38 scovit ye
16:56 Ven`` joined #perl6
17:12 pmurias Voldenet: isn't familiarity a huge part of readability?
17:12 Voldenet it is, that's why most programming languages just use english
17:13 Voldenet "arguments.length" in js still feels hacky, but it's easy to remember
17:15 itaipu joined #perl6
17:23 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 Voldenet while some languages (haskell, I'm looking at you) did have elegance in mind, without minding the readability at all
17:24 mspo which haskell? :)
17:24 Voldenet (;
17:24 mspo the sugary version?
17:26 Voldenet a regular GHC version, not sure which one is it
17:27 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:30 ChoHag joined #perl6
17:30 sftp joined #perl6
17:30 pmurias Voldenet: readability by people who don't know the language and those who do are two different things
17:31 timotimo i was using python for like 6 years at the point i got annoyed
17:35 moritz python has this weird mixture of a powerful and concise slice syntax, and then very verbose syntax for other stuff
17:35 moritz like ternary operator
17:36 Voldenet I didn't know python had ternary operator
17:36 domidumont joined #perl6
17:36 moritz x = "foo" if condition else "bar"
17:37 moritz x = (condition and "foo") or "bar
17:37 moritz (doens't work for false "foo")
17:37 domidumont joined #perl6
17:38 Voldenet huh, I thought it'd have something that looks like an actual ternary operator
17:43 Voldenet 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 Voldenet 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:48 Voldenet so for the people that programmed in C-like languages functional languages might seem odd and vice versa
17:48 DickClarke joined #perl6
17:50 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:55 Phlogistique did the "user-defined array indexing" described here https://design.perl6.org/S09.html#User-defined_array_indexing actually land?
17:57 Phlogistique p6: my int @ints{-1...1}
17:57 camelia rakudo-moar 752299767: OUTPUT: «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 #perl6
18:08 Phlogistique what is the idiom for element-wise addition in Perl6?
18:09 ilmari m: say (1,2,3) Z+ (4,5,6)
18:09 camelia rakudo-moar 752299767: OUTPUT: «(5 7 9)␤»
18:09 ilmari that's the Z metoperator applied to +
18:09 ilmari it can be applied to any infix operator
18:09 Phlogistique thanks ilmari
18:10 mson joined #perl6
18:10 ilmari https://docs.perl6.org/routine/Z
18:13 hankache joined #perl6
18:20 timotimo heyo Phlogistique
18:20 timotimo are you the one i know from the lojban community?
18:20 [Coke] crap, my initial thought for an advent article isn't panning out; good thing i have a few weeks left. :)
18:20 Phlogistique timotimo: yes :)
18:20 Phlogistique timotimo: nice to see you there!
18:20 Phlogistique will you be at CCC?
18:21 timotimo potentially
18:21 Phlogistique nice! We should catch up there
18:24 raiph joined #perl6
18:25 Phlogistique Is there a broadcasting equivalent to Z ?
18:25 timotimo what si broadcast?
18:25 Phlogistique [1,2,3,4] BROADCASTING-Z [foo,bar]    would be   [[1 foo][2 bar][3 foo][4 bar]]
18:26 Phlogistique it's called "broadcasting" in the context of numeric computing
18:26 timotimo oh, yeah, the hyperoperators do tthat
18:26 timotimo m: say [1, 2, 3, 4] >>,>> [<foo bar>];
18:26 camelia rakudo-moar 752299767: OUTPUT: «[(1 foo) (2 bar) (3 foo) (4 bar)]␤»
18:26 timotimo you point them at the side that you'd like to expand
18:27 timotimo 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 #perl6
18:29 Phlogistique so the Matlab "broadcasting" + would be "<<+>>"
18:29 hankache hello #perl6
18:29 Phlogistique which looks nice, and I can choose when I want broadcasting
18:31 timotimo <<+>> will repeat the shorter list until the longer list is exhausted, i believe
18:31 timotimo m: say <1 2 3 4 5> <<,>> [<a b>]
18:31 camelia rakudo-moar 752299767: OUTPUT: «((1 a) (2 b) (3 a) (4 b) (5 a))␤»
18:31 Phlogistique hm, it's not really the same thing as multi-dimensional broadcasting
18:31 Phlogistique m: say [[1,2],[3,4]] <<+>> [1,2]
18:31 camelia rakudo-moar 752299767: OUTPUT: «[[2 3] [5 6]]␤»
18:31 Phlogistique m: say [[1,2],[3,4]] <<+>> [[1],[2]]
18:31 camelia rakudo-moar 752299767: OUTPUT: «[[2 3] [5 6]]␤»
18:32 Phlogistique alright
18:33 comborico1611 Hello, Hank
18:33 rmusial joined #perl6
18:36 hankache hello comborico1611
18:44 Cabanossi joined #perl6
18:46 Phlogistique can I specify the shape of my list arguments?
18:46 Phlogistique i.e sub foo(@bar[2]) {...}
18:47 moritz m: sub foo(@bar[2]) {...
18:47 camelia rakudo-moar 752299767: OUTPUT: «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␤»
18:50 Phlogistique m: sub foo(@bar[2]) { say @bar }
18:50 camelia rakudo-moar 752299767: OUTPUT: «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 #perl6
19:00 * [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:02 Voldenet Phlogistique: if you only want to constrain them, then I think you can, not sure if there's an easier syntax
19:03 Voldenet 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 rakudo-moar 752299767: OUTPUT: «ok 1 - ␤ok 2 - ␤»
19:03 rgrau joined #perl6
19:03 Voldenet actually
19:03 Voldenet 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 rakudo-moar 752299767: OUTPUT: «ok 1 - ␤ok 2 - ␤»
19:05 El_Che m: sub foo(@bar where @bar.elems == 2) { say @bar }; say foo((1,2)); say foo((1,2,3))
19:05 camelia rakudo-moar 752299767: OUTPUT: «(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␤»
19:05 El_Che m: sub foo(@bar where @bar.elems == 2) { say @bar }; say foo((1,2))
19:05 camelia rakudo-moar 752299767: OUTPUT: «(1 2)␤True␤»
19:06 El_Che m: sub foo(@bar where @bar.elems == 2) { say @bar }; say foo((1,2,3))
19:06 camelia rakudo-moar 752299767: OUTPUT: «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:12 Voldenet m: use Test; sub a (*@x where .elems == 3) { }; dies-ok { a(1, 2); }; lives-ok { a(1, 2, 3) }
19:12 camelia rakudo-moar 928ada081: OUTPUT: «ok 1 - ␤ok 2 - ␤»
19:16 shadoxx left #perl6
19:18 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:20 Phlogistique Voldenet: thanks!
19:22 xcm joined #perl6
19:22 Phlogistique m: my @a[1,2,3]; say @a.shape
19:22 camelia rakudo-moar 928ada081: OUTPUT: «(1 2 3)␤»
19:23 Phlogistique m: say Array.new(:shape(1,2,3)).shape
19:23 camelia rakudo-moar 928ada081: OUTPUT: «(1 2 3)␤»
19:23 Phlogistique m: my @a = Array.new(:shape(1,2,3)); say @a.shape
19:23 camelia rakudo-moar 928ada081: OUTPUT: «(*)␤»
19:23 Phlogistique Why? :(
19:24 timotimo because you're doing array assignment
19:24 timotimo that iterates over the array on the right and puts the stuff into the array on the left
19:24 timotimo what you want there is binding instead of assignment :)
19:24 Phlogistique oh. ok.
19:24 timotimo the advent blog post from yesterday explains that in nice detail
19:26 Phlogistique thanks timotimo
19:26 Phlogistique another why:
19:26 Phlogistique m: say [1], [[1]], [[1],]
19:26 camelia rakudo-moar 928ada081: OUTPUT: «[1][1][[1]]␤»
19:26 timotimo "single-argument rule"; most things iterate over things if they get passed a single thing
19:27 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
19:27 camelia rakudo-moar 928ada081: OUTPUT: «[foo bar baz]␤»
19:27 Phlogistique thanks again :)
19:27 timotimo m: for (1, 2, 3), (4) { say "oh my, $_" }
19:27 camelia rakudo-moar 928ada081: OUTPUT: «oh my, 1 2 3␤oh my, 4␤»
19:27 timotimo m: for (1, 2, 3) { say "oh my, $_" }
19:27 camelia rakudo-moar 928ada081: OUTPUT: «oh my, 1␤oh my, 2␤oh my, 3␤»
19:28 virtualsue joined #perl6
19:29 Cabanossi joined #perl6
19:29 mcmillhj joined #perl6
19:36 Phlogistique Partially dimensioned views of shaped arrays not yet implemented. Sorry. <- :((
19:36 unicodable6 joined #perl6
19:36 bisectable6 joined #perl6
19:36 committable6 joined #perl6
19:36 timotimo yes :(
19:38 perlpilot That would be an excellent grant proposal for someone:  Give Perl 6 a little PDL-love
19:39 DrForr I've got a nascent OpenCV thing...
19:47 hankache_ joined #perl6
19:56 comborico1611 joined #perl6
19:58 virtualsue joined #perl6
20:07 comborico1611 joined #perl6
20:07 * [Coke] wonders if we should consider targetting wasm
20:18 ChoHag joined #perl6
20:21 El_Che [Coke]: don't tease us :)
20:25 troys joined #perl6
20:33 benchable6 joined #perl6
20:44 Cabanossi joined #perl6
20:47 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 hahainternet but i can't remember the specifics
20:50 TimToady m: say Int.^lookup('abs').WHAT
20:50 camelia rakudo-moar 78aeaf469: OUTPUT: «(Method)␤»
20:51 TimToady m: say Int.^lookup('abs')(-42)
20:51 camelia rakudo-moar 78aeaf469: OUTPUT: «42␤»
20:51 timo joined #perl6
20:51 TimToady m: say Int.can('abs')[0](-42)
20:51 camelia rakudo-moar 78aeaf469: OUTPUT: «42␤»
20:51 El_Che explosive
20:58 AlexDaniel hahainternet: see also: https://docs.perl6.org/routine/lookup (note how it mentions find_method)
20:59 hahainternet AlexDaniel: cheers :) sorry i missed your reply TimToady
21:03 teatime huggable: hug someone.
21:03 * huggable hugs someone.
21:03 teatime huggable: hug someone else.
21:03 * huggable hugs someone else.
21:03 DickClarke thank you :3
21:03 teatime huggable: what's on top of a house?  who was the greatest baseball player ever to live?
21:03 huggable teatime, nothing found
21:04 AlexDaniel teatime: you better ask ZofBot on #perl6-dev channel :)
21:17 DickClarke teatime: babe ruth
21:20 hahainternet what's the most succinct way to grep a list for defined items?
21:20 hahainternet (specifically, not Anys)
21:21 timotimo grep(*.defined)
21:21 hahainternet thought as much, cheers :)
21:23 perlpilot hahainternet: golfing?
21:31 hahainternet perlpilot: sorta
21:43 Cabanossi joined #perl6
21:46 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:49 kitsunenokenja joined #perl6
21:51 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
21:51 hahainternet or a formal name, i think i've probably asked this before :)
21:55 cdg joined #perl6
22:07 cdg joined #perl6
22:20 AndChat|688961 joined #perl6
22:26 TreyHarris joined #perl6
22:33 comborico1611 joined #perl6
22:46 AlexDaniel hahainternet: I think the question was about methods?
22:46 hahainternet AlexDaniel: sorry?
22:46 AlexDaniel hahainternet: any “.method: args” will work, for subroutines you just write “sub args”
22:47 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
22:47 AlexDaniel if I got the question right
22:47 hahainternet AlexDaniel: right, i think i was using the bare grep with ==> so that'd be why
22:48 hahainternet as it does the implicit passing of the subject or topic or whatever self is :p
22:49 comborico1611 Apache written in Perl6.
22:52 dogbert17 joined #perl6
22:57 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/12/04/2017-49-mischieventing/
22:58 TEttinger joined #perl6
22:58 hahainternet i felt the HN response to day 1 was overly harsh
22:58 hahainternet i hope to see another article posted in a week or so, mindshare is important
22:58 comborico1611 Thanks, lizmat!
22:59 hahainternet yes, gj lizmat
23:07 pat_js joined #perl6
23:12 AlexDaniel lizmat++
23:22 mcmillhj joined #perl6
23:29 Cabanossi joined #perl6
23:39 cdg_ joined #perl6
23:50 timotimo can someone build that sonnet slang from the hackernews thread?
23:58 cdg joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo