»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by masak on 28 November 2015. |
|||
joeschmoe2 | m: my $Link = 'www.google.com'; say $Link /msg | 00:00 | |
camelia | rakudo-moar c27a00: OUTPUT«5===SORRY!5=== Error while compiling /tmp/yA7ERKIWq6Undeclared routine: msg used at line 1. Did you mean 'msb'?» | ||
_nadim | So long, and thanks for all the fish | 00:01 | |
Zoffix | \o | ||
00:01
donaldh left
|
|||
joeschmoe2 | i suck | 00:02 | |
diakopter | m: ***=*=***=****=**=***=*=****=*=** | ||
camelia | ( no output ) | ||
joeschmoe2 | +camelia m: my $Link = 'www.google.com'; say $Link | 00:03 | |
Zoffix | joeschmoe2, /msg is an IRC command to send private messages. You use it by typing /msg NICK_TO_SEND_MESSAGE_TO MESSAGE ... and the message you'd send is the same one you're typing here in the channel | ||
/msg camelia m: say 42 | |||
^ type that exactly and it'll work :) | 00:04 | ||
diakopter, hax! | |||
nine | Something for the bikeshedding commitee: how should I call CompUnit::RepositoryRegistry's method that takes a string of the form "inst#/path/to/site" and gives you a CompUnit::Repository object? | ||
xjrK | I have a class in a .pm6 module... I want to access it in another file. use Class::Whatever should work, no? | ||
marchelzo | isn't it kind of inconsistent that 'for ((1, 2), (3, 4), (5, 6)) -> $a, $b { ... }' uses the pairs to populate $a and $b, but 'for (1, 2, 3, 4, 5, 6) -> $a, $b { ... }' uses two elements each time? | ||
Zoffix | m: for ((1, 2), (3, 4), (5, 6)) -> $a, $b { say "$a $b" } | 00:05 | |
camelia | rakudo-moar c27a00: OUTPUT«1 2 3 4Too few positionals passed; expected 2 arguments but got 1 in block <unit> at /tmp/NP1kzGr44W:1» | ||
diakopter | nine: bikeshed->woodshed | ||
Zoffix | m: for |((1, 2), (3, 4), (5, 6)) -> $a, $b { say "$a $b" } | ||
camelia | rakudo-moar c27a00: OUTPUT«1 2 3 4Too few positionals passed; expected 2 arguments but got 1 in block <unit> at /tmp/ZmQcAKx0ew:1» | ||
marchelzo | Zoffix: huh | ||
00:06
lucasb joined
|
|||
Zoffix | m: for (1, 2, 3, 4, 5, 6) -> $a, $b { say "$a $b" } | 00:06 | |
camelia | rakudo-moar c27a00: OUTPUT«1 23 45 6» | ||
Zoffix | marchelzo, seems terribly consistent to me :) | ||
joeschmoe2 | I have a new friend her name is +camelia | ||
marchelzo | this perl6advent thing is wrong then | ||
nine | diakopter: are we meta-bikeshedding now? ;) | ||
Zoffix | perhaps, is it from last year? | ||
marchelzo | from 2009 | ||
Zoffix | Ohh. | ||
marchelzo, yeah, there likely have been a billion changes since then :| | |||
nine, path-to-repo? :) | 00:07 | ||
lucasb | here, a bikeshed team member arrived :) | ||
_nadim | "you cannot create an instance of this type" ... got to love the error messages. | ||
lucasb | nine: doesn't it make sense to call it '.from-string' ? | ||
marchelzo | I was warned about that. Apparently the authors have been trying to update it for modern perl6 but there are still some things that are outdated. | ||
lucasb | *does it | ||
Zoffix | nine, or just .repo() :) Hard to say without knowing what other methods are :) | 00:08 | |
nine | lucasb, Zoffix: I guess what bothers me is that I'm reluctant to have "repo" twice in the name, yet a plain .from-string doesn't really tell you what you get | ||
Zoffix | CompUnit::RepositoryRegistry.repo('inst#/path/to/site') | ||
*shrug* | 00:09 | ||
nine | There will also be a method that gives you the 'site' or 'vendor' repo | ||
marchelzo | Zoffix: so how _would_ you loop over two lists in parrallel? flat $a Z $b? | ||
Zoffix | marchelzo, no idea. I barely know any Perl 6, sorry :) | 00:10 | |
marchelzo | Zoffix: oh, ok. no worries. | ||
lucasb | timotimo: when you wake up, see if you've put this test in the wrong place: github.com/timo/json_fast/blob/mas...ast.pm#L81 | 00:12 | |
I think where it is, it'll never fire and end the loop. | |||
nine | I think I will go with repository-for-spec (because it may just return a cached object) and repository-for-name | ||
Zoffix | lucasb, is that the probable cause of the freeze? | 00:13 | |
Zoffix is trying to debug that ATM | |||
lucasb | Zoffix: that's my hypothesis :) | 00:14 | |
00:15
TEttinger left
|
|||
marchelzo | How to interleave multiple lists together? | 00:15 | |
00:16
joeschmoe2 left
00:17
joeschmoe joined,
n0tjack joined
|
|||
nine | marchelzo: maybe [>]? | 00:17 | |
marchelzo: err [Z] | |||
marchelzo | I want (1, 2, 3) and (4, 5, 6) to become (1, 4, 2, 5, 3, 6) | 00:18 | |
so flat after [Z] would work | |||
but I was wondering if there was a shorter way | |||
lucasb | m: say <1 2 3> Z <4 5 6> | ||
camelia | rakudo-moar c27a00: OUTPUT«((1 4) (2 5) (3 6))» | ||
marchelzo | it seems like a common thing to want to do (e.g., for $list1 ??? $list2 -> $elem1, $elem2 { ... }) | 00:19 | |
joeschmoe | sorry | ||
nine | marchelzo: for <1 2 3> Z <a b c> -> ($a, $b) { ... } | 00:20 | |
marchelzo | so the parens around $a, $b are important? | ||
00:20
Sgeo__ joined
|
|||
Zoffix | m: my @l1 = 1..4; my @l2 = 5..8; for @l1 Z @l2 -> ($a, $b) { say "[$a $b]" } | 00:20 | |
camelia | rakudo-moar c27a00: OUTPUT«[1 5][2 6][3 7][4 8]» | ||
Zoffix | m: my @l1 = 1..4; my @l2 = 5..8; for @l1 Z @l2 -> $a, $b { say "[$a $b]" } | ||
camelia | rakudo-moar c27a00: OUTPUT«[1 5 2 6][3 7 4 8]» | ||
nine | yes, that makes it unpack | ||
marchelzo | nine: great, that makes sense. thanks | 00:21 | |
lucasb | another variant is: <1 2 3> Z[&slip] <4 5 6> | ||
but that looks ugly :) | |||
joeschmoe | quick question how do you do a regex search and replace as a oneliner | ||
marchelzo | m: <1 2 3> Z[&slip] <4 5 6> | ||
camelia | ( no output ) | ||
marchelzo | m: say (<1 2 3> Z[&slip] <4 5 6>).fmt | 00:22 | |
camelia | rakudo-moar c27a00: OUTPUT«1 4 2 5 3 6» | ||
joeschmoe | quick question how do you do a regex search and replace as a oneliner and print it to std out | ||
marchelzo | so.. is Z a meta-operator as well as a regular operator? | ||
Zoffix | joeschmoe, you mean in files? | ||
joeschmoe | sure or just all on the command line quoted | 00:23 | |
Zoffix | no idea | ||
Zoffix is as helpful as a brick :P | |||
00:23
cbk joined,
Axord joined
|
|||
nine | marchelzo: yes | 00:25 | |
marchelzo | what does the <1 2 3> syntax mean exactly? is it the same as (1, 2 3)? | ||
00:26
lucasb left
|
|||
nine | marchelzo: yes, <foo bar baz> is equal to ('foo', 'bar', 'baz') | 00:26 | |
Zoffix | aw | ||
lucasb left seconds before I found that their hypothesis was right :) | 00:27 | ||
00:28
z8 joined,
M-eternaleye left,
M-eternaleye joined
|
|||
_nadim | can one reach non exported sub via the package they reside in? EG A::B::C::<&foo>() | 00:30 | |
00:30
Psyche^ joined
|
|||
Zoffix | .tell timotimo Sent you a PR to fix the freezing issue. lucasb++ first found the problematic line. github.com/timo/json_fast/pull/8 | 00:30 | |
yoleaux | Zoffix: I'll pass your message to timotimo. | ||
00:31
skids joined
00:33
captain-adequate joined
|
|||
dalek | kudo/repository_registry: 10eb41b | (Stefan Seifert)++ | / (9 files): Rename CompUnitRepo to CompUnit::RepositoryRegistry Its job will be to manage the mapping of repository spec strings to repositories. |
00:34 | |
kudo/repository_registry: 75ffcdc | (Stefan Seifert)++ | src/ (4 files): Rename CompUnit::RepositoryRegistry.new to .repository-for-spec CompUnit::RepositoryRegistry is uninstantiable and the method is used only in a few places. No need to shorten the name. |
|||
00:35
TEttinger joined,
Zoffix left
|
|||
joeschmoe | im doing this wrong i just want to search and replace and then pring -e 's:g/ut/foo/'; say $_ | 00:39 | |
00:39
n0tjack left
00:40
n0tjack joined
|
|||
[Coke] | advent2013-day14.t is hanging. :| | 00:43 | |
flussence | [Coke]: that's happened to me a few times, seems to happen at random | 00:51 | |
dalek | rl6-roast-data: 71b6ae5 | coke++ | / (9 files): today (automated commit) |
||
joeschmoe | m: 'hello world' ~~ s/'hello world'/bye/; .say | 00:54 | |
camelia | rakudo-moar c27a00: OUTPUT«Cannot modify an immutable Str in block <unit> at /tmp/Ac_YQSYh1Q:1» | ||
[Coke] | it shouldn't be ble to hang that, though ^^ | ||
joeschmoe | m: 'hello world' ~~ s/hello world/bye/; .say | ||
camelia | rakudo-moar c27a00: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at /tmp/dpsKMLEkGX:1 ------> 3'hello world' ~~ s/hello7…» | ||
joeschmoe | m: 'hello world' ~~ 's/hello world/bye/'; .say | 00:55 | |
camelia | rakudo-moar c27a00: OUTPUT«(Any)» | ||
joeschmoe | m: 'hello world' ~~ :s/hello world/bye/; .say | ||
camelia | rakudo-moar c27a00: OUTPUT«5===SORRY!5=== Error while compiling /tmp/gtPAxuuZtHMissing required term after infixat /tmp/gtPAxuuZtH:1------> 3'hello world' ~~ :s/hello world/bye/7⏏5; .say expecting any of: prefix term» | ||
joeschmoe | what am i doing wrong in the search and replace | 00:56 | |
00:56
joeschmoe left
00:58
leont left
01:00
zakharyas left
|
|||
skids | m: my $a = "hello world"; $a ~~ s:s/hello world/bye/; $a.say; | 01:03 | |
camelia | rakudo-moar c27a00: OUTPUT«bye» | ||
skids | m: $_ = "hello world"; s:s/hello world/bye/; .say | ||
camelia | rakudo-moar c27a00: OUTPUT«bye» | 01:04 | |
skids | The first s is "run a substitution" and the second one is an adverb that means spaces are not ignored in the pattern. | 01:05 | |
01:10
yeahnoob joined
01:13
cdg left
01:15
cdg joined
01:20
cdg left
01:21
Zoffix joined
01:32
km3 joined
01:34
rurban left
01:36
herby_ joined
|
|||
herby_ | Evening, everyone! | 01:36 | |
marchelzo | hi herby_ | ||
herby_ | m: if "abcde" ~~ /e/ {say "Found it"} | 01:37 | |
camelia | rakudo-moar c27a00: OUTPUT«Found it» | ||
herby_ | I'm still having a problem wrapping my head around Grammars | ||
if I do: grammar Test { token TOP { c } }, then look for a match, it doesn't find anything | 01:38 | ||
Zoffix | herby_, have you seen today's Advent article? | ||
herby_ | I have :) | ||
great article | |||
Zoffix | :) | ||
k | |||
herby_ | everyone is talking about how great grammars are, i just can't seem to grasp them yet | ||
Test.parse("abcde") would not find a match | |||
Zoffix | m: grammar Test { token TOP { <c> }; token c { \d+ }; }; say Test.parse("42"); | 01:39 | |
camelia | rakudo-moar c27a00: OUTPUT«「42」 c => 「42」» | ||
herby_ | what if you did token c { 4 } | ||
so looking for a specific digit, instead of a digit | 01:40 | ||
Zoffix | m: grammar Test { token TOP { .+? 'c' .+ } }; say Test.parse("abcde"); | ||
camelia | rakudo-moar c27a00: OUTPUT«「abcde」» | ||
Zoffix | m: grammar Test { token TOP { <c> .+ }; token c { 4 }; }; say Test.parse("42"); | ||
camelia | rakudo-moar c27a00: OUTPUT«「42」 c => 「4」» | ||
herby_ | hmmm | ||
what the world | |||
Zoffix | IIUC, the grammar needs to match the whole parse string | ||
herby_ | ahhh | ||
Zoffix | m: grammar Test { token TOP { <c> }; token c { 4 }; }; say Test.parse("42"); | ||
camelia | rakudo-moar c27a00: OUTPUT«Nil» | ||
herby_ | thats what I discovered | ||
the fact that I need to know the structure of the whole string | 01:41 | ||
Zoffix | so this fails, because there's no match rule for the "2" | ||
herby_ | ok, i just wanted to make sure I wasn't missing a concept | ||
flussence | wait, does that do an implicit ^ and $ ? | 01:42 | |
01:42
julien_ joined,
julien_ left
|
|||
herby_ | m: grammar Test { token TOP { <c> }; token c { 4 } ; }; say Test.parse("24"); | 01:43 | |
camelia | rakudo-moar c27a00: OUTPUT«Nil» | ||
01:44
cdg joined
|
|||
Zoffix | Don't know if it's an implicit ^ and $, but, I'd think "parse" would mean to "interpret the string"... and if part of it doesn't make sense to the grammar, it's fair for it to fail | 01:44 | |
marchelzo | Zoffix: you mean there is a perl6 advent for this year as well? | ||
Zoffix | marchelzo, yeah: perl6advent.wordpress.com/ | ||
marchelzo | Zoffix: ah, I'm looking at the 2009 one right now. Have they done one every year since then? | 01:45 | |
Zoffix | *shrug* probably | ||
marchelzo | I've got a lot of reading to do then | ||
Zoffix | :) | ||
m: grammar Test { token TOP { <c>+ }; token c { \d } ; }; say Test.parse("24"); | 01:46 | ||
camelia | rakudo-moar c27a00: OUTPUT«「24」 c => 「2」 c => 「4」» | ||
01:46
lustlife joined
|
|||
Zoffix | Grammars are so nice. | 01:46 | |
herby_ | :) | ||
I'm trying to rewrite a simple server log parser (currently written in Perl 5) using Grammars | |||
but the format of each line might change slightly, depending what activity occured | |||
so it seems like with Grammars, I don't want to use them unless I know exactly what the string will look like? | 01:47 | ||
or am I oversimplifying it | |||
I'm thinking I'm oversimplifying it | 01:48 | ||
01:48
cdg left
|
|||
geekosaur | depends on whether you can characterize what you are looking at. log lines tend to have a well defined prefix and a reasonably well defined end (timestamp, newline respectively are common) | 01:49 | |
you might capture the rest and pass it to another grammar which tries to match various kinds of log messages | |||
herby_ | yeah. there are mainly two types of string entries for this. one entry shows the user logging into the server with workstation info etc | 01:50 | |
and the other type of line will be user activity | |||
I'll try and plan for both | 01:51 | ||
geekosaur | but remember that at the bottom is just regexes so it can handle quite a lot; you do need to be able to discern one of those types from the other, but if you can't do that then you've got a bigger problem than grammars anyway, I suspect | ||
Zoffix | m: grammar Test { token TOP { <log-line>+ }; token log-line { .+?\n } ; }; say Test.parse("foo\nbar\nbaz"); | ||
camelia | rakudo-moar c27a00: OUTPUT«Nil» | ||
Zoffix | m: grammar Test { token TOP { <log-line>+ }; token log-line { .+?\n } ; }; say Test.parse("foo\nbar\nbaz\n"); | ||
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「foo」 log-line => 「bar」 log-line => 「baz」» | ||
01:52
sufrostico left
|
|||
Zoffix | m: grammar Test { token TOP { <log-line>+ }; token log-line { .+?\n? } ; }; say Test.parse("foo\nbar\nbaz"); | 01:52 | |
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「f」 log-line => 「o」 log-line => 「o」 log-line => 「b」 log-line => 「a」 log-line => 「r」 log-line => 「b」 log-line => 「a」 log-line => 「z」» | ||
Zoffix | m: grammar Test { token TOP { <log-line>+ }; token log-line { .+\n? } ; }; say Test.parse("foo\nbar\nbaz"); | ||
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「foobarbaz」» | ||
Zoffix | m: grammar Test { token TOP { <log-line>+ }; token log-line { .+?[\n|\z] } ; }; say Test.parse("foo\nbar\nbaz"); | 01:53 | |
camelia | rakudo-moar c27a00: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NV7alei5MdUnsupported use of \z as end-of-string matcher; in Perl 6 please use $at /tmp/NV7alei5Md:1------> 3log-line>+ }; token log-line { .+?[\n|\z7⏏5] } ; }; say Test.parse("foo\nbar\nbaz")» | ||
Zoffix | aw | ||
m: grammar Test { token TOP { <log-line>+ }; token log-line { .+?[\n|$$] } ; }; say Test.parse("foo\nbar\nbaz"); | |||
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「foo」 log-line => 「bar」 log-line => 「baz」» | ||
Zoffix | weee | ||
geekosaur | don't you really want log lines separated by \n ? | ||
hoelzro | I just noticed while trying to debug further panda-build problems that `perl6 --ll-exception $(which panda-build)` doesn't pass --ll-exception to the new perl6 process. Is there a way to find out the command line arguments given between perl6 and the name of the script? | 01:54 | |
Zoffix | herby_, BTW, there's modules.perl6.org/repo/Grammar::Debugger (which also includes Grammar::Tracer) you may find useful when writing grammars | 01:55 | |
01:55
lustlife` joined
|
|||
geekosaur | m: grammar Test { token TOP { <log-line>+ % '\n' }; token log-line { .+} ; }; say Test.parse("foo\nbar\nbaz"); | 01:55 | |
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「foobarbaz」» | ||
geekosaur | no, did that wrong | ||
m: grammar Test { token TOP { <log-line>+ % '\n' }; token log-line { .+? } ; }; say Test.parse("foo\nbar\nbaz"); | 01:56 | ||
herby_ | thanks Zoffix, I saw a youtube video where he was using a perl6-debugger but I couldn't get it to work | ||
camelia | rakudo-moar c27a00: OUTPUT«Nil» | ||
herby_ | I'll check those out | ||
what does the % do? | 01:57 | ||
<log-line>+ % | |||
<log-line>+ % '\n' | 01:58 | ||
01:59
lustlife left
|
|||
Zoffix | m: grammar Test { token TOP { <log-line>+ % '\n' }; token log-line { .+? } ; }; say Test.parse("foo\nbar\nbaz"); | 02:02 | |
camelia | rakudo-moar c27a00: OUTPUT«Nil» | ||
Zoffix | no idae | ||
m: grammar Test { token TOP { [ <log-line> \n? ]+ }; token log-line { <-[\n]> } ; }; say Test.parse("foo\nbar\nbaz"); | |||
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「f」 log-line => 「o」 log-line => 「o」 log-line => 「b」 log-line => 「a」 log-line => 「r」 log-line => 「b」 log-line => 「a」 log-line => 「z」» | ||
Zoffix | m: grammar Test { token TOP { [ <log-line> \n? ]+ }; token log-line { <-[\n]>+ } ; }; say Test.parse("foo\nbar\nbaz"); | ||
camelia | rakudo-moar c27a00: OUTPUT«「foobarbaz」 log-line => 「foo」 log-line => 「bar」 log-line => 「baz」» | ||
lucs | ack'ing for "EXECUTABLE" in the design docs (github.com/perl6/specs) matches nothing -- looking for P5's $^X equivalent. | 02:03 | |
Zoffix | m: say $*PROGRAM | 02:04 | |
camelia | rakudo-moar c27a00: OUTPUT«"/tmp/zKU4Shd0tn".IO» | ||
herby_ | <log-line>+ % '\n' | ||
Zoffix | m: say $*EXECUTABLE-NAME | ||
camelia | rakudo-moar c27a00: OUTPUT«perl6-m» | ||
Zoffix | lucs, check out doc.perl6.org/language/5to6-perlvar | ||
herby_ | whoops, ignore that | ||
geekosaur | herby_, the % means parse a list of something separated by something else | 02:05 | |
lucs | Zoffix: Yeah, that's where I saw EXECUTABLE(-NAME, yes), but I was looking for more details. | ||
geekosaur | so <number> % ',' would be a comma-separated list of numbers | ||
er | |||
<number>+ % ',' | 02:06 | ||
saying at least one number, separated by commas | |||
herby_ | ah ok, thats pretty neat | ||
lucs | (details like, can I get its full path from inside the program?) | 02:07 | |
geekosaur | that isn't always available | 02:10 | |
lucs | Hmm... | ||
herby_ | m: grammar Test { token TOP { <c>+ % ',' }; token c { \d }; }; say Test.parse("1,2,3,4,5"); | ||
camelia | rakudo-moar c27a00: OUTPUT«「1,2,3,4,5」 c => 「1」 c => 「2」 c => 「3」 c => 「4」 c => 「5」» | ||
marchelzo | is there an alternative way to write f($_) without explicitly mentioning $_? f is not a method, it's a block. | 02:11 | |
zengargoyle | m: say $*EXECUTABLE.abspath | ||
camelia | rakudo-moar c27a00: OUTPUT«./rakudo-m-inst/bin/perl6-m» | ||
zengargoyle | m: say $*EXECUTABLE.^methods | 02:12 | |
camelia | rakudo-moar c27a00: OUTPUT«(BUILD new-from-absolute-path abspath is-absolute is-relative parts volume dirname basename extension Numeric Bridge Int succ pred IO open pipe watch absolute relative cleanup resolve parent child chdir rename copy move chmod unlink symlink link mkdir rmdi…» | ||
zengargoyle | you might be able to find something in there... | ||
lucs | geekosaur: I happen to want to launch perl6 from within the program, and I'd like not to have to trust the PATH and make sure I'm invoking the same instance. | 02:13 | |
flussence | m: sub f { $^a * 2 }; given 5 { say .&f } | 02:14 | |
camelia | rakudo-moar c27a00: OUTPUT«10» | ||
lucs | geekosaur: Why do you say it's not always available? | ||
geekosaur | zengargoyle, there turn out to be ways to defeat that... | ||
the program is usually passed a basename as $0 if it was found on $PATH. one sting in the tail is that the shell may have a different $PATH it's using than it has exported | 02:15 | ||
marchelzo | flussence: thanks | ||
geekosaur | (this is not common but is possible) | ||
I should say as argv[0] since I am talking about C here | 02:16 | ||
or if it's not started by a shell, it could do pretty much anything | |||
(not to mention edge cases like traditional login prepending a - to argv[0] to indicate that it's a login shell) | |||
lucs | geekosaur: Ah, I see what you mean. | 02:17 | |
zengargoyle | m: say (slurp "/proc/self/cmdline").trans( "\x00"=>' '); | ||
camelia | rakudo-moar c27a00: OUTPUT«/home/camelia/rakudo-m-inst-2/bin/moar --execname=./rakudo-m-inst/bin/perl6-m --libpath=/home/camelia/rakudo-m-inst-2/share/nqp/lib --libpath=/home/camelia/rakudo-m-inst-2/share/perl6/lib --libpath=/home/camelia/rakudo-m-inst-2/share/perl6/runtime /home/ca…» | ||
geekosaur | also IIRC windows cannot pass a path | ||
herby_ | Thanks for the help and tips on understanding Grammars. Now I have some ideas for my log parser | ||
lucs | geekosaur: I guess I'll have to trust the PATH :) | ||
02:17
herby_ left
|
|||
geekosaur | so, you can get something that *usually* works but not that *always* works, except by going to platform dependent stuff like Linux /proc/self/exe | 02:17 | |
02:19
jdong left
|
|||
zengargoyle wonders if Perl 6 has a way to set program name ala $0 = 'foobar' | 02:19 | ||
tho even if it's platform dependent, it should be settable by that platform dependent method during startup... | 02:21 | ||
then again, the actual executable is 'moar' with a bunch of options... :) | 02:24 | ||
02:24
cdg joined
02:27
Sqirrel left
02:28
astrofyziky joined,
astrofyziky left
|
|||
zengargoyle | heh: $ /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /opt/rakudobrew/moar-nom/install/bin/moar --execname=/opt/rakudobrew/bin/../moar-nom/install/bin/perl6 --libpath=/opt/rakudobrew/moar-nom/install/share/nqp/lib --libpath=/opt/rakudobrew/moar-nom/install/share/perl6/lib --libpath=/opt/rakudobrew/moar-nom/install/share/perl6/runtime /opt/rakudobrew/moar-nom/install/share/perl6/runtime/perl6.moarvm -e 'say | 02:29 | |
$*EXECUTABLE-NAME' | |||
output: perl6 | |||
the LIES! | |||
02:29
cdg left
|
|||
hahainternet | day 8: "with an impressive collection of utility to get most of our common", utility should be plural i think | 02:31 | |
"Tools that take the repetitive and automatable parts of our work the way" should be "away" i believe | |||
"Just as classes are first class citizen that we can introspect" citizen should also be plural | |||
hope people don't mind me giving these corrections, it's all i can do to help D: | 02:32 | ||
lucs | (introspecting citizens is an unusual metaphor, eh) | ||
hahainternet | classes is plural, and so citizen should be too i think | 02:33 | |
that's how the rule goes iirc | |||
so says my grade C in GCSE English :D | |||
"Each expression is a list of terms, or possibly and alternative of them" and should be 'an' | 02:34 | ||
02:35
secwang joined
|
|||
marchelzo | is it possible to load some code into the repl and use things that are defined in it? | 02:39 | |
zengargoyle | lucs: looks like the executable name is set by the perl6 wrapper script itself. passed in as an option to the moar vm instance running the code. | 02:40 | |
dj_goku | marchelzo: like print them or inspect them? | ||
02:40
telex joined
|
|||
lucs | zengargoyle: Do we happen to have access to it? | 02:40 | |
zengargoyle | my .../bin/perl6: exec /opt/rakudobrew/moar-nom/install/bin/moar --execname="$0" | 02:41 | |
marchelzo | dj_goku: like I made a grammar, and I want to try parsing some stuff in the repl. | ||
zengargoyle | m: say $*EXECUTABLE.path | 02:42 | |
camelia | rakudo-moar c27a00: OUTPUT«./rakudo-m-inst/bin/perl6-m» | ||
zengargoyle | so it depends in this case on how you start it... | 02:43 | |
lucs | zengargoyle: Cool, thanks :) | ||
zengargoyle | m: say $*EXECUTABLE.absolute | ||
camelia | rakudo-moar c27a00: OUTPUT«./rakudo-m-inst/bin/perl6-m» | ||
02:43
BenGoldberg joined,
vendethiel joined
|
|||
zengargoyle | m: say $*EXECUTABLE.resolve.absolute | 02:44 | |
camelia | rakudo-moar c27a00: OUTPUT«/rakudo-m-inst/bin/perl6-m» | ||
02:45
z8 left
|
|||
zengargoyle | wonder if camelia is in a chroot... | 02:45 | |
lucs | It expands correctly for me here. | ||
marchelzo | does this look reasonable? I don't know if I need to use regex for TOP or if I could use token: sprunge.us/CfWK | 02:46 | |
zengargoyle | or probably started up funny to handle rebuilds and such. like: cd /home/camelia; ./rakudo-m-inst/bin/perl6-m; probably wrapped up in an easily kickable script. | 02:47 | |
02:47
AlexDaniel joined
|
|||
AlexDaniel | m: my $foo = 5; say “x: $_” for $foo | 02:48 | |
camelia | rakudo-moar c27a00: OUTPUT«x: 5» | ||
zengargoyle | it doesn't get PATH expanded since it's started with an absolute path | ||
AlexDaniel | m: my @foo = 5, 4; say “x: $_” for @foo | ||
camelia | rakudo-moar c27a00: OUTPUT«x: 5x: 4» | ||
AlexDaniel | m: my $foo = [5, 4]; say “x: $_” for $foo | ||
camelia | rakudo-moar c27a00: OUTPUT«x: 5 4» | ||
AlexDaniel | m: my $foo = [5, 4]; say “x: $_” for $foo; say $foo.WHAT | ||
camelia | rakudo-moar c27a00: OUTPUT«x: 5 4(Array)» | ||
AlexDaniel | hmm | 02:49 | |
m: my $foo = [5, 4]; say “x: $_” for |$foo | |||
camelia | rakudo-moar c27a00: OUTPUT«x: 5x: 4» | ||
AlexDaniel | m: my $foo = 5; say “x: $_” for |$foo | ||
camelia | rakudo-moar c27a00: OUTPUT«x: 5» | ||
AlexDaniel | It's just interesting how sometimes it doesn't matter whether it is an array or not | 02:50 | |
zengargoyle | marchelzo: TOP can be anything. i think i've even seen it be a method that does some stuff and then calls another rule explicitly. | ||
hahainternet | AlexDaniel: where doesn't it matter? it seems that everything there is quite consistent | ||
AlexDaniel | hahainternet: yes it is consistent, yet it is pretty useful | 02:51 | |
zengargoyle | it's just the name TOP that gets called by default. (you can also start at another rule/regex/token/method by passing an argument to parse) | ||
hahainternet | oh right, i thought you were complaining about something | ||
zengargoyle | AlexDaniel: that's the single thing iterates rule. | 02:52 | |
hahainternet | i think retaining the clear distinction between scalar, array and hash is fantastic, it's something i find frustrating in python | ||
marchelzo | say I've got a Match object, and the pattern was <foo> | <bar> <baz>. How do I tell which one matched? | ||
hoelzro | zengargoyle: there's a MoarVM ticket open to address that, iirc | ||
hahainternet | i think the one thing i'm unsure of in 6 is how to turn a positional into an array member | ||
marchelzo | if $<foo>? | ||
hoelzro | marchelzo: you could check which of $<foo> or $<bar> is defined | ||
flussence | m: use Test:<1.*>; | 02:53 | |
camelia | rakudo-moar c27a00: OUTPUT«===SORRY!===Could not find Test:<1.*>:ver<True>:auth<True>:api<True> in: /home/camelia/.perl6/2015.11-435-gc27a00c /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/raku…» | ||
marchelzo | hoelzro: how do you check if something is defined? | ||
flussence | if I'm reading the docs correctly, that 1.* should end up in :ver, right? | ||
hoelzro | $<foo>.defined, or defined($<foo>) | ||
but if $<foo> should do the trick | |||
AlexDaniel | hahainternet: sometimes you don't want it though. e.g. there could be some config value that is typically singular, yet you can make it so that if you shove an array ref into it will magically work :) | 02:54 | |
hoelzro | since all defined Matches are truthy | ||
marchelzo | hoelzro: ok, thanks | ||
zengargoyle | m: use Test:ver<1.*>; | ||
camelia | rakudo-moar c27a00: OUTPUT«===SORRY!===Could not find Test:ver<1.*>:auth<True>:api<True> in: /home/camelia/.perl6/2015.11-435-gc27a00c /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-in…» | ||
zengargoyle | m: use Test:ver<*>; | ||
camelia | rakudo-moar c27a00: OUTPUT«===SORRY!===Could not find Test:ver<*>:auth<True>:api<True> in: /home/camelia/.perl6/2015.11-435-gc27a00c /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst…» | ||
zengargoyle | m: use Test:ver<True>; | ||
camelia | rakudo-moar c27a00: OUTPUT«===SORRY!===Could not find Test:ver<True>:auth<True>:api<True> in: /home/camelia/.perl6/2015.11-435-gc27a00c /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-i…» | ||
zengargoyle | heh | ||
AlexDaniel | hahainternet: otherwise you'd have to pass [$val] all the time… which is probably not too bad | 02:55 | |
hahainternet | AlexDaniel: well in python, it's frustrating that if i pass a string to a function and then say 'for x in y', it will iterate the damn string | ||
AlexDaniel | hahainternet: hahaha | ||
hahainternet | wheras what i really want to say is "this positional is always an array, even if a string is passed, make it [$x]" | ||
it doesn't matter as much in p6 because of better design | |||
but the closest i know is slurpy args, it's just one thing on my list :D | |||
marchelzo | how can you do if-then-else as an expression? Like $cond ? $val : $val2 or something. | 02:56 | |
zengargoyle | ?? !! | ||
AlexDaniel | marchelzo: $cond ?? $val !! $val2 | ||
hahainternet | you can also use 'if' as the rhs can't you? | ||
AlexDaniel | hahainternet: can't use else though :) | 02:57 | |
hahainternet | oh really? i thought there was a nice idiom for that | ||
zengargoyle | orelse? | ||
hahainternet | i don't have enough time in my day to write nice perl6 :( | ||
zengargoyle | m: say do if True { "bar" } else { "foo" }; | 02:58 | |
camelia | rakudo-moar c27a00: OUTPUT«bar» | ||
zengargoyle | m: say do if False { "bar" } else { "foo" }; | ||
camelia | rakudo-moar c27a00: OUTPUT«foo» | ||
hahainternet | else works fine yeah | ||
i just checked locally lol | |||
AlexDaniel | huh | ||
hahainternet | expression -> statement or what have you | 02:59 | |
AlexDaniel | why would you use it instead of ?? !! ? | ||
lucs | zengargoyle: Not the most elegant, but if you must... :) | ||
hahainternet | it's very explicit, and you might have a more complex conditional etc | ||
lucs | Yeah, the structure is useful. | 03:00 | |
hahainternet | i've written quite a bit of golang recently | ||
and going back to python, dear god i miss a lot of the explicit nature | |||
AlexDaniel | hahainternet: well, Perl 6 is also not the most explicit language | 03:01 | |
hahainternet | AlexDaniel: on the contrary, to me it appears to be as explicit as you like | ||
and a lot of the implicit assumptions are consistent and predictable | |||
i'm very happy with how p6 is turning out, i really look forward to finding work in it | |||
AlexDaniel | hahainternet: well, if you write a couple of things explicitly, then perhaps | 03:02 | |
03:02
noganex_ joined
|
|||
AlexDaniel | hahainternet: but most Perl 6 code that you will stumble upon is probably not like this | 03:02 | |
hahainternet | AlexDaniel: too early to say imho | ||
AlexDaniel | though we don't know right now, yes | ||
03:02
Herby_ joined
|
|||
hahainternet | the current thing i'm most intrigued with is the ability to produce a 'proper' ORM | 03:04 | |
AlexDaniel | m: say "test" if True or say 42 and False | ||
camelia | rakudo-moar c27a00: OUTPUT«test» | ||
AlexDaniel | m: say "test" if False or say 42 and False | ||
camelia | rakudo-moar c27a00: OUTPUT«42» | ||
marchelzo | wow I am so impressed with perl6 | ||
hahainternet | i've been using a number of different ORMs of late, and they're all kinda bleh | ||
AlexDaniel | look at this… I think that I wrote a bit too much of prolog… | ||
hahainternet | AlexDaniel: what's with 'and False'? | 03:05 | |
hoelzro | marchelzo: glad to hear that =) | ||
AlexDaniel | hahainternet: it has to fail… | ||
hahainternet: otherwise you'd get both | |||
03:05
vendethiel left
|
|||
AlexDaniel | hahainternet: so it is an “else” emulator… | 03:05 | |
marchelzo | hoelzro: does this look okay style-wise? I think maybe I should have used if ... {...} else {...} instead of the ?? !! syntax. sprunge.us/KgGd | 03:06 | |
hahainternet | interesting, and 'xor' doesn't seem to work locally | ||
marchelzo | grammars are super nice though | ||
hahainternet | i don't quite see how that works :/ | ||
marchelzo: fwiw i think your use of ?? and !! is pretty clear | |||
AlexDaniel | marchelzo: usually you'd use ?? !! when you want to assign | 03:07 | |
hoelzro | looks alright to me; a few pointers: | ||
AlexDaniel | marchelzo: so I don't recommend doing it this way, although you might | ||
hoelzro | 1) you don't need to do $/.make; just make is fine | ||
2) you can also use regexes with different long names instead of |, if you prefer | |||
AlexDaniel | marchelzo: e.g. $val = $cond ?? 42 !! 69; # here is where it totally makes sense | ||
hoelzro | so regex factor:times { <number> '*' <factor> } ; regex factor:number { <number> } | 03:08 | |
AlexDaniel | marchelzo: everywhere else, well, not so much, unless you want to return something | ||
hoelzro | and then have method factor:times($/) and method factor:number($/) in your actions class | ||
that's more a personal taste thing for me, though | |||
AlexDaniel | marchelzo: Oh, you are returning something, aren't you? | ||
03:09
cdg joined
|
|||
marchelzo | hoelzro: oh, that's exactly what I was wishing I could do | 03:09 | |
incredible | |||
what exactly does the make method do? I don't fully understand its significance. I get what .made does, but not .make. | 03:10 | ||
hahainternet | AlexDaniel: oh i just looked at it again and i see the precedence, i'm just dumb :D | 03:11 | |
marchelzo | AlexDaniel: yea | ||
hoelzro | marchelzo: make is kind of like return for action methods | ||
I don't know if I even fully get it =/ | |||
it basically sets .made/.ast for $/ | |||
marchelzo | I tried replacing $/.make: with just make: but I got an error. | 03:12 | |
03:12
khw left
|
|||
marchelzo | "Redeclaration of symbol make" | 03:12 | |
hoelzro | huh, that's odd. | 03:13 | |
oh, drop the : | |||
03:13
cdg left
|
|||
hoelzro | just "make $value" | 03:13 | |
marchelzo | oh, ok | 03:14 | |
so action methods are not regular methods? | 03:15 | ||
hoelzro | they are | ||
I just don't know why make is used and not return | |||
marchelzo | I see | 03:17 | |
the fact that you can write make instead of $/.make:... is that a special thing just for grammars? | |||
hoelzro | I think that make just compiles to $/.make | 03:19 | |
hoelzro looks | |||
yes | |||
it just desugars to $/.make | 03:20 | ||
03:21
kid51 left
|
|||
AlexDaniel | m: sub infix:<relse>($cond, $b) is looser(&infix:<or>) { $cond ?? True !! ($b() and False) }; say “just look” if 42 < 69 relse { say “at this insanity” }; | 03:25 | |
camelia | rakudo-moar c27a00: OUTPUT«just look» | ||
AlexDaniel | m: sub infix:<relse>($cond, $b) is looser(&infix:<or>) { $cond ?? True !! ($b() and False) }; say “just look” if 42 > 69 relse { say “at this insanity” }; | 03:26 | |
camelia | rakudo-moar c27a00: OUTPUT«at this insanity» | ||
hahainternet | nice | ||
AlexDaniel | I wonder if there is any way to get rid of { } | 03:27 | |
I don't think so, unless you modify the grammar more crazily | |||
hahainternet shrugs | 03:28 | ||
AlexDaniel | hahainternet: this reminds me of some Python feature… | ||
hahainternet: the one that does !! ?? | 03:29 | ||
「a if test else b」 | |||
hahainternet | yeah, the 'ternary' type operator added in 2.6 or so? | ||
AlexDaniel | m: sub infix:<python>($cond, $b) is looser(&infix:<or>) { $cond ?? True !! ($b() and False) }; say “just look” if 42 > 69 python { say “at this insanity” }; | ||
camelia | rakudo-moar c27a00: OUTPUT«at this insanity» | ||
hahainternet | i wonder how those quotes are done on my keyboard | 03:30 | |
AlexDaniel | 「doSomething if cond else pass」 – RHS if in python? | 03:31 | |
hahainternet | it's only for assignment iirc but it is 3:30am so i'm not exactly at 100% | ||
AlexDaniel | “SyntaxError: invalid syntax” | 03:32 | |
hahainternet | var = "foo" if True else "bar" | 03:33 | |
is the correct syntax | |||
i had to actually test it lol | |||
i'm going to get some tea :D | |||
AlexDaniel | hahainternet: sure, I know | ||
just hoped that I can trick it :) | 03:34 | ||
hm | |||
actually, you can use it! | 03:35 | ||
foo() if 2 < 10 else 1 | |||
and it works just fine in void context | |||
so there you have it, rhs if in python… just if this 「else 1」 does not bother you too much | 03:37 | ||
hahainternet | AlexDaniel: so how do you type your quote characters? | 03:38 | |
i should start customising my compose key / third level keys | |||
AlexDaniel | m: say 0_0 | ||
camelia | rakudo-moar c27a00: OUTPUT«0» | ||
AlexDaniel | hahainternet: my keyboard layout files.progarm.org/2015-12-09-05392..._scrot.png | 03:39 | |
hahainternet: some of these arrows are typable arrows, others are normal arrows :) | 03:40 | ||
MadcapJake | my program for adventofcode day 6 takes like 2 hours to run :_( | ||
AlexDaniel | hahainternet: designed for japanese keyboard | ||
hahainternet: the ones with short spacebar and more thumb buttons | 03:41 | ||
hahainternet | AlexDaniel: interesting, how did you produce that png? | ||
AlexDaniel | hahainternet: keys with ♿ are sticky | ||
hahainternet: that's just a table in my private wiki. I took a screenshot | |||
hahainternet | ah ok | 03:42 | |
03:42
Herby_ left
|
|||
lucs | In P5, arbitrary information can be passed to a module's import() function by doing something like use Foo ('bar') . | 03:43 | |
How is something similar done in P6 (import() function not being the same notwithstanding)? | 03:44 | ||
"Similar" meaning: pass some information to the module so it can set itself up as desired. | 03:45 | ||
AlexDaniel | hahainternet: this layout turned up being quite interesting. Well, if you are interested in keyboard layout :) | 03:46 | |
hahainternet: for example, AltGr+x is delete. And guess what x does in vim! | |||
hahainternet | AlexDaniel: i'm trying to find out how to modify my layout in gnome 3 :) | ||
deletes the character under the cursor? | |||
AlexDaniel | yeah | ||
03:46
Ben_Goldberg joined
|
|||
AlexDaniel | hahainternet: I think that you can go straight to creating your own layout | 03:47 | |
hahainternet: which is done with xkb | |||
hahainternet: /usr/share/X11/xkb/symbols/us is a file with the layout description | 03:48 | ||
hahainternet | AlexDaniel: not in gnome it seems, it uses some other source for them | ||
AlexDaniel | hahainternet: honestly, I don't buy it. I think that almost all GNU/Linux distros are using xkb | 03:49 | |
03:49
BenGoldberg left,
BenGoldberg_ joined
|
|||
geekosaur | sadly | 03:49 | |
yes, they use xkb. but gnome apps use ibus which is informed by but not configured by xkb; they have additional configuration | |||
AlexDaniel | okay, but let's say you create your own xkb layout, is it going to be available? | 03:50 | |
hahainternet | looks like git.gnome.org/browse/gtk+/tree/gtk...mpleseqs.h is the source | ||
geekosaur | it will be available. but ibus will intercept some keys before xkb can process them | ||
03:51
Ben_Goldberg left
|
|||
geekosaur | and hat imcontext thing, yeh, which can intercept keys before either ibus or xkb can see them | 03:51 | |
zengargoyle | ibus is just an input method. xkb is the event generation. | 03:52 | |
03:52
orbus joined
|
|||
zengargoyle | you can easily remove ibus or replace it with uim or scim for instance. | 03:52 | |
geekosaur | enjoy figuring out which layer is messing with you\ | ||
zengargoyle | you just have to load appropriate modules for other ime's to work with gnome/gtk/qt | 03:53 | |
AlexDaniel | well, the question is what is going to happen if you use something like “key <AD04> { [ p, P, End, End ] };” | ||
zengargoyle has a love/hate relationship with ibus... | |||
hahainternet | i just want to have fancy japanese quotes ;) | 03:54 | |
AlexDaniel | is it going to get in your way somehow? e.g. swallow End button event or block your third level completely | ||
zengargoyle | yeah, that's why i keep ibus around, for anthy. :P | ||
AlexDaniel | anyway, I recommend everybody to experiment with their keyboard layouts. Fancy quotes are just part of it, what is way more useful is to have arrow keys on your home row. | 03:58 | |
hahainternet | i just discovered Ω which is nice :D | ||
didn't know how to type that the other day | |||
03:59
noganex joined
|
|||
AlexDaniel | what I've just discovered is that there's <dead_greek> key | 04:00 | |
zengargoyle | but which key is it? | ||
AlexDaniel | zengargoyle: you have to assign it | 04:01 | |
zengargoyle | that's the part i never figured out... | ||
plus, laptop with few actually free keys | |||
04:02
noganex_ left
|
|||
AlexDaniel | AltGr gives you a whole set of keys which are free | 04:02 | |
twice | |||
zengargoyle | no altgr key on my keyboard... | ||
04:03
kaare_ joined
|
|||
AlexDaniel | reassign Caps Lock to AltGr then | 04:03 | |
zengargoyle | caps is compose :) | ||
AlexDaniel | set compose to Caps + something | ||
like Caps+l or whatever | 04:04 | ||
unless you really want to have a dedicated key for compose :) | |||
zengargoyle | i think i'm just going to use that XCompose file that was mentioned in the advent. | 04:05 | |
AlexDaniel | but in this case you can use right ctrl or whatever. What keyboard is that without AltGr? | ||
lucs & # ZZ | |||
zengargoyle | has tons of mappings. greek are Multi * O (for omega) | ||
AlexDaniel | what is multi? | 04:06 | |
zengargoyle | laptop keyboards are often short a few keys, no altgr, only one 'windows' key, | ||
Multi_key is just another name for Compose | |||
AlexDaniel | ah right | 04:07 | |
zengargoyle: well, right, that's one way to do it. Personally I think that pressing Shift + some key is more comfortable than pressing Compose + some key | 04:08 | ||
though there are guys who make their shifts sticky | |||
and AltGr is just another kind of a shift :) | 04:09 | ||
zengargoyle | well compose as capslock is just to the left of A on my keyboard, quite easy to hit. and it's sticky so it compose and then other characters, you don't have to hold it down or anything. | ||
AlexDaniel | I know, but that's kinda the difference | 04:10 | |
by the way, if you don't like the number of keys on your laptop you can always try to find japanese keyboard | |||
I mean, for your laptop | |||
zengargoyle | yeah, in the end, i guess i find it easier to remember 'compose + these two sorta mnemonic characters' vs this magic key + this other certain key, or some combination of shift+alt+key :) | 04:12 | |
AlexDaniel | compose is great for entering rare characters. For common stuff, um, not so much! | ||
e.g. you don't need mnemonics for common stuff :) | 04:13 | ||
zengargoyle | but it's the uncommon stuff that's the most fun. :) 💡 | 04:14 | |
marchelzo | how do you do .pick with replacement? | ||
zengargoyle | what's pick with replacement? | ||
AlexDaniel | “”‘’「」…– «»xE2x8CxA9xE2x8CxAA | ||
^ I'm not sure that these things are uncommon | 04:15 | ||
marchelzo | random selection with replacement | ||
AlexDaniel | marchelzo: use splice | ||
zengargoyle | i don't get the replacement part... | ||
TimToady | that's called "roll", as in dice | ||
zengargoyle | do you mean roll? | ||
heh | |||
marchelzo | yes. roll. outside of programming this is called random selection with replacement. | 04:16 | |
AlexDaniel | aaaaaah | ||
zengargoyle | m: say (1..6).roll xx 12 | ||
camelia | rakudo-moar c27a00: OUTPUT«(4 2 4 6 6 4 5 2 6 4 2 5)» | ||
TimToady | m: say ('⚀' .. '⚅').roll(5) | ||
camelia | rakudo-moar c27a00: OUTPUT«(⚁ ⚂ ⚅ ⚀ ⚀)» | ||
marchelzo | like if you were randomly pulling 5 things out of a bag, .roll would be like replacing each think before pulling out the next one. | ||
each thing* | |||
TimToady | hmm | ||
AlexDaniel | m: say ⚀ | ||
camelia | rakudo-moar c27a00: OUTPUT«5===SORRY!5===Argument to "say" seems to be malformedat /tmp/gb9C0Qp6jX:1------> 3say7⏏5 ⚀Bogus postfixat /tmp/gb9C0Qp6jX:1------> 3say 7⏏5⚀ expecting any of: infix infix stopper pos…» | ||
AlexDaniel | awww | ||
TimToady | m: say ⚅ | 04:17 | |
camelia | rakudo-moar c27a00: OUTPUT«5===SORRY!5===Argument to "say" seems to be malformedat /tmp/engd6PCjA_:1------> 3say7⏏5 ⚅Bogus postfixat /tmp/engd6PCjA_:1------> 3say 7⏏5⚅ expecting any of: infix infix stopper pos…» | ||
TimToady | aww | ||
zengargoyle | cards aren't numeric either. :( | ||
AlexDaniel | m: say '⚅' - '⚀' # I think that you can do this… | 04:18 | |
camelia | rakudo-moar c27a00: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5⚅' (indicated by ⏏) in block <unit> at /tmp/0Y2RJbNn8n:1Actually thrown at: in block <unit> at /tmp/0Y2RJbNn8n:1» | ||
AlexDaniel | noooo | ||
ah | |||
m: say '⚅'.org - '⚀'.ord # I think that you can do this… | |||
camelia | rakudo-moar c27a00: OUTPUT«Method 'org' not found for invocant of class 'Str' in block <unit> at /tmp/isVC8tQzEX:1» | ||
AlexDaniel | m: say '⚅'.ord - '⚀'.ord # I think that you can do this… | ||
camelia | rakudo-moar c27a00: OUTPUT«5» | ||
AlexDaniel | m: my \term:<⚅> = 6; say ⚅; | 04:22 | |
camelia | rakudo-moar c27a00: OUTPUT«6» | ||
dalek | osystem: 97800c8 | (Anthony Parsons)++ | META.list: Add Minecraft-Tools to ecosystem github.com/flussence/Minecraft-Tools Just for fun, this contains two modules whose IDs differ only in version number. Let's see how that goes... |
04:23 | |
04:25
aoniao joined
|
|||
AlexDaniel | 20s startup for my thing using bailador… uh | 04:25 | |
flussence | that might just be precomp | ||
should be faster the second time | 04:26 | ||
AlexDaniel | slow every time | ||
flussence | oh... :( | ||
04:27
aoniao left
|
|||
zengargoyle has been pleasantly surprised how much second time is faster. well usually... | 04:27 | ||
AlexDaniel | actually, I haven't noticed any speedup when precomp arrived… | ||
any way to force no precomp? | |||
so that I can see if it is much slower | |||
zengargoyle | 0m12.424s vs 0m2.460s for testing Algorithm::Trie::libdatrie | 04:33 | |
04:34
BenGoldberg_ left
04:35
secwang left
|
|||
zengargoyle | that's 4 test files so 4x that it doesn't have to compile from scratch... | 04:35 | |
04:36
bpmedley left
|
|||
dj_goku | yay just connected to connection using IO::Socket::Async to a real system (gearmand)! | 04:38 | |
blah that didn't come out right. I made my first real connection to gearmand using IO::Socket::Async! | 04:39 | ||
04:39
marchelzo left
04:42
kaare_ left
|
|||
skids | .tell masak gist.github.com/skids/97378d26a684591f1b89 # I only felt like bikeshedding tonight | 04:47 | |
yoleaux | skids: I'll pass your message to masak. | ||
zengargoyle wonders if NativeCall needs to be a depends in META | 04:48 | ||
04:49
AlexDaniel left
04:50
n0tjack left
05:00
bpmedley joined,
secwang joined
|
|||
hoelzro | zengargoyle: I don't think so | 05:05 | |
it's bundled with Rakudo, right? | |||
05:13
secwang left
05:21
mattp__ left
05:32
xinming joined
05:44
xinming left
05:46
skids left
05:47
lustlife` left,
lustlife` joined
05:48
zengargoyle left
05:50
secwang joined
05:51
xinming joined
05:53
Sqirrel joined
05:55
xinming left
05:56
xinming joined
05:57
glaukommatos left
06:02
zengargoyle joined
06:03
adu joined
|
|||
adu | \o | 06:04 | |
06:06
xinming left
06:08
xinming joined
06:17
xinming left
06:26
xinming joined
06:30
xinming left,
xinming joined
06:32
Actualeyes joined
06:35
xinming left
|
|||
MadcapJake | how would you do bitwise negation that *doesn't* give a negative result? | 06:37 | |
wait, nevermind, problem is elsewhere :P | 06:38 | ||
no that is it, how do you do one's complement? | 06:42 | ||
MadcapJake loves bitwise math :P | |||
adventofcode.com/day/7 has bitwise NOT of 123 equals 65412 ?? that doesn't make sense to me | 06:44 | ||
oh i think i need to have an unsigned int | 06:46 | ||
06:46
xinming joined
06:48
Tux__ joined
06:54
glaukommatos joined,
kjs_ joined,
kjs_ left
06:56
geraud left
07:00
glaukommatos left
07:01
CIAvash joined
07:08
sno left
07:09
adu left
07:10
ambs joined
07:18
rurban joined
07:23
M-eternaleye is now known as eternaleye
|
|||
[Tux] | test 50000 22.975 22.864 | 07:38 | |
test-t 50000 16.793 16.683 | |||
csv-parser 50000 25.370 25.259 | |||
07:40
eyck joined
|
|||
grondilu | adventofcode? I failed at day 3, no idea why. Seemed easy enough. | 07:45 | |
07:48
sno joined
07:51
CIAvash left
|
|||
_nadim | Good morning everyone. | 07:51 | |
grondilu | say 1 + unique [\+] map { when '^' {+i}; when 'v' {-i}; when '<' {-1}; when '>' {+1} }, slurp.comb; # that was a solution I thought was smart. | 07:53 | |
07:54
RabidGravy joined
|
|||
grondilu | oh wait that does not work with the examples | 07:56 | |
m: say unique 0, 0+0i | 07:57 | ||
camelia | rakudo-moar c27a00: OUTPUT«(0 0+0i)» | ||
07:57
glaukommatos joined
|
|||
grondilu | yeah I remember now | 07:57 | |
that's how I found the (0+0i).narrow bug | 07:58 | ||
moritz | grondilu: map *.narrow, ... | ||
grondilu | m: say (0+0i).narrow | ||
camelia | rakudo-moar c27a00: OUTPUT«Attempt to divide by zero using / in block <unit> at /tmp/vlOiRxr9BK:1Actually thrown at: in block <unit> at /tmp/vlOiRxr9BK:1» | ||
moritz | eeks | ||
grondilu | I got annowed and stopped searching. | ||
moritz | grondilu: looks like an easy fix | 07:59 | |
grondilu | I did submit a PR though: github.com/rakudo/rakudo/pull/620 | ||
dalek | kudo/nom: b2ae6dc | grondilu++ | src/core/Complex.pm: handling nul real part in narrow method you don't want to divide by $!re unless you've dealt with the case $!re == 0e0 |
08:01 | |
kudo/nom: 49d8728 | grondilu++ | src/core/Complex.pm: deal with nul case if self is actually null, the nul integer should be returned. |
|||
kudo/nom: 40fe92d | moritz++ | src/core/Complex.pm: Merge pull request #620 from grondilu/patch-1 handling nul real part in narrow method |
|||
08:02
glaukommatos left
|
|||
grondilu | thanks | 08:02 | |
still won't solve day 3 for me I'm afraid | |||
say +unique [\+] 0i, |map { when '^' {+i}; when 'v' {-i}; when '<' {-1}; when '>' {+1} }, slurp.comb; | |||
moritz | grondilu: still needs a .narrow somewhere | 08:03 | |
_nadim | How can one access a non exported sub? | ||
grondilu | no, as I put 0i instead of 0 | ||
moritz | grondilu: an | ||
_nadim: if it's an "our" sub, through the package name | |||
_nadim: ThePackage::thesub() | |||
_nadim: if it's neither "our" nor exported: not at all | |||
BooK | grondilu: advent of code looks funny | 08:04 | |
are people publishing their answers? | |||
grondilu | surely, somewhere | ||
on reddit for instance | |||
BooK | I'd have thought github | 08:05 | |
grondilu | probably as well | ||
_nadim | thnks, while I am at it, can I alias then with something like MY::<&the_alias> = ThePackage::<&thesib> | ||
BooK | adventofgolf would be an interesting twist | ||
moritz | _nadim: my &the_alias = &ThePackage::sub # iirc | 08:06 | |
08:07
Ch0c0late joined
|
|||
_nadim | moritz: thank you | 08:07 | |
dalek | ast: 66d8f6c | moritz++ | S32-num/narrow.t: Fix, unfudge and expand RT #126828 tests |
||
08:08
mattp__ joined
|
|||
grondilu | m: say +unique [\+] 0i, |{ '^' => i, v => -i, '<' => -1, '>' => 1 }{.comb} for qw{ < ^>v< ^v^v^v^v^v}; | 08:08 | |
camelia | rakudo-moar c27a00: OUTPUT«242» | ||
_nadim | I did try to find a documentaion about exporting and such but was not lucky enough to find the right one, any links? | ||
08:09
Timbus left
|
|||
grondilu | should be S12, shoudn't it? | 08:09 | |
moritz | _nadim: there's doc.perl6.org/routine/is%20export though it's not very much | ||
grondilu | sorry meant S11 | ||
_nadim | moritz: that one I found :) | 08:10 | |
moritz | _nadim: then what are you now looking for | ||
MadcapJake | grondilu: unfortunately i wrote over my part 1, but the only change was alternating between a robot and santa www.reddit.com/r/adventofcode/comm...ns/cxnwg43 | 08:11 | |
hahainternet | here's a weird one, the doc site for me when i 'first' load it has code with screwed up kerning | 08:12 | |
an f5 fixes it | |||
08:12
darutoko joined
|
|||
MadcapJake | m: sub prefix:<u+^>(Int $i) {:2($i.base(2).split('').map({$_ ~~ '0' ?? '1' !! '0'})).base(10).Int}; say u+^123; #unsigned bitwise negation | 08:15 | |
camelia | rakudo-moar 40fe92: OUTPUT«This call only converts base-2 strings to numbers; value ("0", "0", "0", "0", "0", "1", "0", "0", "0").Seq is of type Seq, so cannot be converted!(If you really wanted to convert ("0", "0", "0", "0", "0", "1", "0", "0", "0").Seq to a base-2 string, use …» | ||
08:22
xinming left
|
|||
MadcapJake | hmm base returns a string so why doesn't that split work? | 08:23 | |
_nadim | moritz: a single place whisth all the details, but I understand that I may have to put it together myself ;) | ||
MadcapJake | m: sub prefix:<u+^>(Int $i) {my $b = $i.base(2); my @c = $b.split("").map: {$_ ~~ "0" ?? "1" !! "0"}; :2(@c.join).base(10).Int}; say u+^123; | 08:24 | |
camelia | rakudo-moar 40fe92: OUTPUT«8» | ||
MadcapJake | I think that's the wrong math :( anyone know how I could do unsigned bitwise negation? | ||
moritz | _nadim: ah, maybe doc.perl6.org/language/modules#Expo..._Importing also interests you | 08:25 | |
08:28
xinming joined
|
|||
_nadim | indeed :) | 08:29 | |
08:33
xinming left
08:34
xinming joined
08:36
Ven joined
08:38
xinming left,
abraxxa joined
|
|||
pdcawley | Any chance the "we are not most men..." bit of p6advent day 6 be changed to 'we are not most people'? Doesn't affect the sense; does affect the message. | 08:38 | |
Sorry, day 8. | |||
moritz | pdcawley: afaict it's an obscure reference to some movie or another | 08:39 | |
08:39
xinming joined
|
|||
DrForr | And I didn't write it, I must be slipping. | 08:39 | |
pdcawley | moritz: So? | 08:40 | |
dalek | c: 9020737 | moritz++ | doc/Type/ (2 files): Link to more detailed documentation on "is export" and importing |
||
moritz | pdcawley: so the reference will probably be not recognizable afterwards. Just sayin' | ||
in the end, I'll leave it to tadzik, who wrote it. | |||
08:42
koo8 joined
08:44
xinming left,
leont joined
|
|||
pdcawley | moritz: I'm not sure it's that recognizable now; Google search for "we are not most men" is remarkably short list of results. | 08:45 | |
08:49
koo8 left,
g4 joined,
g4 left,
g4 joined
08:50
leont left
08:51
CIAvash joined
|
|||
_nadim | Who is the author/maintainer of Test? diag does not ouput anything before a test is done. | 08:51 | |
moritz | _nadim: Test is maintained alongside rakudo | ||
_nadim: and are you sure that's not a feature of the test harness? | 08:52 | ||
_nadim | I hope it is not :) | ||
which takes me to the next question? bugs are reported in github, right? | 08:53 | ||
moritz | _nadim: rakudo bugs are reported via email to [email@hidden.address] (which makes them show up at rt.perl.org) | 08:54 | |
m: use Test; diag "foo"; sleep 100; # should run into a timeout | |||
camelia | rakudo-moar 40fe92: OUTPUT«(timeout)# foo» | 08:55 | |
moritz | _nadim: in my local tests, the "# foo" shows up pretty much immediately, not at test exit | ||
_nadim: so I suspect it's the harness after all | |||
_nadim | it may very well be, I'll double check just to make sure I did not miss it then I'll report a bug and wait for someone to tell me I am completely wrong ;) | 08:56 | |
08:57
llfourn_ joined
|
|||
rurban | _nadim: github is good for nqp and moarvm, not rakudo | 08:57 | |
08:58
glaukommatos joined
|
|||
_nadim | ok | 08:59 | |
RabidGravy | _nadim, it outputs to stderr immediately it is called (I just looked at the code) | ||
nine | .tell AlexDaniel no precompilation; in your module and it will compile your module every time. Its dependencies however will still be precompiled. | 09:01 | |
yoleaux | nine: I'll pass your message to AlexDaniel. | ||
09:03
glaukommatos left
09:04
xinming joined,
Timbus joined
09:06
n0tjack joined
|
|||
_nadim | RabidGravy: I just reported 2 errors. the code says something, my eyes something else, it's probably my eyes | 09:08 | |
09:11
n0tjack left
09:12
leont joined
|
|||
masak | good antenoon, #perl6 | 09:18 | |
yoleaux | 04:47Z <skids> masak: gist.github.com/skids/97378d26a684591f1b89 # I only felt like bikeshedding tonight | ||
09:19
matt_ joined,
matt_ left,
matt_ joined,
matt_ left,
matt_ joined
|
|||
_nadim | masak: good morning | 09:21 | |
masak | :) | ||
09:26
dakkar joined
|
|||
RabidGravy | good foo all | 09:27 | |
moritz | RabidGravy: and a happy bar to you | 09:30 | |
BooK | first time in my life I'm using named captures in Perl 5 | ||
guess I'm gearing up for perl 6 | |||
masak | \o/ | 09:31 | |
El_Che | good morning #perl6 | ||
masak | BooK: early signs of an onset of Perl 6 are subtle, such as sudden usage of named captures in Perl 5 | ||
RabidGravy | :) | ||
BooK | not writing regexp, though, generating them rather | ||
masak | as you do | ||
El_Che | Channels got me hooked | ||
BooK | I want to write happy code, so I let it write part of itself | ||
El_Che | Book: That's how Skynet happened | 09:32 | |
BooK | El_Che: you'll never guess the name of the (work) project | ||
moritz | "Perl 6: paving the road for Skynet" | ||
masak | BooK: there's a scene in Girl Genius where they make a point of Agatha being so much of a spark that even the little machines she invents have the spark | ||
BooK | Skijnet # it's a Dutch company | ||
masak | BooK: O.O | 09:33 | |
moritz | wouldn't that be a good title for an advent post :-) | ||
masak | BooK: I'm genuinely terrified now. | ||
El_Che | Book: SchijtNet for the detractors? | ||
RabidGravy | If I wanted to get the "package" of the call site of a method, is there any way to get that from callframe/backtrace/something else ? | ||
moritz | RabidGravy: once you have the code object, and it's a Routine, you can call .package on it | 09:34 | |
RabidGravy: and I think that Backtrace exposes the code object | |||
maybe callframe too, dunno | |||
RabidGravy | ah, okay, will test in a bit, cheers. First have to go to the quack to have my non-ideal lifestyle condemned in order to get a repeat prescription | 09:35 | |
09:35
koo8 joined
09:36
domidumont joined
|
|||
BooK | masak: we're building a system that will first read network configs and make reports for humans to fix them, according to our world view, and eventually, as we get more confident with the system, focus on the "model" and let it write the configs and manage the devices | 09:37 | |
so yes, the name was obvious | |||
09:38
CQ joined
|
|||
BooK | my job will be done when the network people ask for a "JFDI" button :-) | 09:41 | |
I'll commit that change with -m"Judgement Day" | 09:42 | ||
nine | callframe exposes the code object | 09:43 | |
El_Che | semi random paste from the code working now: masak: we're building a system that will first read network configs and make reports for humans to fix them, according to our world view, and eventually, as we get more confident with the system, focus on the "model" and | ||
let it write the configs and manage the devices | |||
10:37 < BooK> so yes, the name was obvious | |||
damn | |||
nine | callframe(1).code | ||
El_Che | I meant this: has Str $.separator = "(ノಠ益ಠ)ノ彡┻━┻"; # Yes we can utf-8! | ||
BooK | wrong paste buffer is as embarrasing as wrong window | 09:44 | |
El_Che | is the modules.perl6.org repo also meant for applications? | ||
BooK | shouldn't that be applications.perl6.org ? | ||
DrForr | I've put some examples/ directories up, but not as part of any official installs. | 09:45 | |
El_Che | BooK: you don't know my pain. I am a linux user working on a linux vm in a windows machine (@work) | ||
masak | BooK: "when armageddon finally arrived, it arrived because people were fully aware and decided to pick a funny name" :P | 09:47 | |
m: class A { has @.x; method m($op) { my class B { method y { $op } }; @.x.push(B.new); say .y for @.x; } }; my $s = A.new; $s.m(1); say "--"; $s.m(2) | |||
camelia | rakudo-moar 40fe92: OUTPUT«1--22» | ||
masak | I have a question about the above eval. | ||
I expected OUTPUT«1--12» -- are my expectations out of whack? | |||
and, assuming they are, how can I do something similar but which has that output? | 09:48 | ||
jnthn | masak: classes are not closures | 09:49 | |
So yes, you should has $.op in B and do .new(:$op) or so | 09:50 | ||
masak | ah, yes | ||
arnsholt | So that code would explode horribly if the B.y method was called in an outside scope? | ||
jnthn | Or, to spend lots more memory doing the same thing, you can go with a parametric role :P | ||
masak | jnthn++ | ||
jnthn | masak: Given it's marked "my", it can't easily be ;) | ||
uh, arnsholt ^^ | |||
arnsholt | You could return an object, though, couldn't you? | 09:51 | |
jnthn | Sure, and then you create the usual "package scoped inside lexically scoped" situation, where you'll probably see Any or so | ||
masak | *nod* | 09:52 | |
arnsholt | Right, right | ||
masak | I'm actually completely fine with that answer | ||
jnthn | OK, I probably should not time at the airport to "not one tiny thing can possibly go wrong" levels :) | ||
*cut time | |||
Even if I am in Norway :) | |||
bbl & | |||
arnsholt | Usually a good idea =) | ||
Peaceful travels, jnthn | 09:53 | ||
mrf | Are any people here attending LPW. Or more importantly pre LPW social on Friday? | ||
vytas | mrf, I'll be at LPW and possibly in post LPW social but not pre | 09:57 | |
mrf | vytas: I should likely be at the post social as well :D | 09:58 | |
10:01
glaukommatos joined
10:02
TEttinger left
10:05
glaukommatos left
|
|||
DrForr | I'll be there, but not for the social :( | 10:06 | |
10:07
yeahnoob left
10:08
leont left
|
|||
mrf | DrForr: No Beer!!! | 10:10 | |
DrForr | With my leg it's probably not a good idea for me to go stumbling around :) | 10:11 | |
mrf | thats true | 10:13 | |
DrForr | It's pretty decent these last few days (I'm off my cane, though I still bring it with me) but it still needs to be strengthened. | ||
10:14
Ch0c0late left
10:15
rurban left
|
|||
mrf | At least its getting better | 10:22 | |
10:23
koo8 left
|
|||
tadzik | pdcawley: yeah, I think I'll go and change that. For the record, I did check if I'm correct in assuming that "men" is for gender-neutral and "man" is for male, but I must've been wrong either way | 10:25 | |
masak | nope, "men" is just the plural of "man". | 10:26 | |
moritz | "men" is just the plural of "man", and both can either mean "human" or "male human", depending on context | ||
masak | there's a slow, gradual cultural shift from "of course man/men includes women" to "of course it doesn't" | ||
and at any given time, you will have people arguing either side | |||
Ven | o/ #perl6 | 10:28 | |
BooK | words are hard, let's hug! | ||
vytas | there is always singular they :) | 10:30 | |
nine | or just "people" | 10:37 | |
BooK | or simply * | 10:39 | |
10:46
espadrine joined
10:48
Ven left
|
|||
lizmat | $ perl6 --ll-exception t/spec/S03-metaops/reduce.rakudo.moar | 10:53 | |
Cannot find method 'orig' | |||
at gen/moar/stage2/QAST.nqp:5461 (/Users/liz/Github/rakudo.moar/install/share/nqp/lib/QAST.moarvm:compile_all_the_stmts:182) | |||
this new spectest breakage goes deep into the rabbit hole | |||
10:54
km3 left
|
|||
pdcawley | tadzik: Thanks. | 10:56 | |
10:59
lucs joined
|
|||
nine | lizmat: looks scary | 11:00 | |
sergot | for vscode users: marketplace.visualstudio.com/items...l6Snippets | 11:01 | |
11:02
glaukommatos joined
|
|||
masak | yep, 007 is completely busted on Rakudo HEAD | 11:02 | |
lizmat | m: [\orelse] Any, 0, 1 # scare breakage golfed | 11:03 | |
camelia | rakudo-moar 40fe92: OUTPUT«===SORRY!===Cannot find method 'orig'» | ||
11:03
xinming_ joined
|
|||
masak | lizmat: I wonder if we're looking at the same error or not. | 11:04 | |
I'm seeing "Cannot reference undeclared local 'flattening__1'" | |||
masak bisects | 11:05 | ||
I'd say whatever this is, it should be reverted on sight | 11:06 | ||
11:06
brrt joined
|
|||
RabidGravy | sergot, that reminds me I wanted to make a Perl 6 template thingy for DevAssistant | 11:06 | |
lizmat | masak: pretty sure it's TimToady's last commit | ||
11:06
xinming left
|
|||
lizmat | verifying now | 11:06 | |
11:07
glaukommatos left
|
|||
masak | it's interesting with Travis CI nowadays, I'm much more inclined to stay on top of Rakudo changes :) | 11:07 | |
lizmat | the commit before is ok | 11:09 | |
now double checking TimToady's | |||
aka c27a00ca36b8baaa6d6 | |||
11:09
Zoffix left
11:10
znpy joined
|
|||
lizmat | yup, that's the first one that fails | 11:10 | |
11:11
Zoffix joined
11:16
secwang left,
n0tjack joined
|
|||
masak | I'm not quite there yet, but the set still contains that possibility | 11:19 | |
11:20
rurban joined
11:21
n0tjack left
|
|||
lucs | In Perl 5, arbitrary data could be passed to a module's import() function by doing "use Foo ('some', 'data')". | 11:21 | |
How is something similar (passing arbitrary data to a module when 'use'ing it) done in Perl 6? | |||
El_Che | doe close channels get garbage collected even when the class they where created and consumes is still in scope? | ||
nine | lucs: we have EXPORT functions now | 11:22 | |
lizmat | El_Che: as soon as objects cannot be reached anymore, they're up for GC at some point | ||
lucs | nine: grepping, thanks. | 11:23 | |
lizmat | El_Che: not really an answer, but that's the essence: how it applies to your specific situation, I don't know | ||
11:24
kid51 joined
|
|||
El_Che | lizmat: thx. If I open the channels in a method and pass the around, they won't be part of the instance state and hence I hope them to be GC'ed once the method exits (that's the rationale) | 11:25 | |
masak | ok, c27a00ca36b8baaa6d668c025d76aa3c6b8bd711 confirmed as Bad. | 11:26 | |
people have about 2 minutes to raise objections before I push a revert. | |||
Zoffix | Think of the children! | 11:27 | |
CQ | it's xmas season, don't refuse gifts? :) | ||
lizmat | El_Che: fwiw, if you consume the channels fast enough, I don't think there's much memory footprint to begin with | 11:28 | |
masak | just confirming that the revert makes things work in 007 again. | ||
lizmat | masakL if it had been only that spectest, I would have said: no | 11:29 | |
but if it blocks you working with 007, I'm ++ on it: a commit should never block development | |||
El_Che | lizmat: I am consuming LDAP db's of 500+MB each. One channel read it as records, a second channel sort the record and change small stuff, a third write it to a new file. From the look of it, this 4gv-b VM will kill moar very soon | 11:30 | |
masak | lizmat: yeah, something is clearly wrong. | ||
lizmat: if I were motivated, I guess I could golf exactly what breaks. | |||
lizmat: right now I only know that the 007 test suite hangs, with a Rakudo-internal error message. | 11:31 | ||
indeed, the revert causes the test suite to work again. | |||
pushing. | |||
lizmat | El_Che: well, sorting implies keeping it in memory, I guess | ||
El_Che | lizmat: only one record at the time, though | 11:32 | |
lizmat | ah, so internally, sorting inside the record you mean? | ||
El_Che | yes | ||
dalek | kudo/nom: c5f81ae | (Carl Masak)++ | src/ (5 files): Revert "get reductions thunking for left/list assoc" This reverts commit c27a00ca36b8baaa6d668c025d76aa3c6b8bd711, which breaks, among other things, the 007 test suite with the following message: $ prove -r --exec=perl6 t/ t/features/begin.t .......................... ===SORRY!=== Cannot reference undeclared local 'flattening__1' (And then it hangs.) It also breaks other things, like the spectest suite, and this: <lizmat> m: [\orelse] Any, 0, 1 # scare breakage golfed <camelia> rakudo-moar 40fe92: OUTPUT«===SORRY!===Cannot find method 'orig'» |
||
El_Che | the records are orderen, their attributes aren't, so I need to sort those before I can compare the data consistency | ||
masak | TimToady: if you're interested, I can golf the break in 007. | 11:33 | |
sergot | RabidGravy++ | 11:35 | |
11:41
n0tjack joined
11:46
n0tjack left
|
|||
brrt | completely offtopic, but this in a way the funniest thing i've read all week | 11:48 | |
www.linkedin.com/pulse/mongodb-32-...hn-de-goes | |||
tl;dr mongodb 'supports analytics' by letting itself be wrapped by postgresql, which is bad because....? | 11:49 | ||
(because the author builds a competing database, that is why) | 11:50 | ||
ilmari | s/database/analytics tool/ | 11:51 | |
brrt | right | ||
11:59
snarkyboojum joined,
pdcawley_ joined
12:03
glaukommatos joined
12:04
znpy left
|
|||
lucs | EXPORT question: gist.github.com/lucs/d2fba5bec39f8f677f4f | 12:04 | |
12:04
rindolf joined
12:08
glaukommatos left
|
|||
RabidGravy | lucs, afaik the EXPORT sub must be outside the package | 12:09 | |
lucs | Not sure where I'd put it then :/ | 12:10 | |
Before the "unit module Foo;" line? | 12:11 | ||
12:11
cygx joined
|
|||
RabidGravy | module Foo { .... }; sub EXPORT() { } | 12:12 | |
cygx | lucs: if you want to use an explicit EXPORT sub, the easiest thing to do is not using a unit declaration | ||
RabidGravy | there has to be an advantage to using the block form | 12:13 | |
;-) | |||
lucs | RabidGravy: Having it outside like that, I'm not sure how "use Foo..." will know how to call the right sub EXPORT, but, trying ... | 12:14 | |
RabidGravy | it's per "compilation unit" | 12:15 | |
lucs | I'll need to understand those more clearly :) | 12:16 | |
(now, not sure where to scope my $val) | 12:17 | ||
cygx | lucs: workaround: | 12:19 | |
my &EXPORT; unit module Foo; &EXPORT = sub { say 42; {} }; | 12:20 | ||
RabidGravy | lucs, it is not all quite implemented as per design.perl6.org/S11.html | ||
lucs | cygx: The point is missing: pass the 42 with the 'use': use Foo 42; | 12:21 | |
RabidGravy: Yes, I've been reading that, but I'm not understanding as well as I'd like. | |||
cygx | my &EXPORT; unit module Foo; &EXPORT = sub ($i) { say $i; {} }; | 12:22 | |
or did you mean something else? | |||
lucs | cygx: I meant that last thing, thanks. | ||
(I think, trying...) | |||
12:24
kid51 left
|
|||
_nadim | is it possible, while running tests, to make a module not available? IE, I want to test for the non existance of Terminal::ANSIColors | 12:25 | |
12:26
Ven joined
|
|||
RabidGravy | ouch travis-ci.org/sergot/http-useragen...s/95370459 | 12:28 | |
I was just about to say that Travis seemed to be working again | 12:30 | ||
ilmari | _nadim: Test::Without::Module, Devel::Hide | 12:31 | |
lizmat | ilmari: that appears to be a perl 5 solution? | 12:33 | |
ilmari | lizmat: sorry, I didn't notice which channel this was | 12:34 | |
12:34
rurban left
|
|||
ilmari shoud go for lunch | 12:34 | ||
lizmat | _nadim: I'm afraid there is no solution for that yet | ||
_nadim | thank you for the information :) | 12:37 | |
12:41
rurban joined
|
|||
lucs | cygx: What does the {} represent in &EXPORT = sub ($i) { say $i; {} }; ? | 12:42 | |
RabidGravy | the export function has to return a Map | ||
see what happens if you don't put it there | 12:43 | ||
lucs | I saw that in an error message, but nowhere in the docs :/ | ||
12:43
snarkyboojum left
|
|||
lucs | (Well, not in S11) | 12:43 | |
And what should that map hold? | 12:44 | ||
12:44
sufrostico joined
|
|||
lucs | cygx's example works, but I can't manage to make the Foo::val function visible in foo.pl6. | 12:45 | |
12:47
koo8 joined
|
|||
RabidGravy | { '&val' => sub () { "<$val>" }} | 12:48 | |
would be what you want | |||
lucs | Aha, I tried many variations around that, but not that one, trying ... | 12:49 | |
RabidGravy | it's a map of the names of the things to be exported to the thing | ||
lucs | Hmm... I keep getting Could not find symbol '&val' | 12:52 | |
RabidGravy | single quotes on the LHS | 12:53 | |
lucs | Yep. | ||
vytas | what's the easiest way to wait for new input and eval in the same scope ? | ||
lucs | RabidGravy: Oh, I was invoking with Foo::val (fails), but with just val , it works. | 12:55 | |
RabidGravy | yeah, that's what export does | 12:56 | |
lizmat | vytas: loop { EVAL prompt } | ||
vytas | lizmat, sorry what i meant was that declarations and scope would stay between evals | 12:57 | |
lizmat | vytas: that's tricky, perhaps something like this will do? | 13:01 | |
my $program = ''; loop { EVAL $string ~= prompt } | |||
my $program = ''; loop { EVAL $program ~= prompt('') } # better | 13:03 | ||
13:04
Skarsnik joined
|
|||
vytas | lizmat, wow ++ | 13:04 | |
lucs | RabidGravy: Do you just happen to know all this stuff, and/or am I just reading the wrong documentation? | 13:05 | |
RabidGravy | I think I just "know" it, probably just long term osmosis from the channel | 13:06 | |
lucs | (or, reading the documentation wrong) | ||
RabidGravy: Okay, thanks :) | |||
dalek | c: 480db57 | (Claudio Ramirez)++ | doc/Language/5to6-perlvar.pod: update doc for nl-in and nl-out |
13:07 | |
c: eef2490 | (Claudio Ramirez)++ | doc/ (3 files): update doc for nl-in and nl-out |
|||
c: 4498203 | (Claudio Ramirez)++ | doc/ (4 files): Merge branch 'master' of github.com:perl6/doc |
|||
c: f99e92b | RabidGravy++ | doc/ (3 files): Merge pull request #231 from nxadm/master Update documentation for .nl => .nl-in and .nl-out |
|||
El_Che | according to the 5to6-perlvar is the autoflush var ($|) not implemented in perl6. Is there an other way to force the flush on each write? | 13:08 | |
brrt | my suspicion is that there is a method for that.... | ||
El_Che | I am looking ;) | ||
vytas | of course evaluating previous commands are annoying and troublesome | 13:09 | |
Skarsnik | El_Che, .flush ? | ||
$*OUT.flush ? | |||
El_Che | Skarsnik: no flush in the doc. I'll try it quickly | 13:10 | |
Skarsnik | Wait I was thinking of some Qt code I was looking at. Yes IO::Handle seen to not have something to flush | 13:11 | |
El_Che | it works though :) | 13:12 | |
Skarsnik | m: say IO::Handle.^can("flush"); | 13:13 | |
camelia | rakudo-moar c5f81a: OUTPUT«()» | ||
Skarsnik | m: say IO.^can("flush"); | ||
camelia | rakudo-moar c5f81a: OUTPUT«Too many positionals passed; expected 2 arguments but got 3 in block <unit> at /tmp/gT0dC3hCG0:1» | ||
El_Che | I'll add it to the doc, if no one opposes (being something to be removed or the like) | 13:14 | |
Skarsnik | m: say IO::Handle.^can("flush").elems; | ||
camelia | rakudo-moar c5f81a: OUTPUT«0» | ||
El_Che | it's certainly there and not marked as private | ||
github.com/rakudo/rakudo/blob/d3e8.../Handle.pm | 13:15 | ||
Skarsnik | why ^can does not find it Oo | 13:16 | |
psch | Skarsnik: because the sig specifies IO::Handle:D as invocant | 13:17 | |
m: class A { method foo(A:D $:) { } }; A.can('foo').say; A.new.can('foo').say | |||
camelia | rakudo-moar c5f81a: OUTPUT«(foo)(foo)» | ||
psch | ... | ||
no | |||
:( | |||
Skarsnik | lock/unlock not documented too x) | 13:18 | |
psch | m: say IO::Handle.^mro | 13:19 | |
camelia | rakudo-moar c5f81a: OUTPUT«IO::Handle is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting:1 in method gist at src/RESTRICTED.setting:33 in block <unit> at /tmp/xDai_dvqwg:1» | ||
Skarsnik | m: say IO::Handle.can("flush").elems; | ||
camelia | rakudo-moar c5f81a: OUTPUT«0» | ||
psch | *that* is why | ||
'cause IO::Handle in camelia is an empty class that has RESTRICTED-CLASS and Mu as mro | |||
dalek | c: f6be6c0 | (Claudio Ramirez)++ | doc/Type/IO/Handle.pod: Add method flush |
||
c: b9f6fb0 | nxadm++ | doc/Type/IO/Handle.pod: Merge pull request #232 from nxadm/master Add method flush |
|||
psch | Skarsnik: cf. src/RESTRICTED.setting | 13:20 | |
El_Che | what a man has to do to get the memory usage down :) | ||
Skarsnik | It's sad rakudo take so much ram to build. I can't build it in cloud9 :( | 13:21 | |
El_Che | build it locally and upload it? | 13:22 | |
Skarsnik | my virtualbox decided that it could not see my intel virtualisation so I can't run 64 bits guess anymore x) But I will look at using a ssh workspace | 13:25 | |
grondilu wonders why we don't have an Int.ordinal method | 13:26 | ||
m: say 'first', 'second'... *; | 13:27 | ||
camelia | rakudo-moar c5f81a: OUTPUT«(...)» | ||
grondilu | m: say ('first', 'second'... *)[^10]; | ||
camelia | rakudo-moar c5f81a: OUTPUT«(first second secone seconf secong seconh seconi seconj seconk seconl)» | ||
grondilu | lol | ||
Skarsnik | fun | ||
El_Che | :) | ||
secong would be a nice name for a language. C-Kong | 13:28 | ||
Skarsnik | use MONKEY-SLANG; | 13:30 | |
13:30
lustlife` left
13:34
znpy joined
|
|||
dalek | kudo/nom: fadbb54 | peschwa++ | src/RESTRICTED.setting: Remove RESTRICTED override for not-anymore-existing class IOU. |
13:34 | |
13:35
fooflare joined
13:36
n0tjack joined
|
|||
MadcapJake | m: sub prefix:<u+^>(Int $i) {my @bin = $i.base(2).split('')[1..*]; my @zer = @bin.unshift: |('0' xx 16 - @bin.elems); my @com = @zer.map: { $_ ~~ '0' ?? '1' !! '0' }; return :2(@com.join).base(10).Int}; say u+^123; | 13:38 | |
camelia | rakudo-moar c5f81a: OUTPUT«65288» | ||
MadcapJake | why does that output 65288 but the adventcode question says it should output 65412?? | ||
13:38
fooflare left
|
|||
[Coke] | should we make Configure.pl default to moar-backend only? | 13:39 | |
Skarsnik | it build parrot too? | 13:40 | |
13:40
n0tjack left
|
|||
MadcapJake | my intent is to make a bitwise complement that doesn't return a negative result (which to the adventcode puzzle gives you `NOT 123 -> 65412`, but I can't seem to arrive at that result) | 13:41 | |
Skarsnik | Should perl6 pod be called pod6? for github.com/perl6/doc/issues/167 , well it's just an example but there is nothing to tell if a .pod is perl6 or perl5 | ||
psch | m: say 123.base(2) | ||
camelia | rakudo-moar c5f81a: OUTPUT«1111011» | ||
psch | m: sub prefix:<u+^>(Int $i) {my @bin = $i.base(2).comb; my @zer = @bin.unshift: |('0' xx 16 - @bin.elems); my @com = @zer.map: { $_ ~~ '0' ?? '1' !! '0' }; return :2(@com.join).base(10).Int}; say u+^123; | 13:43 | |
13:43
ChristopherBotto joined
|
|||
camelia | rakudo-moar c5f81a: OUTPUT«65412» | 13:43 | |
psch | MadcapJake: i'm guessing you still had a '' at the end from split('') | ||
13:43
ZoffixW joined
|
|||
ZoffixW | m: subset Foo of Str where any <foo bar>; sub foo (Foo $x) { say $x }; foo 'foo'; foo 'ber'; | 13:43 | |
camelia | rakudo-moar c5f81a: OUTPUT«fooConstraint type check failed for parameter '$x' in sub foo at /tmp/qMmdyOI6DI:1 in block <unit> at /tmp/qMmdyOI6DI:1» | ||
psch | MadcapJake: .comb is better suited for that use-case, in any case | ||
ZoffixW | Didn't that used to mention the name of the subset in the error message? | ||
m: subset Foo of Str where any <foo bar>; sub foo (Int $x) { say $x }; foo 'foo'; foo 'ber'; | 13:44 | ||
MadcapJake | psch: cool thanks! | ||
camelia | rakudo-moar c5f81a: OUTPUT«5===SORRY!5===Calling foo(Str) will never work with declared signature (Int $x)at /tmp/51QTaIggrp:1------> 3<foo bar>; sub foo (Int $x) { say $x }; 7⏏5foo 'foo'; foo 'ber';Calling foo(Str) will never work with declared signature (Int …» | ||
_nadim | please tell me thaat someone has a module that, when used instead for Test, makes the framework "tranparent". If not, and if there is more than me who wants it, I'll write it. I have always hated this in P5 | ||
ZoffixW | huh. I'm getting a different error locally: Type check failed in binding $set; expected Int but got Str | ||
[Coke] | (parrot), no, it includes the jvm. | ||
"tranparent" ? | 13:45 | ||
ZoffixW | _nadim, what do you mean "makes transparent"? | ||
psch | [Coke]: i'd agree with "perl Configure.pl" being equivalent to "perl Configure.pl --backends=moar --prefix=./install" | ||
[Coke]: i usually also use --make-install, but people might not want that vOv | |||
_nadim | diag works like say ... say works normally ... is defined ... | 13:46 | |
Skarsnik | ? | ||
ZoffixW | _nadim, still not following. | ||
psch | _nadim: what would &is do in that transparent framework? | ||
[Coke] | your transparent sounds like "this test framework is broken" to me. | 13:47 | |
13:47
PotatoGim joined
|
|||
_nadim | psch: the same thing or nothing if one would prefer | 13:47 | |
when a test fails, I want to be able to very quickly run it without the framework | 13:48 | ||
ZoffixW | _nadim, but how would you test things? | ||
without is | 13:49 | ||
Skarsnik | perl6 -I lib t/mytest.t ? | ||
_nadim | ZoffixW: often, I need to see output, dmp data structures to fix the tests | ||
psch | _nadim: well, if it seems useful to you, go for it. i don't quite understand the purpose | ||
ZoffixW neither | |||
Skarsnik | run the test directly, it will display everything you output | 13:50 | |
ZoffixW | _nadim, I think you may simply be asking for the -v flag to prove :) | ||
Skarsnik | only prove hide it | ||
_nadim | I will probably write something, it will be easier to describe after I have written it :) | ||
ZoffixW | Sure | ||
Write all the things! :) | |||
psch | isolating a breaking test case isn't annoying enough for me to want a module that i replace Test with instead of running the test alone | ||
_nadim | ZoffixW: not -v, I actually run prove with -v all the time | ||
psch | like, < copy & paste the breaking test-case into an -e or camelia > is usually fine with me :) | 13:51 | |
Skarsnik | I run the test directly when I want to test a test x) | ||
13:51
cygx left
|
|||
ZoffixW | _nadim, then I'm not at all sure what issue you're trying to solve. What you describe is hinting me at my P5 version of metacpan.org/pod/Test::Mojo::Role::Debug | 13:51 | |
_nadim | psch: you are starting to get what I want, except that I don't want to copy paste | ||
ZoffixW | _nadim, so I'd say write the module and make it available :) | ||
psch | _nadim: well, as i said, if it seems useful to you go for it | 13:52 | |
_nadim | that's the plan ;) | ||
psch | me personally i think copying and pasting the test case is cleaner than altering a (potentially upstream) test-file vOv | ||
don't wanna start commit broken test files again :P | |||
especially not to roast >_> | 13:53 | ||
ZoffixW never had to copy-paste tests :S | |||
ISAGN for DIE_ON_FIRST_FAIL type of thing. If there's a failure, stop further testing. | |||
(I think I already mentioned that) | |||
Skarsnik | There is a DIE on FIRST FAIL? | 13:54 | |
ZoffixW | Is that a question or...? | ||
Skarsnik | Yes, sorry | ||
ZoffixW | There is Test::Most in P5 that does that sort of thing. Makes doing TDD much easier | ||
Skarsnik | It was annoying when testing stuff in DBIish x) | 13:55 | |
"Oh test 10 has failed, wait there is 40 tests left" | |||
psch | m: my \blk = (-> --> Int { Str }); say blk.returns; say blk() | 13:56 | |
camelia | rakudo-moar fadbb5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VqmQ1Eq46lVariable '&blk' is not declaredat /tmp/VqmQ1Eq46l:1------> 3 --> Int { Str }); say blk.returns; say 7⏏5blk()» | ||
psch | eh | ||
13:56
prammer joined
|
|||
psch | m: my &blk = (-> --> Int { Str }); say blk.returns; say blk() | 13:56 | |
camelia | rakudo-moar fadbb5: OUTPUT«Method 'returns' not found for invocant of class 'Str' in block <unit> at /tmp/7KsFZ1L7D8:1» | ||
psch | m: my &blk = (-> --> Int { Str }); say &blk.returns; say blk() | ||
camelia | rakudo-moar fadbb5: OUTPUT«(Int)(Str)» | ||
psch | i am looking at about where that could be corrected | ||
but i don't get it :/ | |||
ZoffixW | m: class Meow { subset Foo of Str where any <foo bar>; method foo (Foo $x) { say $x }; }; Meow.new.foo: 'foo'; Meow.new.foo: 'ber'; | 13:57 | |
camelia | rakudo-moar fadbb5: OUTPUT«fooConstraint type check failed for parameter '$x' in method foo at /tmp/hc0UhYrCM0:1 in block <unit> at /tmp/hc0UhYrCM0:1» | ||
ZoffixW | ^^ that error is LTA. It should mention that Foo type was expected | ||
As in this case: | |||
m: class Meow { subset Foo of Str where any <foo bar>; has Foo $!bar = 'meow'; method foo (Foo $x) { say $x }; }; Meow.new.foo: 'foo'; Meow.new.foo: 'ber'; | |||
camelia | rakudo-moar fadbb5: OUTPUT«Type check failed in assignment to $!bar; expected Meow::Foo but got Str in block <unit> at /tmp/QM2m1KlW7Q:1» | ||
RabidGravy | WTF is "Serialization Error: Unimplemented case of read_ref" all about | 13:58 | |
Skarsnik | In what? | ||
RabidGravy | well, in this case the t/082-exceptions.t in H::UA | 13:59 | |
psch | m: my subset Foo of Str where any <foo bar>; sub f(Foo $x) { }; &f.signature.say | ||
camelia | rakudo-moar fadbb5: OUTPUT«(Str $x where { ... })» | ||
psch | ZoffixW: i don't know if we can still know that. as per above, the subset type constraint gets translated into a Str type with a where clause | 14:00 | |
ZoffixW: whereas the container for a variable (in the assignment case) probably knows it comes from a subset | |||
ZoffixW | Too bad. | 14:02 | |
My brag-tweet would've been more awesome with included useful error messages mentioning the subtype :) twitter.com/zoffix/status/674589605325180928 | |||
psch | ZoffixW: well, feel free to look closer at the source. it starts around src/Metamodel/BOOTSTRAP.nqp:475-505 | ||
ZoffixW | I don't know how to run that stuff :) | ||
Skarsnik | RabidGravy, I wil blame a weird error in sockets? | 14:04 | |
ZoffixW | Like, I see the README mentions how to build the entire nqp, but do you guys rebuild the whole thing every time you make a change and just want to see what the effect was? github.com/perl6/nqp/ | ||
lizmat | ZoffixW: I usually do "make install" which usually does the right thing | ||
ZoffixW: except in a case of a NQP version bump | |||
ZoffixW | lizmat, does that take forever to run? | 14:05 | |
14:05
glaukommatos joined
|
|||
psch realizes how spoiled all those "i only use r-m" people actually are... :P | 14:06 | ||
ZoffixW | r-m? | ||
moritz | ZoffixW: rakudo-moarvm | ||
psch | ZoffixW: fwiw, on the machine i hack on rakudo a complete rakudo-moar build - with building moar, nqp and rakudo - takes 3 minutes | ||
ZoffixW: contrast with iirc almost 15 minutes r-j :P | 14:07 | ||
lizmat | my settings build cycle using make install is at about 80 seconds | ||
this is excluding any Moar or NQP building | |||
psch | ZoffixW: if you only change stuff below $rakudo-git-path/src you only need to rebuild rakudo itself too, which as lizmat++ points out might be less than two minutes | 14:08 | |
lizmat | psch: once upon a time, building with parrot to >5 minutes | ||
*took | |||
arnsholt | Just parsing the setting took at least two minutes on this machine with Parrot, IIRC | 14:09 | |
ZoffixW | k, I'll try to play around with the guts on the weekend. | 14:10 | |
arnsholt | I remember being a bit envious of jnthn's machine that did the parse stage in about 100 seconds =) | ||
ZoffixW | rakudobrew build moar parse stage took 59seconds on my home box last night :) | ||
14:11
glaukommatos left
14:12
prammer left
|
|||
psch | lizmat: on hack i have real 6m28.179s for r-j with existing nqp-j and an RTE during install-core-dist.pl | 14:12 | |
lizmat | many modules installed maybe ? | 14:13 | |
psch | and stage parse is 5 sec shy of 2 minutes | ||
lizmat: no, Configure.pl | |||
lizmat | ah...:-) | 14:14 | |
14:14
ZoffixW left
|
|||
RabidGravy | "Stage parse : 182.712" on a 1.58GHz celeron :-\ | 14:15 | |
psch | hack is a pretty beefy machine, i think | 14:16 | |
model name : Intel Core i7 9xx (Nehalem Class Core i7) cpu MHz : 2399.996 | |||
yup :P | |||
14:17
yaewa joined
14:18
prammer joined
14:19
marchelzo joined
14:20
moei joined
|
|||
marchelzo | how can you get everything but the head of a list? there must be a better way than $mylist.tail($mylist.elems - 1) | 14:20 | |
RabidGravy | why would I be getting "P6M Merging GLOBAL symbols failed: duplicate definition of symbol Response" in a test on travis but not locally? | 14:21 | |
psch | m: my @a = ^10; say @a[1..*] | ||
camelia | rakudo-moar fadbb5: OUTPUT«(1 2 3 4 5 6 7 8 9)» | ||
psch | marchelzo: ^^^ is another way | 14:22 | |
marchelzo | the whatever star is so mystifying | 14:23 | |
14:23
yaewa left
|
|||
moritz | m: my @a = ^10; say @a.tail | 14:24 | |
camelia | rakudo-moar fadbb5: OUTPUT«(9)» | ||
_nadim | marchelzo: my ($ignore, @rest) = @list | ||
marchelzo | _nadim: I like that way | 14:25 | |
but if you don't want to assign the tail to anything then it's weird | |||
Skarsnik | ($head, @list) = @array; | 14:26 | |
probably work x) | |||
_nadim | m: my @list = ^5; my ($ignore, @rest) = @list ; @rest.say | ||
camelia | rakudo-moar fadbb5: OUTPUT«[1 2 3 4]» | ||
grondilu | m: say q{\\} ~~ /'\\'/ | ||
camelia | rakudo-moar fadbb5: OUTPUT«「\」» | ||
psch | m: my @a = ^10; say [*] (($, @) = @a)[1] # | ||
camelia | rakudo-moar fadbb5: OUTPUT«362880» | ||
grondilu was expecting \ | |||
gfldex | m: my @a = (1..10).list; my ($,@rest) = @a; dd @rest; | ||
camelia | rakudo-moar fadbb5: OUTPUT«Array $var = $[2, 3, 4, 5, 6, 7, 8, 9, 10]» | ||
_nadim | m: my @list = ^5; my ($ignore, @rest) = @list ; @list.say ; @rest.say | ||
camelia | rakudo-moar fadbb5: OUTPUT«[0 1 2 3 4][1 2 3 4]» | ||
marchelzo | psch: ok, what the fuck | 14:27 | |
psch | marchelzo: well, ($, @) is a List with two elements | ||
marchelzo | right | ||
_nadim | marchelzo: what do you mean with "not want to assign the tail to anything"? | ||
lizmat | m: my @list = ^5; my ($, @rest) = @list ; @list.say ; @rest.say # no need to name the scalar to be ignnored | 14:28 | |
camelia | rakudo-moar fadbb5: OUTPUT«[0 1 2 3 4][1 2 3 4]» | ||
psch | marchelzo: and (($, @) = @a) puts the first elem of @a into the anon Scalar, and the rest into the anon Array | ||
marchelzo | I didn't know ($, @) = @a was a thing. | ||
psch | marchelzo: of that two element List we take the second element and multiply all elements of *that* afterwards | ||
_nadim | lizmat: tanks, I did try Nil but it complained heavily ;) | ||
marchelzo | I didn't know about anonymous Arrays / Scalars. | ||
grondilu | wth how do I quote a backslash? | ||
m: say q{\} | |||
camelia | rakudo-moar fadbb5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/30d3hzcYzDCouldn't find terminator } (corresponding { was at line 1)at /tmp/30d3hzcYzD:1------> 3say q{\}7⏏5<EOL> expecting any of: }» | ||
marchelzo | _nadim: that I don't want to use the = operator. | 14:29 | |
psch | grondilu: q[] still does some backslash interpolation | ||
m: say Q[\] | |||
camelia | rakudo-moar fadbb5: OUTPUT«\» | ||
psch | grondilu: you want Q{} | ||
grondilu | ok, and in a regex? | ||
psch | m: say q[\qq<\c[SNOWMAN]>] | 14:30 | |
camelia | rakudo-moar fadbb5: OUTPUT«☃» | ||
masak | "{ Q{} }" should work in the worst case | ||
_nadim | marchelzo: doc.perl6.org/routine/splice#class_List but why not use the above | 14:32 | |
grondilu | m: say q{\\} ~~ /\x5C ** 2/ | ||
camelia | rakudo-moar fadbb5: OUTPUT«Nil» | ||
grondilu | m: say Q{\\} ~~ /\x5C ** 2/ | 14:33 | |
camelia | rakudo-moar fadbb5: OUTPUT«「\\」» | ||
14:33
kaare_ joined
|
|||
marchelzo | _nadim: I will in cases where I want to assign the tail to something | 14:33 | |
grondilu | m: say Q{\\} ~~ /'\\'/ | ||
camelia | rakudo-moar fadbb5: OUTPUT«「\」» | ||
grondilu | ^what am I missing here? | ||
marchelzo | it's good to know multiple ways I guess | ||
moritz | grondilu: that \ escapes, even in single-quoted strings | 14:34 | |
grondilu | so what the equivalent of Q{} inside a regex? | 14:35 | |
_nadim | then put something into the construct. ($, @the_thing_you_want_to_assigne_to) = @source | 14:36 | |
marchelzo: ^^ | |||
marchelzo | right | ||
grondilu | m: say Q{\\} ~~ /'\\\\'/ | ||
camelia | rakudo-moar fadbb5: OUTPUT«「\\」» | ||
marchelzo | ok thanks | ||
grondilu | m: say Q{\\} ~~ /\\\\/ | 14:37 | |
camelia | rakudo-moar fadbb5: OUTPUT«「\\」» | ||
grondilu | ^that will do I guess | ||
14:39
jdrab joined
14:45
sunnavy joined
14:52
zakharyas joined
14:55
Ven left
14:57
skids joined
|
|||
moritz | eek | 14:57 | |
found a very nasty test code bug at work | |||
lizmat | eek! | ||
moritz | which would, under some not-too-obscure conditions, swallow all exceptions | 14:58 | |
and since test data setup is very fiddly, test writes tend to avoid doing it, and stuff their test into existing files with existing test data | |||
colomon found a bug a few days ago for $work which under obscure-ish conditions would cause his code to process entirely incorrect data. | |||
hahainternet just fixed a bug that resulted in 'nonsense' data production, as it mistook one field for another in a cache | 14:59 | ||
python unfortunately | |||
moritz | so now we have a few a test files with huge amounts of tests in each, and some of them are downright bogus, and nobody ever noticed | ||
hahainternet: I had a similar-ish bug recently, where a cache would be written by a wrong key, causing people to be mis-identified in our ticket system | 15:00 | ||
not at login time, but at "send this person a notification" time | |||
15:00
loren joined
15:01
rurban left
|
|||
loren | evening, perl6, long time no see.. | 15:01 | |
15:01
rurban joined
|
|||
hahainternet | moritz: i was naive and thought i could use a postgres array with a key field first, and then the rest of the fields deterministically ordered | 15:01 | |
later switching to the key field just being part of the array order, but didn't switch from using array[0] as the search key | 15:02 | ||
whoops :D | |||
this is why i am so interested in strongly type restricted ORMs in p6 | |||
with a bit of annotation i could easily have had PrimaryKey and FilterKey types, and at least noticed there was something wrong :D | 15:03 | ||
also hi @ loren | |||
15:03
AlexDaniel joined
|
|||
moritz | hahainternet: an assumption later, silently invalidated. Yes, that's a problem | 15:04 | |
15:04
glaukommatos joined
|
|||
moritz | hahainternet: in my case (test bug) it was reckless use of "goto" | 15:04 | |
Skarsnik | feel free to write a orm that use attr.WHY x) | ||
ChoHag | Does :exists work on Positionals? | ||
loren | I give up build perl6 under msys2 , there are many path problem. Though i success make it once, i wonder it's a accident.... | 15:05 | |
hahainternet, hi .. | |||
hahainternet | Skarsnik: i learned about .WHY only yesterday, looking forward to finding a use | 15:06 | |
loren | ChoHag, may be not, i think .. | ||
lizmat | m: my @a; @a[3] = Any; say @a[*]:exists | 15:07 | |
camelia | rakudo-moar fadbb5: OUTPUT«(False False False True)» | ||
lizmat | ChoHag: ^^^ | ||
moritz | lizmat++ # data points for RT #126842 | 15:08 | |
15:08
dalek left
|
|||
jnthn | wtf :/ | 15:08 | |
dalek-- | |||
lizmat | moritz: fwiw, the run with nqp::force_gc is still running at 22K iterations | ||
Skarsnik | hahainternet, could probably be used to say has $.id; #db=PrimaryKey and have an ORM class mapping that x) | ||
15:08
glaukommatos left
15:09
dalek joined,
ChanServ sets mode: +v dalek
|
|||
hahainternet | wb dalek | 15:09 | |
15:09
llfourn_ left
|
|||
loren | lizmat, will be work like this? sub my(Str $str?) { if $str:exists { } } | 15:09 | |
lizmat | loren: that's not a Positional | 15:10 | |
ChoHag | Nifty. | ||
jnthn | Anyway, I just pusehd a few commits, one of which adds a `use experimental`, and is cached is now needing `use experimental :cached`. | ||
RabidGravy | $str.defined | ||
jnthn | Also fixed that the newline pragma wasn't installed by make install. | ||
loren | eh, lizmat | ||
jnthn | loren: Just use if $str.defined | 15:11 | |
lizmat | loren: something more Perl 6ish: | 15:12 | |
m: my $a; with $a { .say } | |||
camelia | ( no output ) | ||
lizmat | m: my $a = 42; with $a { .say } | ||
camelia | rakudo-moar fadbb5: OUTPUT«42» | ||
jnthn | yes, or with :) | ||
psch | jnthn: do you have an idea re: RT #126232? i had thought adding a p6typecheckrv to the block could work, but it doesn't | 15:13 | |
15:13
jdrab left,
Ven joined
|
|||
psch | m: (-> --> Int { Str })() # for reference | 15:13 | |
camelia | ( no output ) | ||
loren | I just think isn't it $str:eixsts cool than $str.defined, haha | 15:14 | |
jnthn, lizmat em, got it | |||
masak | loren: no, :exists is an adverb on hash access | ||
lizmat | masak: or array access | 15:15 | |
masak | or what lizmat said | ||
m: my %h; say %h<foo> :exists | |||
camelia | rakudo-moar fadbb5: OUTPUT«False» | ||
ChoHag | m: my %x = a => 42; say %x<b>:!exists; say !(%x<b>:exists); say !%x<b>:exists | ||
camelia | rakudo-moar fadbb5: OUTPUT«TrueTrueUnexpected named parameter 'exists' passed in block <unit> at /tmp/0JAhK8EoFz:1» | ||
masak | loren: the above should be read as `<foo> :exists` -- that's a "unit" | ||
loren | I know that .. , masak | ||
ChoHag | Why is the third say statement an error? | ||
masak | loren: so with `$str :exists`, the adverb is not "sitting on" some operator. and it must do that. | ||
ChoHag | Is ! doing something I don't know about? | 15:16 | |
15:16
rurban left
|
|||
moritz | ChoHag: it's a precedence problem | 15:16 | |
loren | If we can use like that, every variable can use :exists, may be it can be a postfix ? | 15:17 | |
moritz | ChoHag: I guess the adverb binds to the ! instead of the <> | ||
m: my %x = a => 42; say !(%x<b>:exists) | |||
camelia | rakudo-moar fadbb5: OUTPUT«True» | ||
moritz | m: my %x = a => 42; say not %x<b>:exists | ||
camelia | rakudo-moar fadbb5: OUTPUT«True» | ||
gfldex | you use ! unless you use unless | 15:19 | |
gfldex chuckles | |||
CQ | you could double negate it with !unless! ...? | ||
loren | m: my %x = a => 42; say !(%x<b>:exists); if !(%x<b>:exists) { say 'True' }; unless (%x<b>:exists) { say 'True' } | 15:20 | |
ChoHag | m: my %x = a => 42; say not:exists %x<b> | ||
camelia | rakudo-moar fadbb5: OUTPUT«TrueTrueTrue» | ||
rakudo-moar fadbb5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1y0MB7M9ETUndeclared routine: x used at line 1» | |||
ChoHag | m: my %x = a => 42; say !:exists %x<b> | ||
camelia | rakudo-moar fadbb5: OUTPUT«5===SORRY!5=== Error while compiling /tmp/dhbNgODBLXUndeclared routine: x used at line 1» | ||
masak | ChoHag: in the case of `!`, it's "above" `<b>` in the AST, and so `:exists` binds to it | ||
ChoHag: an adverb basically looks back in the source code for something to bind to | 15:21 | ||
ChoHag: but (and this is key) it doesn't take the textually closest thing it finds, but the AST-ly topmost thing | |||
moritz | sounds like worth of an FAQ entry | 15:22 | |
ChoHag | Adverbs are going to needs a lot of clear explaining. They're a very weird thing. | 15:23 | |
dalek | kudo/nom: 2f91998 | jnthn++ | / (3 files): Make macro/quasi experimental. |
||
ast: 4039698 | jnthn++ | / (17 files): Add `use experimental :macros` as needed. |
15:24 | ||
15:25
zakharyas left
15:26
mdaq left
15:33
khw joined
|
|||
zengargoyle | good * #perl6 | 15:39 | |
loren | zengargoyle, o/ | 15:40 | |
15:40
molaf joined
|
|||
AlexDaniel | 「0..($wolf_quantitiy-1)」 hmmm… 「0..^$wolf_quantity」 ! | 15:40 | |
yoleaux | 09:01Z <nine> AlexDaniel: no precompilation; in your module and it will compile your module every time. Its dependencies however will still be precompiled. | ||
15:41
hankache joined
|
|||
hankache | hello #perl6 | 15:41 | |
psch | hm, i did figure something out to make < (-> --> Int { Str })() > throw, but that complains about not being able to serialize a Block during install-core-dist.pl6 :/ | ||
AlexDaniel: probably just < ^$wolf_quantity > instead of < 0..^$wolf_quantity >? | 15:42 | ||
AlexDaniel | psch: correct, that's the next step :) | ||
loren | m: say ^10; | ||
camelia | rakudo-moar 2f9199: OUTPUT«^10» | ||
psch | i mean, they are functionally identical still.. | ||
hankache | m: say (^10); | ||
camelia | rakudo-moar 2f9199: OUTPUT«^10» | ||
psch | m: say @ = ^10; say eager ^10 | 15:43 | |
camelia | rakudo-moar 2f9199: OUTPUT«[0 1 2 3 4 5 6 7 8 9](0 1 2 3 4 5 6 7 8 9)» | ||
loren | m: say [^10]; | ||
camelia | rakudo-moar 2f9199: OUTPUT«[0 1 2 3 4 5 6 7 8 9]» | ||
hankache | m: say |^10 | ||
camelia | rakudo-moar 2f9199: OUTPUT«0123456789» | ||
RabidGravy resorts to adding "diag HTTP::Resonse.^mro>>.perl" to try and understand what is going on in travis | |||
hankache | m: say ^10.WHAT | 15:45 | |
camelia | rakudo-moar 2f9199: OUTPUT«Potential difficulties: Precedence of ^ is looser than method call; please parenthesize at /tmp/OPaSTs7mBW:1 ------> 3say ^107⏏5.WHATUse of uninitialized value of type Int in numeric context in block <unit> at /tmp/OPaSTs7mBW:1…» | ||
AlexDaniel | m: say ^10 .WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
hankache | m: say (^10).WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«(Range)» | ||
hankache | voila! | 15:46 | |
AlexDaniel | m: say (|^10) .WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
AlexDaniel | m: say (|^10).WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«(Slip)» | ||
hankache | oh!! i thought that would return a list ^^ | ||
psch | m: say ^10 .list.WHAT | 15:47 | |
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
AlexDaniel | what's wrong with 「 .WHAT」 ? | ||
psch | m: say (^10) .list.WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
psch | m: say (^10).list.WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«(List)» | ||
AlexDaniel | m: say 5 .WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
psch | huh, when did that break | ||
AlexDaniel | camelia: help | ||
camelia | AlexDaniel: Usage: | ||
..<(nqp-js|star-j|rakudo-MOAR|niecza|nqp-parrot|rakudo-moar|p5-to-p6|debug-cat|pugs|nqp-jvm|nqp-moarvm|star-m|prof-m|std|rakudo-jvm|rPn|nPr|r-jvm|rj|rn|nrP|r-j|nqp|perl6|rakudo|Prn|star|n|nqp-m|nr|sm|nom|rnP|nqp-mvm|P|M|p56|Pnr|m|r|rm|sj|p6|nqp-q|r-m|nqp-p|nqp-j|j)(?^::\s(?!OUTPUT)) $perl6_program> | |||
hankache | m: 5.WHAT.say | 15:48 | |
camelia | rakudo-moar 2f9199: OUTPUT«(Int)» | ||
hankache | m: say 5.WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«(Int)» | ||
AlexDaniel | hmm, no way to tell camelia to run it on 2015.11? | ||
hankache | AlexDaniel you have a space after 5 | ||
AlexDaniel | hankache: so what | ||
psch | star-m: say 5 .WHAT | 15:49 | |
camelia | star-m 2015.09: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YDmUQYVYQDTwo terms in a rowat /tmp/YDmUQYVYQD:1------> 3say 57⏏5 .WHAT expecting any of: infix infix stopper postfix statement end statement m…» | ||
psch | ah, too old for that | ||
AlexDaniel | hankache: I bet that it was working | ||
dalek | c: 606d556 | (Wenzel P. P. Peppmeyer)++ | doc/Language/traps.pod: add trap of adverb precedence |
||
c: 6f59d83 | (Wenzel P. P. Peppmeyer)++ | doc/Language/traps.pod: Merge pull request #233 from gfldex/master add trap of adverb precedence |
|||
AlexDaniel | m: 5 .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«5» | ||
AlexDaniel | m: 5 .WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
AlexDaniel | m: 5 .WHICH | 15:50 | |
camelia | ( no output ) | ||
AlexDaniel | m: 5 .sin.say | ||
camelia | rakudo-moar 2f9199: OUTPUT«-0.958924274663138» | ||
hankache | AlexDaniel: dunno just saying | ||
ilmari | m: 5 .WHAT .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
AlexDaniel | hankache: look ↑ it works | ||
psch | m: say 5 .++ | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TvwB0m7vKsUnsupported use of . to concatenate strings; in Perl 6 please use ~at /tmp/TvwB0m7vKs:1------> 3say 5 .+7⏏5+» | ||
AlexDaniel | but not with .WHAT | ||
gfldex | m: my %x = a => 42; say !%x<b>:exists; CATCH { default { .WHAT.say } } | 15:51 | |
camelia | rakudo-moar 2f9199: OUTPUT«(AdHoc)» | ||
hankache | m: say (5) .WHAT | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
gfldex | not sure i like that to be AdHoc | ||
hankache | ok i give up | ||
no spaces for WHAT | |||
ilmari | m: pi.sin.say | ||
camelia | rakudo-moar 2f9199: OUTPUT«1.22464679914735e-16» | ||
hankache | AlexDaniel: is this a bug? | 15:52 | |
AlexDaniel | m: π . sin . say | ||
camelia | rakudo-moar 2f9199: OUTPUT«1.22464679914735e-16» | ||
AlexDaniel | hankache: yes, probably | ||
15:52
prammer left
|
|||
hankache | m: say "helllo" .WHAT | 15:52 | |
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
psch | m: 5 .Real.WHAT.say # this is the curious bit imo | ||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
AlexDaniel | if not, then at least it is LTA because it lacks the line number… | 15:53 | |
AlexDaniel submits rakudobug… | |||
ilmari | m: say sin pi/2 | ||
camelia | rakudo-moar 2f9199: OUTPUT«1» | ||
hankache | m: say 5 . Real | ||
camelia | rakudo-moar 2f9199: OUTPUT«5» | ||
AlexDaniel | j: π . WHAT | ||
hankache | weird | ||
camelia | rakudo-jvm 6c0f93: OUTPUT«===SORRY!===Method call must either supply a name or have a child node that evaluates to the name» | ||
AlexDaniel | hankache: one reason why you might want to use it is in 「^10 .say」 case | 15:54 | |
hankache: otherwise you need parens | |||
m: ^10.say | |||
camelia | rakudo-moar 2f9199: OUTPUT«Potential difficulties: Precedence of ^ is looser than method call; please parenthesize at /tmp/yznGid3Yyh:1 ------> 3^107⏏5.sayWARNINGS:Useless use of "^" in expression "^10.say" in sink context (line 1)10» | ||
AlexDaniel | m: ^10 .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«^10» | ||
AlexDaniel | m: (^10).say | ||
camelia | rakudo-moar 2f9199: OUTPUT«^10» | 15:55 | |
hankache | AlexDaniel aha ok | ||
psch | cb25b2f475f31335d77d018474482aceec2c74de is the original "spaces around infix:<.>" commit, checking if that actually worked for .WHAT before | ||
i'm pretty sure it did, but it's a good start for a bisect anyway :P | |||
15:55
abraxxa left
|
|||
hankache | I am a big fan of putting parentheses everywhere | 15:56 | |
AlexDaniel | psch: oh wow, you are bisecting it. I'll wait then | ||
RabidGravy | okay I put that diag in and now the test passes, this actually sucks | ||
hankache | i always get precedence messed up | ||
AlexDaniel hates parentheses… | 15:57 | ||
psch | AlexDaniel: well, the RT fix i was working on is running into CURLI-related problems, which i don | ||
't quite feel up to look into | |||
hankache should learn more about precedence | 15:58 | ||
AlexDaniel | m: ^10 .^methods.say | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IVXMYbL_BGUnsupported use of . to concatenate strings; in Perl 6 please use ~at /tmp/IVXMYbL_BG:1------> 3^10 .^7⏏5methods.say» | ||
AlexDaniel | hmm… | ||
hankache | . to concatenate!! | 15:59 | |
zengargoyle | AlexDaniel: ^methods is a macro or something... | ||
hankache | Devil get out of camelia!! | ||
psch | m: Nil .?say | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/UQCoK1BjKyUnsupported use of . to concatenate strings; in Perl 6 please use ~at /tmp/UQCoK1BjKy:1------> 3Nil .?7⏏5say» | ||
psch | only the normal method dot works with space | ||
all the mutators for it don't | |||
hankache starts incantation | |||
psch | because we look for an ident directly after the dot (minus whitespace) | 16:00 | |
AlexDaniel | I'm not sure if it should not work… | ||
but maybe that's the price for this awesome error message | |||
which in this case is less than awesome | |||
psch | well, .WHAT anywhere in a space-y method call chain didn't work with the original commit either | 16:01 | |
so it's at least not a regression | |||
AlexDaniel | okay, interesting | ||
psch | probably 'cause .WHAT doesn't go the normal QAST::Op(:op<callmethod>,...) route | ||
moritz | right, it's macro-Y | 16:02 | |
psch | which fits the error message, 'cause we apparently build such an Op but don't populate the children correctly, because .WHAT isn't a method that can be called with callmethod | ||
hankache | what is a slip? | 16:04 | |
16:04
znpy left
|
|||
hankache | the result of flattening? | 16:04 | |
m: say (|^10).WHAT | 16:05 | ||
camelia | rakudo-moar 2f9199: OUTPUT«(Slip)» | ||
AlexDaniel | m: say 5 . WHICH | ||
camelia | rakudo-moar 2f9199: OUTPUT«Int|5» | ||
hankache | and what's the difference between slip and list | ||
? | |||
pyrimidine | I'm seeing an error pop up that appears to be from precomp: gist.github.com/cjfields/ebe5d55f76041b34e6eb | ||
The plugin in this case is loaded dynamically here: github.com/cjfields/bioperl6/blob/...IO.pm6#L36 | 16:07 | ||
Based on the timing, I think it's in the plugin, not in SeqIO. any way to debug this? | 16:09 | ||
Skarsnik | No idea, there is this bug with other method in similar code | ||
nine | pyrimidine: perl6 --ll-exception might give us further information | 16:10 | |
pyrimidine | nine: will give that a try | ||
marchelzo | is lines()[0] the best way to read one line? | 16:11 | |
ugexe | .get | 16:12 | |
marchelzo | ugexe: thanks | ||
16:13
FROGGS joined
|
|||
AlexDaniel | by the way, what is 「.?」 ? | 16:14 | |
m: Nil.?say | |||
camelia | rakudo-moar 2f9199: OUTPUT«Nil» | ||
ugexe | call method say if it exists | ||
AlexDaniel | right | ||
thanks | |||
16:15
brrt left
|
|||
pyrimidine | nine: bingo, worked, see second gist here: gist.github.com/cjfields/ebe5d55f7...-exception | 16:15 | |
nine: I suppose I could also submit as a bug. Strangely enough it appears to work, but I do see some oddities with the class in the plugin which I need to diagnose a bit more. Could try turning off precomp for that module, see if it fixes the issue | 16:19 | ||
16:20
dwarring left
|
|||
psch | m: say ({ a => 1, b => 2 }).WHAT | 16:23 | |
camelia | rakudo-moar 2f9199: OUTPUT«(Hash)» | ||
psch | hm | ||
that's really weird | 16:24 | ||
16:24
marchelzo left
|
|||
psch | like, i've added on line to Perl6::Actions.pblock, and that makes that bit of code say (Block) instead | 16:25 | |
[Coke] | ORMS: just say no. | ||
16:26
zengargoyle left,
joeschmoe joined,
hankache left
|
|||
psch | huh, maybe not... | 16:26 | |
[Coke] | jnthn++ #experimental! | ||
16:26
zengargoyle joined
|
|||
joeschmoe | m: 'oldstring' ~~ 's/oldstring/newstring/'; .say | 16:28 | |
camelia | rakudo-moar 2f9199: OUTPUT«(Any)» | ||
joeschmoe | I want it to say newstring what am i doing wrong | 16:29 | |
ilmari | m: $_ = 'oldstring'; s/oldstring/newstring/; .say | 16:30 | |
camelia | rakudo-moar 2f9199: OUTPUT«newstring» | ||
joeschmoe | thanks i was missing $_ = | ||
the default variable | |||
ilmari | also, you were just smart-matching one string against another | 16:31 | |
FROGGS | joeschmoe: don't wrap your regexes in quotes | ||
m: 'oldstring' ~~ s/oldstring/newstring/; .say | 16:32 | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot modify an immutable Str in block <unit> at /tmp/ZQt37OfOCc:1» | ||
joeschmoe | m: 'oldstring' ~~ s/oldstring/newstring/; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot modify an immutable Str in block <unit> at /tmp/4W8daPWGUs:1» | ||
Hotkeys | hello people of perland | ||
joeschmoe | m: $_ = 'oldstring' ~~ s/oldstring/newstring/; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot modify an immutable Str in block <unit> at /tmp/p2yDVz2SiK:1» | ||
FROGGS | joeschmoe: use the .subst method if you want to operate on constant strings | ||
psch | hrm, how *does* pblock know if it's a Block or a Hash..? :/ | ||
FROGGS | psch: it guesses | ||
joeschmoe | m: $_ = 'oldstring';s/oldstring/newstring/; .say | 16:33 | |
camelia | rakudo-moar 2f9199: OUTPUT«newstring» | ||
16:33
ab6tract joined
|
|||
joeschmoe | yeah i did it | 16:33 | |
ab6tract | o/ | ||
FROGGS | psch: grep for 'is_hash' in the actions | ||
psch | FROGGS: ahh, that helps. although i don't know if that's too late to attach the p6typecheckrv... | 16:34 | |
16:35
rhr joined
|
|||
psch | but that does explain why everything turned into Blocks for me with adding the p6typecheckrv in pblock | 16:35 | |
joeschmoe | m: $_ = 'oldstring';d/old/; .say | 16:36 | |
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AlXlGaNaWQMissing required term after infixat /tmp/AlXlGaNaWQ:1------> 3$_ = 'oldstring';d/old/7⏏5; .say expecting any of: prefix term» | ||
joeschmoe | what is the delete letter substitute is s/../ what is delete | 16:37 | |
16:38
marchelzo joined
|
|||
marchelzo | how reverse a Str? | 16:38 | |
I'm a native English speaker, I swear. | |||
FROGGS | m: say 'hello'.flip | ||
camelia | rakudo-moar 2f9199: OUTPUT«olleh» | ||
FROGGS | marchelzo: ^^ | 16:39 | |
marchelzo | ah, so _that's_ what flip does | ||
FROGGS | :D | ||
psch | m: $_ = "foo"; tr:d/o//; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«f» | ||
marchelzo | is flip only for strings? | ||
psch | m: $_ = "foo"; tr:d/o/u/; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«fuu» | ||
psch | hm | ||
marchelzo | I was thinking .comb.reverse.join | ||
psch | i thought i had implemented tr:d :o | ||
16:39
lucasb joined
|
|||
FROGGS | marchelzo: I think so... .reverse is for lists | 16:39 | |
joeschmoe | so i need tr: | 16:40 | |
_nadim | Hi, there a class that is either a Str or an Int? | ||
ilmari | m: 'hello'.comb.reverse.join.say | ||
camelia | rakudo-moar 2f9199: OUTPUT«olleh» | ||
mrf | _nadim: Cool | ||
IIRC | |||
FROGGS | _nadim: can you rephrase that? | ||
_nadim | thanks | ||
FROGGS | m: say Str.^mro; | 16:41 | |
ilmari | m: <42>.WHAT.say | ||
camelia | rakudo-moar 2f9199: OUTPUT«((Str) (Cool) (Any) (Mu))» | ||
rakudo-moar 2f9199: OUTPUT«(IntStr)» | |||
_nadim | is there a class that can contain a Str or an Int | ||
FROGGS | m: say Int.^mro; | ||
camelia | rakudo-moar 2f9199: OUTPUT«((Int) (Cool) (Any) (Mu))» | ||
psch | m: my $x = <5>; say $x.isa(Str); say $x.isa(Int) | ||
camelia | rakudo-moar 2f9199: OUTPUT«TrueTrue» | ||
ilmari | m: say IntStr.^mro | ||
camelia | rakudo-moar 2f9199: OUTPUT«((IntStr) (Int) (Str) (Cool) (Any) (Mu))» | ||
FROGGS | _nadim: an IntStr is basically a string that look like an Int | ||
mrf | I thought IntStr was for quoted numbers. rather than Int || Str. | 16:42 | |
joeschmoe | m: $_ = "your dumb smart"; tr:d/d*b//; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«your um smart» | ||
joeschmoe | yeah i did it cool | ||
what is the "tr:" thing called | 16:43 | ||
FROGGS | translate | ||
joeschmoe | got it | ||
thanks Froggs and psch | 16:44 | ||
m: $_ = "your dumb smart"; tr:d/r*s//; .say | 16:45 | ||
camelia | rakudo-moar 2f9199: OUTPUT«you dumb mat» | ||
joeschmoe | m: $_ = "your dumb smart"; tr:d/d..b//; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«your dumb smart» | ||
RabidGravy | okay let's try this all again | 16:46 | |
joeschmoe | m: $_ = "your dumb smart"; tr:d/dumb//; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«yor sart» | ||
AlexDaniel | you need substitute I guess | ||
joeschmoe | m: $_ = "your dumb smart"; tr:d/"dumb"//; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«yor sart» | ||
AlexDaniel | m: $_ = "your dumb smart"; s/dumb\s+//; .say | ||
camelia | rakudo-moar 2f9199: OUTPUT«your smart» | ||
FROGGS | you're* | 16:47 | |
(btw) | |||
joeschmoe | Your're smart FROGGS | ||
16:47
n0tjack joined
|
|||
FROGGS | :P | 16:47 | |
AlexDaniel | FROGGS: well, unless you copy-paste it | 16:48 | |
16:48
znpy joined
|
|||
joeschmoe | So my ultimate goal is to get rid of all the tracking junk in google links via a regex so i can copy and paste it into instapaper | 16:49 | |
AlexDaniel | m: $_ = "your dumb smart"; s/dumb\s+//; "$_ dog".say | ||
camelia | rakudo-moar 2f9199: OUTPUT«your smart dog» | ||
marchelzo | Why doesn't this work? (*.sort)([1,3,1]) | ||
AlexDaniel | marchelzo: what is it supposed to do? | ||
marchelzo | AlexDaniel: be equivalent to [1,3,1].sort | 16:50 | |
AlexDaniel | m: sort([1,3,1]).say | ||
camelia | rakudo-moar 2f9199: OUTPUT«(1 1 3)» | ||
joeschmoe | That's good Alex | ||
marchelzo | AlexDaniel: I'm not woried about how to actually sort the list, I'm just trying to learn how the Whatever star works. | ||
psch | m: say (*.sort)([1,3,1]) # ...? | 16:51 | |
camelia | rakudo-moar 2f9199: OUTPUT«(1 1 3)» | ||
marchelzo | when I tried it in the repl it said: cannot stringify this | ||
I didn't use say, though. | |||
psch | m: say (*.sort)([1,3,1]).WHAT # ...? | 16:52 | |
camelia | rakudo-moar 2f9199: OUTPUT«()» | ||
marchelzo | Why does that make a difference? | ||
psch | m: say ((*.sort)([1,3,1])).WHAT # ...? | ||
camelia | rakudo-moar 2f9199: OUTPUT«()» | ||
16:52
ZoffixW joined
|
|||
AlexDaniel | what is () ? | 16:52 | |
ZoffixW | m: say ٦1٥٠3 + ٤६੬៩ - ৭۹੧ | ||
camelia | rakudo-moar 2f9199: OUTPUT«65381» | ||
ZoffixW grins | |||
psch | marchelzo: no idea, the REPL has been in varying states of weird for pretty much ever | ||
16:52
n0tjack left
|
|||
marchelzo | psch: ok, well I'm glad that my intuition was right | 16:53 | |
16:55
ZoffixW left
16:56
cognominal left
16:57
prammer joined
|
|||
TimToady | m: say Q{\\} ~~ /「\\」/ | 16:58 | |
camelia | rakudo-moar 2f9199: OUTPUT«「\\」» | ||
TimToady | grondilu: ^^ | ||
m: say 「\\」 ~~ /「\\」/ | 16:59 | ||
camelia | rakudo-moar 2f9199: OUTPUT«「\\」» | ||
AlexDaniel | m: say 「hello world」 | 17:00 | |
camelia | rakudo-moar 2f9199: OUTPUT«hello world» | ||
AlexDaniel | what's the difference between 「」 and ‘’? | ||
TimToady | single quotes still recognize a few backslashes | 17:01 | |
in particluar, the trailing quote, and backslash itself | |||
17:01
prammer left
|
|||
AlexDaniel | m: say 'hello \\ world' | 17:01 | |
camelia | rakudo-moar 2f9199: OUTPUT«hello \ world» | ||
AlexDaniel | m: say 「hello \\ world」 | ||
camelia | rakudo-moar 2f9199: OUTPUT«hello \\ world» | ||
psch | and \qq | 17:02 | |
AlexDaniel | right | ||
TimToady | 「\\」 is just the non-Texas version of Q[\\] | ||
psch | m: say 'a \qq[\c[SNOWMAN]]' | ||
camelia | rakudo-moar 2f9199: OUTPUT«a ☃» | ||
TimToady | m: say 'a pair of \Q[\\]' # aww | 17:04 | |
camelia | rakudo-moar 2f9199: OUTPUT«a pair of \Q[\]» | ||
marchelzo | Why is +(123.List) == 1? | 17:05 | |
AlexDaniel | marchelzo: only one element in the list | ||
marchelzo | >.< | ||
that's obvious | |||
sorry | |||
ilmari | marchelzo: because a list in numeric context is the number of elements | ||
AlexDaniel | m: say +[8, 25, 42] | ||
camelia | rakudo-moar 2f9199: OUTPUT«3» | ||
RabidGravy | I'm glad panda-test is working again | ||
AlexDaniel | ilmari: sounds very p5-ish :) | 17:06 | |
ilmari | m: say ~[3,5,7] | ||
camelia | rakudo-moar 2f9199: OUTPUT«3 5 7» | ||
AlexDaniel | m: say ?[3,5,7] | ||
camelia | rakudo-moar 2f9199: OUTPUT«True» | ||
lizmat | m: say [+] 3,4,7 | ||
camelia | rakudo-moar 2f9199: OUTPUT«14» | ||
17:06
Ven left
|
|||
lizmat | m: say [**] 3,4,7 | 17:07 | |
camelia | rakudo-moar 2f9199: OUTPUT«1427701207893295829254572822096315603914668438510753143971001074259359396579389699820627167240291515779836466627227091534232812571357130969315818188029243277766289210859772322572719318511462543138040955367493331114541581266774920391602594047652970259262924…» | ||
lizmat | afk for a bit& | ||
AlexDaniel | m: say [R**] 2,32 | ||
camelia | rakudo-moar 2f9199: OUTPUT«1024» | ||
dj_goku | .messages | ||
17:09
Actualeyes left
|
|||
AlexDaniel | m: say [infix:<+>] 2,4,8 | 17:10 | |
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pA5leA_W3xTwo terms in a rowat /tmp/pA5leA_W3x:1------> 3say [infix:<+>]7⏏5 2,4,8 expecting any of: infix infix stopper postfix statement end …» | ||
17:10
Ven joined
|
|||
AlexDaniel | is there any way to make it work? | 17:10 | |
TimToady | m: say [[&infix:<+>]] 2,4,8 | ||
camelia | rakudo-moar 2f9199: OUTPUT«14» | ||
AlexDaniel | why double [[]]? | ||
psch | m: say 2 [&infix:<+>] 2 | ||
camelia | rakudo-moar 2f9199: OUTPUT«4» | ||
TimToady | outer one is reduce, inner one turns function into infix | 17:11 | |
17:11
domidumont left
|
|||
TimToady | only works with & though | 17:11 | |
17:12
rurban joined
|
|||
lucasb | m: say List.() | 17:13 | |
camelia | rakudo-moar 2f9199: OUTPUT«()» | ||
lucasb | m: say List.new.() | ||
camelia | rakudo-moar 2f9199: OUTPUT«Invocant requires a type object of type List, but an object instance was passed. Did you forget a 'multi'? in block <unit> at /tmp/UwnVEiNbnS:1» | ||
TimToady | m: say [[&[+]]] 2,4,8 | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sL27fn93scUnable to parse expression in bracketed infix; couldn't find final ']' at /tmp/sL27fn93sc:1------> 3say [[&7⏏5[+]]] 2,4,8» | ||
lucasb | List needs to answer to 'call me' for some reason? | ||
CIAvash | RabidGravy: when I tried to install HTTP::UserAgent, I was getting the same error as travis, now after your change I'm getting this: # Block Code Any Mu | ||
Default constructor for 'Block' only takes named arguments | |||
in block <unit> at t/030-cookies.t:172 | |||
17:13
joeschmoe left
|
|||
_nadim | can't call method 'perl' on a null object. what's a null object? | 17:14 | |
dj_goku | m: say [+] [1, 2, 3] | ||
camelia | rakudo-moar 2f9199: OUTPUT«6» | ||
RabidGravy | which is odd, which is quite what I expected to get but it passes now | ||
AlexDaniel | _nadim: what is the code? :) | ||
dj_goku | m: say [+] 1,2,3 | ||
camelia | rakudo-moar 2f9199: OUTPUT«6» | ||
RabidGravy | CIAvash, I would suggest getting a new rakudo as it isn't doing it now | 17:15 | |
TimToady | m: say 2 [&[+]] 2 | 17:16 | |
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/w6sedakjosUnable to parse expression in bracketed infix; couldn't find final ']' at /tmp/w6sedakjos:1------> 3say 2 [&7⏏5[+]] 2» | ||
TimToady | hmm, I wonder why that doesn't work | ||
AlexDaniel | how can a postfix take two parameters? | ||
_nadim | AlexDaniel: nopaste.linux-dev.org/?878914 just figuring out things | ||
dj_goku | .tell Zoffix just wanted to say thanks for the IRC Client advent post. I took the plung on prototyping a interacting with gearmand in perl6. I was able to get connected last night! | ||
yoleaux | dj_goku: I'll pass your message to Zoffix. | ||
RabidGravy | there's something righteously messed up here "Type check failed for return value; expected NativeCall::Types::CArray[uint8] but got NativeCall::Types::CArray[uint8].new" | ||
AlexDaniel | _nadim: can you golf it down? | 17:17 | |
marchelzo | How can I do custom formatting with a list of say 2 things? Like ('Foo', '32').fmt('%s -> %d') or something. | ||
The above doesn't work, but maybe you can see what I mean. | 17:18 | ||
17:18
egor joined
|
|||
TimToady | .tell masak I wouldn't mind a golf of the failure, or better yet, a spectest | 17:18 | |
yoleaux | TimToady: I'll pass your message to masak. | ||
_nadim | AlexDaniel: yes but I have something else right now. but the my( [@a, @b, @c]) = ... is the place that bombs it I think | 17:19 | |
CIAvash | RabidGravy: I tried after updating rakudo. Do I need to uninstall and reinstall rakudo? | ||
psch | m: printf '%s -> %d', |('Foo', '32') | ||
camelia | rakudo-moar 2f9199: OUTPUT«Foo -> 32» | ||
17:19
BuildTheRobots joined,
egor left
|
|||
AlexDaniel | m: say sprintf("%s → %s", [42, 69]) | 17:19 | |
camelia | rakudo-moar 2f9199: OUTPUT«42 → 69» | ||
marchelzo | hmm | 17:20 | |
AlexDaniel | m: say sprintf("%s → %s", [42, 69, 20]) | ||
camelia | rakudo-moar 2f9199: OUTPUT«Directives specify 2 arguments, but 3 arguments were supplied» | ||
_nadim | sub xxx { my @a, @b, @c ... return @a,@b,@c) .... my (@a, @b, @c) = xxx. @a gobbles it all, how does one write that? | ||
AlexDaniel | return [@a, @b, @c] perhaps? | 17:21 | |
17:21
zakharyas joined
|
|||
_nadim | Nope, I tried that first | 17:21 | |
RabidGravy | CIAvash, I don't know, I couldn't replicate locally which is why I put that diag in | ||
lucasb | ^^ I found strange that sprintf flattened the list second argument | 17:22 | |
[Coke] | /home/coke/sandbox/perl6-roast-data/rakudo.moar-jit/perl6.moarvm t/spec/integration/advent2013-day14.t hanging again in daily test run | ||
AlexDaniel | _nadim: Ok I'm looking into it | 17:23 | |
dalek | rl6-roast-data: d4dc4cb | coke++ | / (9 files): today (automated commit) |
||
17:23
Ven left
|
|||
tadzik | pdcawley_ moritz timotimo: I just learned, from a fellow anthropologist, that they often specifically mark each use of "men" in articles with a note saying "I'm using it as «people» rather than «male specimen»", or so | 17:23 | |
quite interesting | |||
17:23
xtreak joined
|
|||
psch | m: sub f { [1,2,3],[4,5,6],[7,8,9] }; my ($a, $b, $c) = f; say $a | 17:23 | |
camelia | rakudo-moar 2f9199: OUTPUT«[1 2 3]» | ||
marchelzo | Is there any way to get more detailed error messages? I get an error and it doesn't even tell me the line number. | 17:24 | |
lucasb | I think just changing "men" to "dudes" would sound more inclusive :D | ||
marchelzo | "Directives specify 2 arguments, but 1 argument was supplied" is all it says. | ||
[Coke] | marchelzo: with printf*? known issue. | ||
_nadim | AlexDaniel: doin ($a $b, $c) = xxxx() works but that is not what I want to do | 17:25 | |
AlexDaniel | [Coke]: is it rakudobugged? | ||
_nadim: see psch answer ↑ | |||
marchelzo | [Coke]: why does it only affect printf*? | ||
AlexDaniel | _nadim: aaah | ||
[Coke] | AlexDaniel: rt.perl.org/Ticket/Display.html?id=126063 | ||
AlexDaniel | _nadim: that is not what you want… OK I have to learn to read :) | ||
17:26
domidumont joined
|
|||
[Coke] | marchelzo: implementation detail | 17:26 | |
17:26
koo8 left
|
|||
psch | _nadim: what do you want to do? | 17:26 | |
17:26
dakkar left
|
|||
marchelzo | Is printf implemented in perl6 or in C? | 17:26 | |
psch | marchelzo: in NQP, almost completely | ||
[Coke] | marchelzo: NQP | ||
psch | marchelzo: so, of those two options, Perl 6 is the correcter one | ||
17:27
molaf_ joined
|
|||
[Coke] | jnthn: we need to find one of your old slide decks that shows the structure of rakudo (inc. moar, nqp, etc.) and throw that on perl6.org somewhere. or rakudo.org | 17:27 | |
mainly for the ongoing Endless Christmas. | 17:28 | ||
AlexDaniel | m: my ([@a]) = 1; say @a.perl; # here is the “null object” thing | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot call method 'perl' on a null object in block <unit> at /tmp/4f49kOW4_t:1» | ||
marchelzo | does all perl6 get compiled to NQP as an IR before becoming moar bytecode? Is it meant to be written by humans? | ||
17:28
molaf left
|
|||
[Coke] | doesn't get compiled to nqp, no. | 17:29 | |
AlexDaniel | HOORAY | ||
SEGMENTATION FAULT! | |||
m: my ([@a]) = 1; say @a.WHAT; | |||
camelia | rakudo-moar 2f9199: OUTPUT«(signal SEGV)» | ||
TimToady | jnthn: I do think we should consider renaming 'experimental' to 'MONKEY-AROUND', or maybe just 'MONKEY', on the theory that a quick audit of a project for dangerous code can just grep for MONKEY | ||
marchelzo | [Coke]: So where does nqp come from? | ||
psch | [Coke]: rakudo/docs/ has architecture.html and *.svg, maybe those are a start | 17:30 | |
AlexDaniel | _nadim: so your null object finding is a bit more serious that it seemed :) | ||
_nadim: I don't think that it is critical, but it should not segfault anyway | 17:31 | ||
TimToady | if we then declare EVAL to be dangerous, we can also have MONKEY-SEE-NO-EVAL :) | ||
geekosaur | rakudo perl6 is written in nqp | ||
zengargoyle | lol | ||
[Coke] | marchelzo: read www.jnthn.net/papers/2013-apw-lessons.pdf | ||
AlexDaniel | geekosaur: again… not true! | ||
geekosaur: it is NQP and Perl 6 | |||
[Coke] | marchelzo: crap, that's not right. one sec. | 17:32 | |
lucasb | you mean these? edumentab.github.io/rakudo-and-nqp-...ls-course/ | 17:33 | |
[Coke] | jnthn++ has so many slide decks, I'm trying to scan for the one that has the diagram that i think will help explain. | ||
zengargoyle | nqp == perl 6 for suitably augmented versions of nqp. :P | ||
psch thinks github.com/rakudo/rakudo/blob/nom/...ecture.svg is pretty good | |||
AlexDaniel | .oO( can we declare “shell” to be dangerous and have MONKEY-SHELL ? ) |
||
17:34
znpy left
|
|||
[Coke] gives up trying to find the slides in particular he was looking for, ah well. | 17:37 | ||
marchelzo | [Coke]: heh I went through that entire set of slides trying to find NQP | ||
TimToady | we should gather up all the known monkey idioms in a list somewhere... | 17:38 | |
marchelzo | psch: does (NQP) mean the component is implemented in NQP? | ||
17:38
domidumont left
|
|||
marchelzo | or does it mean the code is represented as NQP during that phase | 17:39 | |
TimToady | monkey-shine, monkey-business... | ||
17:39
domidumont joined
|
|||
TimToady | .oO(use FLYING-BUTT-MONKEY) |
17:40 | |
psch | marchelzo: no to the latter, yes to the former. the language in parens is what code that handles that stage is written in | 17:41 | |
[Coke] | jnthn: is there a version of www.jnthn.net/papers/2013-yapceu-jvm.pdf but for moarvm? | ||
psch | marchelzo: as in, the parser and actions are written in NQP, the CORE.setting is written in Per l6 | ||
Hotkeys | when should one use parens for function calls? "foo($x)" vs "foo $x" | ||
TimToady | when one wishes to guard against a future keyword "foo" | 17:42 | |
17:42
leont joined
|
|||
marchelzo | psch: I see | 17:42 | |
TimToady | when one wishes to extend the expression with another .bar | ||
AlexDaniel | .oO( oh! MONKEY-HELL for shell! ) |
17:43 | |
TimToady | though of course there's also the option (foo $x).bar in that case | ||
shades of Lisp | |||
AlexDaniel | .oO( might also make sense to rename shell to hell ) |
||
Hotkeys | mmkay | 17:44 | |
17:45
domidumont left,
lucasb left
|
|||
AlexDaniel | .oO( hell-out-of(“ls”) ) |
17:45 | |
pdcawley_ afk calling it a day, but I'll be in tomorrow morning to make up some time after my cold. | |||
TimToady | o/ | 17:46 | |
[Coke] | TimToady: S03-metaops/reverse.t has a passing test that might be a result of your work. | ||
RabidGravy | oh deary, deary me | ||
perl6 -Ilib t/030-cookies.t | |||
===SORRY!=== | |||
Cannot find method 'run_alt' | |||
17:47
cdg joined,
cdg left
|
|||
TimToady | hmm, I have a bunch of new tests there that I forgot to check in | 17:47 | |
17:47
cdg joined
|
|||
RabidGravy | I think that rakudo is completely messed up right now | 17:48 | |
AlexDaniel | RabidGravy: you mean, after curli? | ||
RabidGravy | nope in the last hour or so | 17:49 | |
17:49
xtreak left
|
|||
RabidGravy | This is rakudo version 2015.11-443-gc769890 built on MoarVM version 2015.11-34-gc3eea17 implementing Perl v6.b. | 17:50 | |
[jonathan@cannibal http-useragent]$ perl6 -Ilib t/030-cookies.t | |||
1..29 | |||
ok 1 - new 1/3 | |||
This is rakudo version 2015.11-444-g2f91998 built on MoarVM version 2015.11-34-gc3eea17 implementing Perl v6.b. | 17:51 | ||
moritz | m: say <a b c>.roll(*).elems | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot .elems a lazy list in block <unit> at /tmp/uQ_R9jGw_Q:1Actually thrown at: in block <unit> at /tmp/uQ_R9jGw_Q:1» | ||
RabidGravy | # Block Code Any Mu | 17:52 | |
Default constructor for 'Block' only takes named arguments | |||
in block <unit> at t/030-cookies.t:172 | |||
17:52
ZoffixW joined
|
|||
moritz | m: say <a b c>.roll(*).rotor(5)[^10] | 17:52 | |
camelia | rakudo-moar 2f9199: OUTPUT«((b a c a a) (b b b b b) (c c a c b) (c a a c a) (a c c a a) (c a b b a) (b c c b c) (c b b a a) (c a c c b) (b a b c a))» | ||
ZoffixW | RabidGravy, if that run_alt resurfaces, you may wanna comment on this ticket: rt.perl.org/Ticket/Display.html?id=126832 I had the exact same issue when installing a module with panda, though cloning a repo and installing from current dir worked | ||
AlexDaniel | _nadim: rt.perl.org/Public/Bug/Display.html?id=126857 | ||
RabidGravy | okay it's something to do with the presense of blib | 17:53 | |
marchelzo | how do you append two lists? | 17:54 | |
ZoffixW | marchelzo, .append ? | ||
marchelzo | there's no infix operator? | ||
AlexDaniel | m: say append([1, 2, 3], [10, 11, 12]) | 17:55 | |
camelia | rakudo-moar 2f9199: OUTPUT«[1 2 3 10 11 12]» | ||
ZoffixW | m: say [1, 2, 3] .append: [10, 11, 12] | 17:56 | |
camelia | rakudo-moar 2f9199: OUTPUT«[1 2 3 10 11 12]» | ||
ZoffixW | look! infix! :D | ||
AlexDaniel | ZoffixW: hahahaha | ||
marchelzo | lol | ||
ZoffixW | m: sub infix:<»«> ($l1, $l2) { [|$l1, |$l2] }; say [1, 2, 3] »« [10, 11, 12] | 17:58 | |
camelia | rakudo-moar 2f9199: OUTPUT«[1 2 3 10 11 12]» | ||
AlexDaniel | ZoffixW: why not call it A :) | 17:59 | |
ZoffixW | m: sub infix:<¯\_(ツ)_/¯> ($l1, $l2) { [|$l1, |$l2] }; say [1, 2, 3] ¯\_(ツ)_/¯ [10, 11, 12] | ||
camelia | rakudo-moar 2f9199: OUTPUT«[1 2 3 10 11 12]» | ||
moritz | autarch: is your advent post for day 11 ready? because if yes, I'd like to post it tomorrow already (swap days 10 and 11) | 18:00 | |
autarch | moritz: one person reviewed it, I wouldn't mind another reviewed, but otherwise yes | ||
gfldex | m: my @a = 1,2,3; @a[*-1] = |(11,22,33); dd @a; | 18:01 | |
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = $[1, 2, (11, 22, 33)]» | ||
gfldex | why does that refuse to slip? | ||
m: my @a = 1,2,3; @a.push(|(11,22,33)); dd @a; | |||
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = $[1, 2, 3, 11, 22, 33]» | ||
marchelzo | How can I do something like this? for lines() { /(<digit>+) (<alpha>+)/; say $1; } | ||
TimToady | note that .append is mutating the left arg | ||
geekosaur | I would suspect that you are telling it to assign to an element | ||
marchelzo | I keep getting Nil for $1. | ||
AlexDaniel | m: sub infix:<¯\_(ツ)_/¯> ($a, $b) { [$a, $b].pick }; say 42 ¯\_(ツ)_/¯ 69 | ||
camelia | rakudo-moar 2f9199: OUTPUT«69» | 18:02 | |
AlexDaniel | m: sub infix:<¯\_(ツ)_/¯> ($a, $b) { [$a, $b].pick }; say 42 ¯\_(ツ)_/¯ 69 | ||
camelia | rakudo-moar 2f9199: OUTPUT«42» | ||
ZoffixW | marchelzo, first match is $0 | ||
marchelzo | ZoffixW: I know, but $1 should still be defined shouldn't it? | ||
ZoffixW | m: for 'nope' { /(<digit>+) (<alpha>+)/; say $1; } | 18:03 | |
camelia | rakudo-moar 2f9199: OUTPUT«Nil» | ||
ZoffixW | m: for '42nope' { /(<digit>+) (<alpha>+)/; say $1; } | ||
camelia | rakudo-moar 2f9199: OUTPUT«「nope」 alpha => 「n」 alpha => 「o」 alpha => 「p」 alpha => 「e」» | ||
marchelzo | oh, I know the problem | ||
ZoffixW | \o/ | ||
marchelzo | my input didn't actually match the regex | ||
ZoffixW | :) | ||
moritz | autarch: ok, I'll review and swap dates | 18:04 | |
autarch | moritz: thanks | ||
18:04
ZoffixW left
|
|||
RabidGravy | ah, the random "Use of uninitialized value %ENV of type Any in string context" is coming out of qqx/ .../ here | 18:07 | |
dalek | : 81d2e76 | moritz++ | misc/perl6advent-2015/schedule: Perl 6 advent: Swap days 10 and 11 |
18:08 | |
: 92dc957 | moritz++ | misc/perl6advent-2015/schedule: Perl 6 advent: Update post title for day 10 |
|||
TimToady | m: say WHAT ((*.sort)([1,3,1])) | 18:09 | |
camelia | rakudo-moar 2f9199: OUTPUT«(List)» | ||
gfldex | m: my @a = |(1,2,3); my @b; @b[0] = |(1,2,3); dd @a, @b; | ||
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = $[1, 2, 3]Array $var = $[(1, 2, 3),]» | ||
masak | TimToady: ok. I have some time tonight; I'll get on it. | 18:10 | |
yoleaux | 17:18Z <TimToady> masak: I wouldn't mind a golf of the failure, or better yet, a spectest | ||
TimToady | thanks | 18:11 | |
AlexDaniel | j: my ([$a]); $a.WHAT | ||
camelia | rakudo-jvm 6c0f93: OUTPUT«java.lang.NullPointerException in block <unit> at /tmp/y_AIDyesNw:1» | ||
RabidGravy | it's possible that "use NativeCall; say CArray[uint8].new ~~ CArray[uint8]" may not work when precompiled | ||
moritz | autarch: I've read your advent post, and liked it. I changed one link from http to https, that's all :-) | 18:12 | |
marchelzo | anyone know a nice way to turn (a, b, c, d) into ((a, b), (b, c) (c, d))? | ||
TimToady | m: my $f = (*.sort)([1,3,1]); say $f.WHAT | 18:13 | |
camelia | rakudo-moar 2f9199: OUTPUT«()» | ||
TimToady | m: my $f = (*.sort)([1,3,1]); say $f | ||
moritz | m: say <a b c d>.rotor(2, -1).perl | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot find method 'gist': no method cache and no .^find_method in block <unit> at /tmp/wfsqiIAVuD:1» | ||
rakudo-moar 2f9199: OUTPUT«Cannot have elems < 1, did you mean to specify a Pair with => -1? in block <unit> at /tmp/00fEQdi9bR:1» | |||
moritz | m: say <a b c d>.rotor(2 => -1).perl | ||
camelia | rakudo-moar 2f9199: OUTPUT«(("a", "b"), ("b", "c"), ("c", "d")).Seq» | ||
moritz | marchelzo: ^^ | ||
marchelzo | amazing | 18:14 | |
gfldex | m: my @b; @b = @b.list, |(1,2,3); dd @b; say @b; | ||
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = (my \Array_74891312 = $[Array_74891312, 1, 2, 3])(\Array_74891312 = [Array_74891312 1 2 3])» | ||
gfldex | is that intentional? | ||
m: my @b; @b = @b, |(1,2,3); dd @b; say @b; | |||
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = (my \Array_80543712 = $[Array_80543712, 1, 2, 3])(\Array_80543712 = [Array_80543712 1 2 3])» | ||
gfldex | m: my @b; @b = @b, |(1,2,3); dd @b; put @b; | 18:15 | |
TimToady | m: my $f = (*.sort)([1,3,1]); say $f.^name | ||
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = (my \Array_57139168 = $[Array_57139168, 1, 2, 3])Memory allocation failed; could not allocate 29248 bytes» | ||
rakudo-moar 2f9199: OUTPUT«BOOTArray» | |||
gfldex | m: my @b; @b = @b, 1; put @b; | 18:16 | |
camelia | rakudo-moar 2f9199: OUTPUT«Memory allocation failed; could not allocate 8192 bytes» | ||
gfldex | is that rakudos way of saying: "infinite recursion" ? | 18:17 | |
TimToady | likely | ||
gfldex | i shall rakudobug | ||
TimToady | m: my $f = (*.sort)([1,3,1]); say $f.^name | 18:18 | |
camelia | rakudo-moar 2f9199: OUTPUT«BOOTArray» | ||
TimToady | so shall I | ||
ugexe | are there any changes planed for Version, like restrictions/transformations on what is passed to .new? (i.e. should version comparison try to be smart such that ?(Version.new("v1.0") ~~ Version.new("1.0"))) | ||
i remember there was a discussion on it but i dont remember if anything came of it :( | 18:19 | ||
autarch | moritz: cool, thanks for reviewing it | ||
I note that the script I refer to at the end in my repo still fails with gist.github.com/autarch/1405c19f1ee561cb6fbd | 18:20 | ||
18:20
ab6tract left
|
|||
gfldex | m: my @b; @b[0] = |(1,2,3); dd @b; # my question if that's a bug still stands because i think it is | 18:20 | |
camelia | rakudo-moar 2f9199: OUTPUT«Array $var = $[(1, 2, 3),]» | ||
autarch | would be nice to fix that | ||
AlexDaniel | m: my @b; @b = @b, 1; put @b; | ||
autarch | the script in question is at github.com/autarch/perl6-advent-20...ewalker.p6 | ||
camelia | rakudo-moar 2f9199: OUTPUT«Memory allocation failed; could not allocate 8192 bytes» | 18:21 | |
AlexDaniel | oh come on! 8192 bytes! | ||
b2gills | In Perl 5 a list in scalar context will give the either the last element, or the number of elements; depending on if it is an immediate list or the result of a function call. Perl 6 returns the list itself, which in coercing numeric context always returns the number of elements. | ||
autarch | I am of course going afk - if someone figures out my issue please have a bot tell me ;) | ||
b2gills | That means it could not allocate an additional 8192 bytes | 18:22 | |
18:22
loren left
|
|||
dalek | kudo/repository_registry: f729c17 | (Stefan Seifert)++ | src/core/CompUnit/RepositoryRegistry.pm: Remove obsolete method ctxsave from CompUnit::RepositoryRegistry |
18:23 | |
kudo/repository_registry: 90da3cf | (Stefan Seifert)++ | / (3 files): Move repository setup into CompUnit::RepositoryRegistry All code dealing with include specs is now in CompUnit::RepositoryRegistry. This way we no longer need to make SHORT-ID2CLASS, INCLUDE-SPEC2CUR and PARSE-INCLUDE-SPEC publicly visible. %*CUSTOM_LIB<site> is now replaced by %CompUnit::RepositoryRegistry.repository-for-name('site') |
|||
zengargoyle | hrm, can you use self in a has? | 18:24 | |
nine | TimToady: your commit d3c278d34e6da5b8b39b26bab32d6fcdf3e9a969 causes a regression in Inline::Perl5 where in a method self is a completely different object (higher up in the call stack) than the one the method was called on. | ||
Skarsnik | zengargoyle, probably | ||
zengargoyle | m: my class x { has $foo = self; }; | 18:25 | |
camelia | ( no output ) | ||
zengargoyle | yeah... | ||
marchelzo | Can someone help me understand why this isn't working? sprunge.us/jQPJ | ||
AlexDaniel | m: my @b; @b = @b, 1; say @b; | 18:26 | |
camelia | rakudo-moar 2f9199: OUTPUT«(\Array_75579232 = [Array_75579232 1])» | ||
marchelzo | It says "WhateverCode object coerced to string". | ||
AlexDaniel | that's pretty cool though | ||
Skarsnik | m: class A { has $.self; method foo() {say self.self = "foo"}; my A $a = A.new; $a.foo(); | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cqxYXHzwMZMissing blockat /tmp/cqxYXHzwMZ:1------> 3elf = "foo"}; my A $a = A.new; $a.foo();7⏏5<EOL>» | ||
Skarsnik | m: class A { has $.self; method foo() {say self.self = "foo"}}; my A $a = A.new; $a.foo(); | ||
camelia | rakudo-moar 2f9199: OUTPUT«Cannot modify an immutable Any in method foo at /tmp/Ru2txYp6tp:1 in block <unit> at /tmp/Ru2txYp6tp:1» | ||
ugexe | *.say | ||
psch | m: *.say | ||
camelia | ( no output ) | ||
psch | m: { *.say }() | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hg0CkumkjyMalformed double closure; WhateverCode is already a closure without curlies, so either remove the curlies or use valid parameter syntax instead of *at /tmp/hg0Ckumkjy:1------> 3{ *.say }7…» | ||
ugexe | m: *.join('-') | ||
camelia | ( no output ) | ||
ilmari | m: class :: { method bar { 42 } has baz = self.bar + 3 }.new.baz | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vqnYBhNO6lStrange text after block (missing semicolon or comma?)at /tmp/vqnYBhNO6l:1------> 3class :: { method bar { 42 }7⏏5 has baz = self.bar + 3 }.new.baz expecting any of: inf…» | ||
Skarsnik | m: class A { has $.self is rw; method foo() {say self.self = "foo"}}; my A $a = A.new; $a.foo(); | ||
camelia | rakudo-moar 2f9199: OUTPUT«foo» | ||
nine | TimToady: With method call_context() { note self.^name }; I get the wrong self, while with method call_context(\SELF:) { note SELF.^name } it's correct! | 18:27 | |
ilmari | m: class :: { method bar { 42 }; has $.baz = self.bar + 3 }.new.baz | ||
camelia | ( no output ) | ||
ilmari | m: class :: { method bar { 42 }; has $.baz = self.bar + 3 }.new.baz.say | ||
camelia | rakudo-moar 2f9199: OUTPUT«45» | ||
ugexe | m: my %x; %x{*.join('-')} | ||
camelia | rakudo-moar 2f9199: OUTPUT«WhateverCode object coerced to string (please use .gist or .perl to do that) in block <unit> at /tmp/MUnHeYtLjD:1» | ||
TimToady | nine: is it in the lexical scope of any \self declaration? | ||
marchelzo | ugexe: ok, I see what the problem is | 18:28 | |
ugexe | marchelzo: use a map block and $_ instead of * | ||
marchelzo | ugexe: yea | ||
nine | TimToady: only \self is in github.com/niner/Inline-Perl5/blob...5.pm6#L969 and line 984 while the method in question is created by an EVAL in github.com/niner/Inline-Perl5/blob...5.pm6#L520 | 18:30 | |
marchelzo | ugexe: hmm. now it says: "Use of uninitialized value of type Any in numeric context in block" (line 12) | ||
nine | TimToady: note that the wrong self is the Perl6Callbacks object...the one where the EVAL that creates the method is run in | 18:31 | |
18:31
prammer joined
|
|||
nine | TimToady: Perl6Callbacks.create runs an EVAL that creates a class and the method of this class gets the Perl6Callbacks object as self instead of its own | 18:31 | |
TimToady | ah, so there is already a self defined when it sees the EVAL's self, hmm, so it thinks someone said my \self = ... | 18:32 | |
nine | yes, that sounds like it | ||
TimToady | maybe we'll need to back out the self part of that patch, and make self 'more reserved' | ||
marchelzo | Is there something like .sort for strings? | ||
nine | Better safe than sorry... | 18:33 | |
That one was quite a challenge to nail down :) | |||
ugexe | marchelzo: might try to name your outer map parameters in case you are stepping on $_ `.map(-> $arg { $arg ... })` | ||
psch | m: say <a c e b d>.sort | ||
camelia | rakudo-moar 2f9199: OUTPUT«(a b c d e)» | ||
Skarsnik | m: say "acebd".split('').sort; | ||
camelia | rakudo-moar 2f9199: OUTPUT«( a b c d e)» | ||
gfldex | m: 'bca'.comb.sort.say; | ||
camelia | rakudo-moar 2f9199: OUTPUT«(a b c)» | ||
gfldex | m: 'bca'.comb.sort.join.say; | 18:34 | |
camelia | rakudo-moar 2f9199: OUTPUT«abc» | ||
AlexDaniel | m: my @b; my @b[0] = @b | ||
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5===Cannot use variable @b in declaration to initialize itselfat /tmp/aNwB2NF9OU:1------> 3my @b; my @b[0] = @7⏏5b expecting any of: termOther potential difficulties: Redeclaration of symbol @b at…» | ||
gfldex | i do agree that there should be Str::sort tho | ||
psch | m: say Str.^can('sort') | 18:35 | |
camelia | rakudo-moar 2f9199: OUTPUT«(Method+{<anon|77418096>}.new)» | ||
AlexDaniel | m: my @b; my @a; my @a[0] = @b; my @b[0] = @a; say @b | ||
camelia | rakudo-moar 2f9199: OUTPUT«Potential difficulties: Redeclaration of symbol @a at /tmp/DVpk9qT3U5:1 ------> 3my @b; my @a; my @a[0]7⏏5 = @b; my @b[0] = @a; say @b Redeclaration of symbol @b at /tmp/DVpk9qT3U5:1 ------> 3my @b; my @a; my @a[0…» | ||
AlexDaniel | my favorite “Index 0 for dimension 1 out of range (must be 0..-1)” :) | ||
18:35
zakharyas left
18:36
CIAvash left
|
|||
ugexe | m: my @b; my @a; @a[0] = @b; @b[0] = @a; say @b | 18:36 | |
camelia | rakudo-moar 2f9199: OUTPUT«(\Array_74018864 = [[Array_74018864]])» | ||
dalek | kudo/nom: 67749a7 | TimToady++ | src/Perl6/Grammar.nqp: make self non-overridable otherwise an EVAL creating a method within a method gets the wrong self |
||
TimToady | nine: ^^ should fix it | ||
gfldex | m: "bca".sort.say | 18:37 | |
camelia | rakudo-moar 2f9199: OUTPUT«(bca)» | ||
18:37
Ven joined
|
|||
nine | checking... | 18:38 | |
Hotkeys | m: "bca".split.sort.join.say | 18:39 | |
camelia | rakudo-moar 2f9199: OUTPUT«Cannot call split(Str: ); none of these signatures match: (Cool $: Regex:D $pat, $limit = { ... };; :$all, *%_) (Cool $: Cool:D $pat, $limit = { ... };; :$all, *%_) (Str:D $: Regex:D $pat, $parts = { ... };; :$v is copy, :$k, :$kv, :$p, :…» | ||
Hotkeys | m: "bca".split('').sort.join.say | 18:40 | |
camelia | rakudo-moar 2f9199: OUTPUT«abc» | ||
dalek | ast: 200ec05 | TimToady++ | S03-metaops/reverse.t: test thunking of reversed logical ops |
||
ast: 6c2c99c | TimToady++ | S03-metaops/reverse.t: fudge temporarily failing test |
|||
18:41
prammer left,
leont left
|
|||
AlexDaniel | m: my @a; @a[0] = @b; @b[0] = @a; put @b | 18:41 | |
camelia | rakudo-moar 2f9199: OUTPUT«5===SORRY!5=== Error while compiling /tmp/aT5vfdqkeNVariable '@b' is not declaredat /tmp/aT5vfdqkeN:1------> 3my @a; @a[0] = 7⏏5@b; @b[0] = @a; put @b» | ||
AlexDaniel | m: my @b; my @a; @a[0] = @b; @b[0] = @a; put @b | 18:42 | |
camelia | rakudo-moar 2f9199: OUTPUT«Memory allocation failed; could not allocate 49120 bytes» | ||
nine | \o/ | ||
TimToady++ # Inline::Perl5 works again :) | 18:43 | ||
.tell [Tux] TimToady++ just fixed the rakudo regression that broke Inline::Perl5's t/v6.t | |||
yoleaux | nine: I'll pass your message to [Tux]. | ||
marchelzo | Is anybody here doing the adventofcode.com challenges in perl6? | 18:44 | |
grondilu | marchelzo: I do | 18:46 | |
TimToady | is there a way to add [BUG] to an RT ticket I forgot to mark? | ||
grondilu | well, not everything works in Perl 6 though | ||
18:47
Ven left
|
|||
grondilu | I had to do day 4 in Perl 5, for instance. | 18:48 | |
and day 6 | |||
zengargoyle | grondilu: now you can go back and use Inline::Perl5 :) | ||
grondilu | I've never used this. How different is it from v5? | 18:49 | |
m: use v5; | |||
camelia | rakudo-moar 2f9199: OUTPUT«===SORRY!===Could not find Perl5:ver<True>:auth<True>:api<True> in: /home/camelia/.perl6/2015.11-444-g2f91998 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-…» | ||
zengargoyle | no clue, i was just being snarky. | ||
18:49
Ven joined
|
|||
marchelzo | grondilu: why? | 18:49 | |
grondilu | Perl 6 was too slow | ||
marchelzo | yeah that's my problem right now | 18:50 | |
brute force travelling salesman problem in perl6 isn't working out so well | |||
nine | grondilu: largest difference to v5 is that you can use all of CPAN with Inline::Perl5 | 18:51 | |
TimToady: "Basics" in the menu, there you can edit the subject | 18:52 | ||
grondilu | marchelzo: that's day9 right? I brute-forced it with in Perl 6. Not very fast but reasonable. | ||
18:52
xfix joined
|
|||
grondilu | on a Raspberry Pi even | 18:52 | |
18:53
prammer joined
|
|||
grondilu | marchelzo: make sure you have a recent rakudo, though. | 18:53 | |
18:54
Ven left
|
|||
marchelzo | grondilu: how long did it take to execute for you? | 18:54 | |
mine eventually finished but took several minutes | 18:55 | ||
18:55
Ven joined
|
|||
grondilu | it did take a few minutes. Just consider displaying progress. When you see it not making any you can try what the program currently has as a minimum. Worked for me. | 18:55 | |
marchelzo | hmm | 18:56 | |
I don't think my code is very good, but I'm tempted to port it to pypy3 just to see the speed difference. | |||
18:56
koo8 joined
|
|||
grondilu | port it to Perl 5, you'll see enough of a difference. | 18:57 | |
RabidGravy | jnthn, just added "use experimental to OO::Monitors" ;-) | ||
marchelzo | grondilu: I don't know Perl 5 | ||
masak | m: say [&&] |0 | 18:58 | |
camelia | rakudo-moar 67749a: OUTPUT«0» | ||
masak | TimToady: ^ | ||
TimToady: that's the golf. | |||
marchelzo | at least not very well | ||
masak | TimToady: not sure where to add a spectest for that -- but I can, no problem :) | ||
let's see if I can make it fail on the commit in question, but not elsewhere. | |||
TimToady | that's okay, I can put in a test as I fix it | 19:00 | |
masak | TimToady: stacktrace: gist.github.com/masak/8fcd83e1054fc1e74e8c | ||
TimToady: ok, then I leave it to you from this point on. | |||
TimToady: I already found that at least `try EVAL` catches the bad mood and is testable. | |||
TimToady | I figured it probably had somethign to do with a slip | ||
masak | (see gist) | ||
TimToady | since the patch wants to take comma-args literally | ||
at minimum I probably need to exempt slip arguments from thunking | 19:01 | ||
masak | TimToady: if you want to re-do your patch with the bug fixed, if you push it to a branch, I can test 007 on it before we merge to nom. | 19:02 | |
TimToady | or just give up entirely on thunking lists if there's a slip anywhere | ||
okay | |||
masak | I can show you the original un-golfed line of code | 19:03 | |
github.com/masak/007/blob/master/l...#L121-L122 | |||
so, essentially an "all of these values have to be truthy" construct | 19:04 | ||
ISTR I added the slip after GLR | |||
[Tux] runs «make again» | |||
yoleaux | 18:43Z <nine> [Tux]: TimToady++ just fixed the rakudo regression that broke Inline::Perl5's t/v6.t | ||
19:05
Ven left
|
|||
marchelzo | grondilu: oh wow | 19:07 | |
it's almost instant in python3 | |||
that's sort of disappointing | |||
ChristopherBotto | marchelzo: Rakudo Perl 6 hasn't been optimized yet. | 19:09 | |
marchelzo | ChristopherBotto: when will it be optimized? | ||
ChristopherBotto | That will be a large part of the work in 2016. | 19:10 | |
marchelzo: That will be a large part of the work in 2016. | |||
[Tux] | nope, still fail | 19:11 | |
must run. feedback later | |||
marchelzo | I really hope it ends up being fast | ||
masak | I think it's a little bit unfair to say that it "hadn't been optimized" | 19:13 | |
but surely we are not at the limit point yet. there is more optimization to be had | |||
ChristopherBotto | masak: Sorry, it hasn't been "fully" optimized. | ||
masak | it's perhaps comparable to early Ruby or something like that | 19:14 | |
psch .oO( s/fully/seriously/ ) | |||
RabidGravy | certain things have become faster | ||
ChristopherBotto | But its design will make it more optimizable than Perl 5 ever could be, right? | 19:15 | |
TimToady | that's what we think, but we've thunk wrong before :) | 19:16 | |
19:16
leont joined
19:17
Ven joined
19:19
Ven left
|
|||
masak | :P | 19:20 | |
ChristopherBotto: there are many opportunities for optimization in Perl 6 that couldn't be optimized in Perl 5, even in theory. | 19:21 | ||
ChristopherBotto: of course *saying* that, and *knowing* that, is different from being as fast or faster than Perl 5 ;) | |||
MadcapJake | marchelzo: I've done AdventOfCode days 3, 5, and 6. I'm in the midst of working on day 7 | 19:23 | |
_nadim | AlexDaniel: Cool, in a way, first P6 bug I find | 19:24 | |
marchelzo | MadcapJake: nice | ||
ChristopherBotto | masak: It's already fast enough for many things. I use Perl 6 as my language of choice when starting a new project. On the rare occasion that I need raw speed, I'll prototype in Perl 6 before coding it in Perl 5. | ||
_nadim | AlexDaniel: actually the second one, I segaulted with something else yesterday, I kept the code for later ;) | 19:25 | |
MadcapJake | day 6, I only did part 1 because compilation/execution time was over 2 hours and I would much rather solve other problems than wait that long xD | ||
[Coke] | TimToady: note that adding [BUG] to the title of a bug doesn't magically set the BUG flag. | 19:26 | |
MadcapJake | originally I tried doing day 6 with shaped arrays but that was even slower (current solution is nested arrays, a double for loop, and dispatch function of sorts) | ||
[Coke] | ... note that no one actually seems to care about the bug flag. | ||
19:27
ilbelkyr joined
|
|||
MadcapJake | in Day 7 I am doing another grammar and actions object! Love these! Debugging them is a bit hard though because action method sare called in post-order. | 19:29 | |
_nadim | I'll ask again, sub X { return @a, @b) ... I'd like to do my(@x, @y) = X() or something like that. I know my ($x, $y) = X() work fine. but I'd like to know how to do it with arrays and not have the first one gobble everything. | 19:30 | |
Skarsnik | I am not what you can return to make that work | ||
return [@a], [@b]; maybe? | 19:31 | ||
moritz | m: sub f { my @x = 1, 2; return @x, @x }; my (@a, @b) := f(); say @b.perl | 19:32 | |
camelia | rakudo-moar 67749a: OUTPUT«[1, 2]» | ||
moritz | just use binding :-) | ||
19:32
ilbelkyr left
|
|||
_nadim | ah! thanks moritz | 19:33 | |
masak | ChristopherBotto: sounds nice. I think there's a large potential user base who could strike the same deal with Perl 6 speed/whipuptitude. | 19:35 | |
Skarsnik | *love mi6, added a build-readme cmd to mi6* | 19:36 | |
My main complain about speed for now is starting time (october rakudo) x) | |||
19:37
khw left
19:40
ilbelkyr joined
|
|||
skids | nine: Re: "That one was quite a challenge to nail down" unfortunately duplicated effort, yes that was a hard one to find RT#126754 | 19:43 | |
timotimo | too much backlog :( | 19:45 | |
yoleaux | 00:30Z <Zoffix> timotimo: Sent you a PR to fix the freezing issue. lucasb++ first found the problematic line. github.com/timo/json_fast/pull/8 | ||
grondilu | m: sub f { return "first" unless $++; return rand < $ = rand; }; say f; say f | 19:46 | |
camelia | rakudo-moar 67749a: OUTPUT«firstUse of uninitialized value of type Any in numeric context in sub f at /tmp/Z5yFjg80Hh:1Cannot modify an immutable Bool in sub f at /tmp/Z5yFjg80Hh:1 in block <unit> at /tmp/Z5yFjg80Hh:1» | ||
psch | hrm, this ContextRef thing is nigh-impenetrable from where i'm standing :/ | 19:47 | |
grondilu | not sure but I think it's a bug | ||
psch | and apparently something is mismatched with Makefile generation between moar and jvm, which 0ec5ad56 fixed but went broken again somewhen later... | 19:48 | |
maybe i have to actually read and understand all this CURLI stuff /o\ | |||
timotimo | ShimmerFairy: your post has dominated all other posts since the day it came out :) | 19:49 | |
moritz wonders if this was the Perl Weekly newsletter hitting the blog | 19:51 | ||
19:51
joeshcmoe joined
19:52
demayl joined
|
|||
grondilu | still trying to improve permutations: gist.github.com/grondilu/61a28aca4bcb7ea423e4 This one does not seem faster though. | 19:55 | |
ah nevermind, does not even quite work | 20:01 | ||
20:03
raoulvdberge joined
20:04
prammer left
20:05
espadrine left
20:06
Ven joined,
adhoc joined
20:11
spider-mario joined,
Ven left
20:12
joeshcmoe left
|
|||
[Coke] | how can I tell which parent class or role is providing a particular method? | 20:12 | |
20:12
yqt joined
|
|||
Skarsnik | hm sounds tricky | 20:13 | |
A.^roles.grep: $_.^can("method") ? | |||
moritz | m: say Int.^can('sqrt')[0].package | 20:15 | |
camelia | rakudo-moar 67749a: OUTPUT«(Int)» | ||
20:15
Ven joined
|
|||
moritz | m: say Int.^can('list')[0].package | 20:15 | |
camelia | rakudo-moar 67749a: OUTPUT«(Any)» | ||
moritz | m: say Int.^can('roots')[0].package | 20:16 | |
camelia | rakudo-moar 67749a: OUTPUT«(Numeric)» | ||
moritz | [Coke]: that seems to work | ||
[Coke] | TimToady: RT #126860 is an implicit request that iterating over a string give you the characters of a string. I'm assuming the answer is no and we should reject the ticket? | ||
m: say Str.^can("sort")[0].package; # should be Any | |||
camelia | rakudo-moar 67749a: OUTPUT«(Any)» | ||
[Coke] | moritz++ | 20:17 | |
20:18
darutoko left
20:19
ChristopherBotto left
|
|||
timotimo | hey folks, guess what | 20:19 | |
grondilu | what? | ||
timotimo | grondilu: 15.5% of time spent in a simple permutations benchmark is spent in "find_best_dispatchee" | ||
which means somewhere we're failing to go through the dispatch cache | 20:20 | ||
MadcapJake | If anyone has a moment to look at my adventofcode day 7 parser, I am stuck! It solves the example given, I've fixed the case where a 1 is used instead of a wire, and I've sorted assignments at the beginning. Still I am getting zero for wire A! gist.github.com/MadcapJake/558eff70f13d2ff2c223 | ||
timotimo | ah | ||
it might be the .= for .=reverse | |||
20:21
Ven left
|
|||
grondilu | let me try without | 20:21 | |
timotimo | please do | ||
using .=reverse for two elements in the array can very well be a SUPER CRAZY overhead | |||
dj_goku | m: say $*CWD | 20:22 | |
camelia | rakudo-moar 67749a: OUTPUT«"/home/camelia".IO» | ||
jdv79 | 15% is SUPER CRAZY to you? | ||
150% may qualify to me | 20:23 | ||
timotimo | grondilu: i'll microbenchmark a bit of stuff for you | ||
jdv79: if the script spends more than 100% of its time in just one function, that'd be crazy to me :) | |||
[Coke] | jdv79: ... we can't spend 150% of the time in a given function. | ||
RabidGravy | I just discovered that the use Foo:ver<v0.0.1> works now | 20:24 | |
El_Che | [Coke]: MAIN? | ||
:) | |||
grondilu | nope , doesn't seem faster. Actually it looks slower without the .reverse. | ||
s/.reverse/.=reverse/ | 20:25 | ||
jdv79 | right. i meant 1.5x slower. still 15% of runtime doesn't seem SUPER CRAZY. | ||
RabidGravy: in what way? | |||
20:25
FROGGS left
|
|||
jdv79 | can one actually install multiple version of the same package and use them solely or concurrently? | 20:25 | |
RabidGravy | i.e. if you have "use Foo:ver<v0.0.2>" and you only have v0.0.3 installed then it craps out | 20:26 | |
dj_goku | thanks for whoever wrote camelia and thought of this: Proc::Async is disallowed in restricted setting | ||
RabidGravy | but yes you can have multiple versions installed | 20:27 | |
timotimo | grondilu: that's because you're now slicing twice | ||
grondilu | yes, would make sense. | ||
but then what is the dispatch thing causing slowliness? | 20:28 | ||
timotimo | the difference between @foo[4,5] = @foo[4,5].reverse and @foo[4,5] = @foo[5,4] is very small | ||
grondilu | I mean there are very few function calls in this if any. | ||
jdv79 | ah | ||
timotimo | oh, damn | 20:29 | |
it wasn't .= | |||
.= is at 1.3% exclusive time and 9.2% inclusive time | |||
grondilu | notice that we could use a faster algorithm but it would require a rewrite of the tests. See github.com/perl6/roast/issues/79 | 20:31 | |
timotimo | there's some range objects that are getting created that are surprisingly expensive to be created | ||
that also goes through the slow path binder, but not the "find best dispatchee" thing | 20:32 | ||
grondilu | which range object? There's only ^$!n | ||
$k+1 ... * not being a range but a sequence. | 20:33 | ||
timotimo | it could be that POSITIONS is what spends all that damn time in the dispatch find thingie | ||
POSITIONS is at 30% inclusive time | 20:34 | ||
POSITIONS itself is cheap enough | |||
grondilu | oh it seems $k+1..@!a.end is quite faster than $k+1..* | ||
timotimo | aye, POSITIONS goes through the slow path binder | 20:35 | |
grondilu was wrong in thinking $k+1...* was used. It's $k+1..* | |||
timotimo | quite a bit, eh? | ||
m: my @a = (^20).list; for ^1000 { @a[5..*] }; say now - INIT now | 20:36 | ||
camelia | rakudo-moar 67749a: OUTPUT«0.63605866» | ||
timotimo | m: my @a = (^20).list; for ^1000 { @a[5..@a.end] }; say now - INIT now | ||
camelia | rakudo-moar 67749a: OUTPUT«0.2863622» | ||
timotimo | m: my @a = (^20).list; for ^1000 { @a[5..^+@a] }; say now - INIT now | ||
camelia | rakudo-moar 67749a: OUTPUT«0.29446261» | ||
timotimo | it's noticable at least | ||
grondilu | it's a bit silly IMHO. Shouldn't the optimizer make it as fast in all cases? | 20:37 | |
Skarsnik | yay another error in NC/Rakudo determining the size of a C structure | ||
timotimo | pfft! | ||
the optimizer can't know that stuff | |||
in the range, the * doesn't get whatever-curried, you know? | |||
m: my @a = (^20).list; for ^1000 { @a[{ 5..$_ }] }; say now - INIT now | |||
camelia | rakudo-moar 67749a: OUTPUT«0.3378164» | ||
timotimo | ^- that's 2x faster than the range with whatever as an end, but slower than putting @a.end in directly | ||
20:38
Ven joined
|
|||
grondilu | well, I'll submit a PR I guess | 20:38 | |
20:38
Ven left
|
|||
Skarsnik | damn I hate when my code is right: Your representation is smaller than the cstruct, but total size of fields match. Did you forget a field? | 20:38 | |
timotimo | :) | ||
your module seems kinda cool, Skarsnik | |||
Skarsnik | I am running it on DBIish | 20:39 | |
timotimo | grondilu: did you run a little benchmark and have an overall speed difference? | ||
20:40
Ven joined
|
|||
grondilu | yeah. | 20:40 | |
20:40
Ven left
|
|||
timotimo | does it make any difference? :< | 20:40 | |
grondilu | yes. | ||
I ran it with permutations(5). 3.9s instead of 4.5s or something. | 20:41 | ||
quite significant anyway. | |||
20:41
zacts left
|
|||
grondilu | it's not much of a benchmark though, just a manual test. | 20:41 | |
timotimo | right, fair enough | 20:42 | |
thank you for looking into it :) | |||
with the new code, i'll do some more benchmarking and profiving | |||
profiling | |||
Skarsnik | Thx mysql doc to not show the last field on their documentation. I really wish I could compile clang-smokegen :( | 20:43 | |
moritz | that you have to care about the fields of the mysql structs is already a WTF | ||
sqlite3 and postgres manage just fine with opaque data structures that you just pass along | 20:44 | ||
timotimo | grondilu: exchanging the two values via a variable and only doing single-value slices is a TON faster than .=reverse | ||
grondilu | one thing that clearly takes time is .List. I wonder if there's a quicker way to do that. | ||
really? | 20:45 | ||
20:45
Ven joined
|
|||
timotimo | yes. | 20:45 | |
Skarsnik | moritz, to get the type of a field | ||
timotimo | i can either do 10_000 .= reverse or i can do 450_000 via a variable | ||
your choice! | |||
grondilu | let me try | 20:46 | |
20:46
pdcawley_ left
|
|||
timotimo | do you think you can come up with something faster for the [$k+1 .. *] .= reverse? | 20:47 | |
grondilu | apart from using @!a.end you mean? | ||
leont | META.info doesn't work until installed? | 20:48 | |
El_Che | ideone.com/ supports perl6 | ||
grondilu | wasn't there a trick to substitute two variables without using a temp var? | ||
timotimo | grondilu: yes | ||
leont is having multiple packages in one file, and it doesn't DWIM when loading them using "use" | |||
timotimo | with xor | ||
Skarsnik | leont, what do you mean? | ||
grondilu | timotimo: can you show me? my brain is tired :P | 20:49 | |
TimToady | [Coke]: yes, we can reject #126860 | ||
grondilu | timotimo: nevermind, I got it: en.wikipedia.org/wiki/XOR_swap_algorithm | ||
leont has a file with at least two packages, the unit has the name of one of them, but I also want to export from the other one, I can't get this to work | |||
20:50
demayl left,
Ven left,
zacts joined
|
|||
moritz | only works for integers, no? | 20:51 | |
timotimo | grondilu: please note that you're currenly working with an Any array for the numbers | ||
whether or not using a native int array is better right now, i can't tell. | |||
if you're up for making it a tiny bit faster still, $i++ on a native is considerably more expensive than $i = $i + 1 is | |||
in this case, it's not $i, it's $l and ök | |||
$k | 20:52 | ||
and it's not ++, it's -- | |||
but it still applies | |||
20:53
marchelzo left
|
|||
timotimo | that won't be a noticable part of the whole. not yet anyway. | 20:53 | |
dalek | kudo/nom: 5ed63cd | grondilu++ | src/core/native_array.pm: small permutations improvement use explicit .end upper slice limit instead of Whatever. As suggested by timotimo. |
20:54 | |
kudo/nom: 1fe560d | timo++ | src/core/native_array.pm: Merge pull request #627 from grondilu/patch-5 small permutations improvement |
|||
timotimo | grondilu: i was expecting you'd also put in the exchange thing for the two slots. i guess i'll do it myself :) | ||
Skarsnik | they get freaking lazy in mysqlclient "Here you row, everything is char *" even if we can give you info on the field type | ||
grondilu | timotimo: no I'm doing it | 20:55 | |
timotimo | OK :) | 20:56 | |
grondilu | give me a sec | ||
timotimo | for me the timing of permutations is very noisy | ||
dalek | kudo/nom: 294fca4 | timotimo++ | src/core/Exception.pm: undefined types are often mistaken for subs and gobble blocks |
20:57 | |
timotimo | had that patch locally and forgot to push it | 20:58 | |
timotimo builds rakudo | 20:59 | ||
hoelzro .oO( are gobble blocks blocks that look like turkeys? ) | |||
timotimo | i never understood why turkeys supposedly say "gobble gobble" | ||
20:59
Ven joined
21:00
geraud joined
|
|||
timotimo | stage parse ... 95 seconds!? | 21:00 | |
must be overheating or something | |||
grondilu | me wonders if he can write $a = $b +^ $a as $a [R+^]= $b | ||
hoelzro ¯_(ツ)_/¯ | 21:02 | ||
moritz wonders if any clarity is gained from doing so | |||
timotimo | should be able. it could be very expensive, though | ||
grondilu | I thought it would be faster | ||
but I guess not | |||
[Coke] | (gobbled) btw, "flatten" is a better description of what's going on with that return, I think. | 21:03 | |
21:03
ZoffixMobile joined
|
|||
ZoffixMobile | ehehe. have you guys seen this? TimToady on a shirt; 72 hours left: www.kickstarter.com/projects/14228...arry-wall/ | 21:04 | |
Skarsnik | This look so weird | 21:05 | |
21:05
n0tjack joined
|
|||
ZoffixMobile | the guy on the shirt on the pic looks like Gerge Lucas.... | 21:06 | |
Skarsnik | My only perl T-shirt is the one I get a YAPC in Paris x) | ||
ZoffixMobile | "in common sizes".... well, not me then X) | 21:07 | |
The only computer shirt I ever owned was the one with xkcd's sudo make me a sandwich | |||
Skarsnik | me a sandwich not a valid target for make. | 21:11 | |
? | |||
awwaiid re-discovers the "note" sub when reading some old code | |||
ZoffixMobile | Skarsnik: xkcd.com/149/ | 21:13 | |
timotimo | grondilu: whaaaat. you actually used the xor swap trick?! is it any faster at all? | 21:14 | |
RabidGravy | timotimo, would that commit explain the "HTTP::Response.new()" in this test somehow thinking it's Block.new? | ||
timotimo | RabidGravy: what? | ||
what commit, what what? | |||
RabidGravy | "undefined types are often mistaken for subs and gobble blocks" | ||
Skarsnik | ZoffixMobile, Oh yeah xD I was just wondering what kind of error make will say x) | ||
RabidGravy | ^ | ||
timotimo | no, i don't think so | 21:15 | |
it's only about an exception message | |||
m: given ThisIsActuallyAType { say "yay" } | |||
camelia | rakudo-moar 294fca: OUTPUT«5===SORRY!5=== (or perhaps it's a class that's not declared or available in this scope?)at /tmp/nsMvko2NCb:1------> 3given ThisIsActuallyAType { say "yay" }7⏏5<EOL>Missing block (apparently claimed by 'ThisIsActuallyAType')at /tmp/…» | ||
timotimo | crap! | ||
the message got garbled! | |||
timotimo has a fix | 21:16 | ||
grondilu | timotimo: it is faster. Also I can actually use it for the @!a[$k+1..@!a.end].=reverse | ||
RabidGravy | I'm seeing "Default constructor for 'Block' only takes named arguments in block <unit> at t/030-cookies.t:172" which is HTTP::Response.new(200); | ||
grondilu | waait until I update to merge | ||
21:16
sno left,
domidumont joined
|
|||
RabidGravy | doing my nut | 21:16 | |
Juerd gives grondilu some free whitespace | |||
timotimo | grondilu: you ... really? that's kinda cool! | 21:17 | |
21:19
kaare_ left
|
|||
dalek | kudo/nom: 4313b30 | timotimo++ | src/core/Exception.pm: fix precedence in previous commit |
21:19 | |
21:20
molaf_ left
|
|||
Skarsnik | RabidGravy, maybe it's because of the ? arg | 21:20 | |
grondilu | it's an additional loop but it appears to be faster | ||
21:21
ZoffixMobile left
|
|||
grondilu | Juerd: did I not expand correctly? | 21:22 | |
timotimo | grondilu: a little loop may be a lot cheaper still than a function call that calls something else on top | ||
grondilu: if you use postfix-while or for, you can even prevent an extra lexical scope from forming, which may be cheaper, too | |||
21:23
domidumont left
|
|||
grondilu | the XOR trick requires three statement, not sure I can put them all in one. | 21:23 | |
RabidGravy | Skarsnik, I can't reproduce except if I do panda install | 21:24 | |
Juerd | grondilu: I don't understand your question. | ||
Skarsnik | RabidGravy, err, not fun :(- | 21:25 | |
timotimo | grondilu: you can, by using STATEMENT_LIST( ... ) | ||
i used that same evil trick in JSON::Fast | |||
grondilu | I can indeed but that's kind of ugly | 21:26 | |
timotimo | this is internal core setting code. it's meant to be fast and allowed to look kidna ugly | ||
kinda* | |||
thing is: someone on twitter recently complained about permutations performance, and i'm sure they're right to. | |||
grondilu | looks like that: | ||
(@!a[$k] +^= @!a[$l]), (@!a[$l] = @!a[$k] +^ @!a[$l]), (@!a[$k] +^= @!a[$l]), $l-- until ++$k >= $l; | 21:27 | ||
hoelzro | I remember observing some bad performance with permutations, but I couldn't find an easy way to fix it =/ | ||
MadcapJake | rakudo dev question: how do you start work on something new with your fork? Do you delete it and just make a new one? Or do you rebase the fork to upstream HEAD? | 21:28 | |
timotimo | hoelzro: you should have grabbed me! :) | ||
Juerd | IMHO anything is allowed to look ugly if it's accompanied by a comment that explains why it's ugly, and what it does. | ||
hoelzro | MadcapJake: delete the repo? I would just rebase | ||
timotimo | MadcapJake: with one bigger thing i've done i re-based onto master (that was in moarvm) a few times and gave the branch a number at the end to point out the rebasedness | 21:29 | |
21:29
Ven left
|
|||
hoelzro | timotimo: =( missed opportunity! | 21:29 | |
timotimo: it's still in my "look at" list if you want to collaborate on it | |||
timotimo | grondilu: it could even be that our static optimizer inlines that block for us, so it might not be worth it to use STATEMENT_LIST | 21:30 | |
hoelzro: dude, i'm working on permutations with grondilu right now :D | |||
hoelzro | =P | ||
grondilu | timotimo: that would be preferable indeed. | 21:31 | |
timotimo | grondilu: has to be measured :) | ||
how's your rakudo build times at the moment? | |||
grondilu | I may possibly golf the line above into: | ||
(@!a[$k] +^= @!a[$l]), @!a[$k] +^= (@!a[$l] = @!a[$k] +^ @!a[$l]), $l-- until ++$k >= $l; | |||
21:31
n0tjack left
21:32
colomon joined
|
|||
grondilu | or even: | 21:32 | |
(@!a[$k] +^= @!a[$l]), @!a[$k] +^= (@!a[$l] [R+^]= @!a[$k]), $l-- until ++$k >= $l; | |||
but htat's kind of silly | 21:33 | ||
hoelzro | MadcapJake: btw, do you have outstanding work that makes a rebase necessary? could you just fast forward your nom? | ||
timotimo | m: my @a = (^15).list; my int $k = 3; my int $l = 10; (@a[$k] +^= @a[$l]), @a[$k] +^= (@a[$l] = @a[$k] +^ @a[$l]), $l-- until ++$k >= $l; say @a | ||
camelia | rakudo-moar 4313b3: OUTPUT«[0 1 2 3 10 9 8 7 6 5 4 11 12 13 14]» | ||
timotimo | that was fast | ||
m: my @a = (^15).list; my int $k = 3; my int $l = 11; (@a[$k] +^= @a[$l]), @a[$k] +^= (@a[$l] = @a[$k] +^ @a[$l]), $l-- until ++$k >= $l; say @a | 21:34 | ||
camelia | rakudo-moar 4313b3: OUTPUT«[0 1 2 3 11 10 9 8 7 6 5 4 12 13 14]» | ||
timotimo | m: my @a = (^15).list; my int $k = 3; my int $l = 11; STATEMENT_LIST((@a[$k] +^= @a[$l]), @a[$k] +^= (@a[$l] = @a[$k] +^ @a[$l]), $l--) until ++$k >= $l; say @a | 21:35 | |
camelia | rakudo-moar 4313b3: OUTPUT«[0 1 2 3 11 10 9 8 7 6 5 4 12 13 14]» | ||
grondilu | if you start from $l = @a.elems you can put the $l-- at the end I think | ||
timotimo | can you check locally if either variant of these two is slower/faster? | ||
i meant with vs without STATEMENT_LIST | |||
grondilu | with STATEMENT_LIST will always be faster, won't it? | 21:36 | |
timotimo | no clue. hopefully. | ||
grondilu | because no lexical scope and stuf | ||
timotimo | the one you had up there with the commas doesn't have the lexical scope either | ||
but it may create a list | |||
grondilu | I think this is too weird, we should stick with the version with a proper block. | 21:37 | |
timotimo | sure can do. | ||
grondilu | it's in my PR if I'm not mistaken. | ||
timotimo | let me see | ||
ah, the one from before, still | 21:38 | ||
after that i'm going to have a look-see if changing the ++ and -- to assignments makes a noticable difference | 21:39 | ||
21:40
sufrostico left,
sufrostico joined
|
|||
jdv79 | looks like larry's t-shirt might not make the cut | 21:42 | |
timotimo | damn, these 2 minutes of rakudo compile time ;_; | ||
WAITWHAT | 21:43 | ||
jdv79 | is there some theoretical way to cleave the setting so compiling could be shorter? | ||
timotimo | just with the latest patch you put into the PR, my dear grondilu, time taken went from 3s to 0.7s | ||
jdv79 | some sort of partial/merged compunit or something | ||
Skarsnik | lol this time cut | ||
grondilu | XOR trick FTW | 21:45 | |
timotimo | well, i would have said it could have been done without the xor trick | ||
okay, sorted by exclusive time, we now have the pull-one method from our permutations iterator at the #1 spot with 22.95% exclusive time | 21:46 | ||
and iterator's push-exactly at 20.12% exclusive time | 21:47 | ||
then comes postcircumfix:<[ ]> at 9.99% and then elems at 4.21% | |||
jdv79 | sounds like other random profiles i've done | ||
MadcapJake | hoelzro: I don't, what would be the command to just fast-forward? I don't want to add a merge commit. | ||
jdv79 | the new list stuff pops up often | ||
hoelzro | MadcapJake: git merge --ff-only | 21:48 | |
lucs | Whoops, I can't use => as an autoquoting fat comma anymore eh, | ||
timotimo | yo grondilu we can use $n - 1 from the outer scope instead of @!a.end, no? | ||
MadcapJake | oh sweet, never knew that | ||
timotimo | lucs: yeah you can | ||
grondilu | yes | ||
hoelzro | I have that aliased to gff, I use it so often =) | ||
timotimo | wait ... | ||
lucs | Hmm... | ||
timotimo | not if you mean it to give you two positional things | ||
lucs | timotimo: I did. | ||
timotimo | yeah, no, that won't fly | ||
grondilu | but in fact you can start from $!n and start with decrementing $l | ||
lucs | And that's the error that I'm getting :) | ||
grondilu | I did it in the PR | ||
timotimo | ah, cool, let me pull that change | 21:49 | |
grondilu | you should wait until travis confirms it's ok though | ||
well, wait before merging I mean | |||
lucs | timotimo: What's actually happening with the => ? (pointer to docs please) | ||
MadcapJake | hoelzro: I have the zsh git plugin but i'm surprised there isn't an alias for that command | ||
21:49
TEttinger joined
|
|||
timotimo | lucs: if you're in a parameter list, it gets turned into a named parameter, otherwise it creates a Pair object | 21:49 | |
hoelzro | MadcapJake: plugin? do you use oh-my-zsh? | ||
MadcapJake | yeah | 21:50 | |
hoelzro | ah ha | ||
timotimo | doc.perl6.org/type/Pair - doc about pair | ||
lucs | timotimo: Thanks | ||
hoelzro | if you're curious, here are the aliases I use: github.com/hoelzro/zsh-config/blob...liases.zsh | ||
grondilu | we only have two statement in the block now, maybe it's worth putting the until at the end. | ||
MadcapJake | there's gm (git merge), gmom (git merge origin/master), gmum (git merge upstream/master) | ||
grondilu | and do the statement-list thing | ||
timotimo | doc.perl6.org/type/Capture - this has a bunch on parameters | ||
Skarsnik | I bet it's already a alias for a git oscure-cmd -Xkkl256-21~~A50 insertlinusranthere | ||
awwaiid | lucs: also doc.perl6.org/language/syntax#Pair_literals has some info | 21:51 | |
timotimo | grondilu: i can try that; how long does rakudo take to compile on your machine? | ||
oh! | |||
lucs | Always more to read, and loving it! | ||
timotimo | i think i have optimization turned off in my moarvm | ||
for debugging purposes | |||
awwaiid | (I need to figure out how to tag that so it comes up when you search for =>) | ||
grondilu | rakudo takes almost ten minutes to compile on my machine | ||
RabidGravy | what does "Serialization Error: Unimplemented case of read_ref" mean? | ||
MadcapJake | i almost feel like I should do gdad for git merge --ff-only ;) | 21:52 | |
lucs is learning Perl 6 from the inside out, so to speak, so hits different level snags at different moments. | |||
timotimo | grondilu: how about only the core setting? | ||
MadcapJake | grondilu: iirc TEST_JOBS might help | 21:53 | |
not sure if that's just for tests though | |||
leont | It's just for the tests | ||
make -j <number of cores> is helpful during building though | 21:54 | ||
timotimo | grondilu: there's a typo in your code | ||
there's only an "a" where a @!a should be | |||
grondilu | is it? | ||
timotimo | in that loop | ||
grondilu | oh yeah | ||
RabidGravy | "Missing serialize REPR function for REPR VMException" what is going on here? | ||
timotimo | RabidGravy: an exception (perhaps via a Failure) ends up in the precompiled output of some module | 21:55 | |
grondilu | I wonder if @!a[$k] +^= @!a[$l] = @!a[$k] +^ @!a[$l] requires parenthesis. I think not. | ||
RabidGravy | oh bizzare | ||
MadcapJake | leont: forgot about -j, that's good to know | 21:56 | |
jdv79 | moritz: i think the bot is missing stuff lately | ||
timotimo | copy out the whole permutations class into a simple script and try it out :) | ||
grondilu | that's what I've been doing from the beginning :) | ||
timotimo | oh, damn it. now i can't compare my numbers against the old numbers any more because i turned optimization off in moar for the old numbers and on for the new ones >:( | ||
good! | |||
i've been an idiot and editing inside the core setting | |||
i need a bigger list to test this stuff with | 21:57 | ||
it's getting too fast | |||
grondilu | been there, done that | ||
21:57
rindolf left
|
|||
[Coke] | leont: "make -j" is sufficient, I think. | 21:57 | |
timotimo | oh damn. added two numbers, the time ballooned up from 0.31s to 22.46s :D | 21:58 | |
21:58
rindolf joined
|
|||
MadcapJake | are command line options stored in %adverbs (in Compiler.nqp) | 21:58 | |
hoelzro | MadcapJake: yes | 21:59 | |
timotimo | m: STATEMENT_LIST(say "hi"; say "goodbye") | ||
camelia | rakudo-moar 4313b3: OUTPUT«higoodbye» | 22:00 | |
timotimo | i think i used a , in JSON::Fast | ||
grondilu: using "statement_list" doesn't actually make it any better. | 22:03 | ||
grondilu | ok | ||
masak | m: say 2 + 2; sub infix:<+>($l, $r) { "!!!" } | 22:04 | |
camelia | rakudo-moar 4313b3: OUTPUT«!!!» | ||
masak | overridden operators can be post-declared. freaky. | ||
22:04
regreg joined
|
|||
grondilu | I've just realised @!a is not defined as a native array. Not sure it matters. | 22:04 | |
22:05
xfix left
|
|||
xjrK | never trust these hoes; | 22:05 | |
timotimo | i told you before; i also said i don't know if a native int array would be helpful or not right now | 22:06 | |
flussence | "make -j" without a limit is usually a terrible idea | ||
22:06
skids left
|
|||
MadcapJake | how can I get environment info in nqp (perl6 version, vm, distro, time), none of the dynamic perl6 variables seem to be workingt | 22:07 | |
flussence | if you don't want to hardcode a number, at least use "make -j $(nproc)" | ||
timotimo | flussence: that's how i build moarvm, tbh | ||
flussence | timotimo: most of my systems would blow up around the 30-40 process mark | 22:08 | |
timotimo | :) | ||
i don't actually know how many processes make fans that out to | |||
Zoffix | .botsnack | ||
yoleaux | :D | ||
17:16Z <dj_goku> Zoffix: just wanted to say thanks for the IRC Client advent post. I took the plung on prototyping a interacting with gearmand in perl6. I was able to get connected last night! | |||
Zoffix | dj_goku, cool. Glad it was useful. | 22:09 | |
timotimo | ja! | ||
grondilu: replacing -- and ++ with explicit assignments got me to 2.27 from 2.4 | 22:11 | ||
hm, more like to 2.27 from 2.35 | 22:12 | ||
well, 2.37 would be more fitting | |||
22:12
colomon left
|
|||
grondilu | it's a bit LTA that ++ and -- are not efficient. | 22:12 | |
timotimo | yes. | ||
we know, we'll work on it. | |||
22:13
regreg left
|
|||
timotimo | grondilu: are you interested in fleshing out the permutations spec tests? | 22:14 | |
22:14
regreg joined
|
|||
timotimo | because damn, those are *weak* | 22:14 | |
grondilu: i expect there's more to be gained from turning postcircumfix:<[ ]> into .AT-POS | |||
but that'll make things very ugly indeed | 22:15 | ||
grondilu | I've made suggestions already: github.com/perl6/roast/issues/79 | ||
it's definitely LTA that .AT-POS is more efficient than postcircumfix:<[ ]> | 22:16 | ||
timotimo | yes. | ||
grondilu | I suggest we keep [ ] until it's fixed. | ||
and same for ++ and -- | |||
22:16
Zoffix left
|
|||
timotimo | can you compare the algorithm suggested in that ticket against the current implementation now that we've micro-optimized it? | 22:17 | |
grondilu | it will still be faster I think | ||
but ok I can check | 22:18 | ||
though the other algorithm could also use some XOR magic | 22:19 | ||
so there's not much point to compare. | |||
(until the otehr algorithm is re-written, that is) | |||
timotimo | sure | ||
grondilu | and we can't use it until the test are re-written anyway | 22:20 | |
so let's just keep it in cold storage | |||
timotimo | fair enough | 22:21 | |
i would accept the suggested change to the permutations test, btw | |||
to sort it | |||
flussence | «Stage parse : 372.765» -- my 32-bit, 1.6GHz netbook is only 4x as slow as my desktop at this. Thought it'd be much worse... | 22:22 | |
timotimo | wow | ||
grondilu: interestingly, the .List method isn't getting jitted. perhaps there's a tiny win to be had there, too. | 22:25 | ||
grondilu: right now, though, Iterator's general "push-exactly" is where we spend 25% of run time and only 20% run time is spent in pull-one of the permutation iterator | 22:26 | ||
quite frankly, that surprises me a little bit | |||
22:27
ChoHag left
|
|||
grondilu | I don't know what "push-exactly" is. I'll have a look. | 22:27 | |
timotimo | it basically iterates over .pull-one until the target has as much as it wants | 22:28 | |
lol. oh crap. it gets called exactly as many times as pull-one minus 2 | 22:29 | ||
so it seems like it's calling push-exactly with "please give me one entry" each time | |||
22:30
raoulvdberge left
|
|||
grondilu | isn't that normal? | 22:31 | |
timotimo | why doesn't it call push-one or pull-one instead? | ||
perhaps it'd be worth it to give the general push-exactly a "fast path" for the argument "gimme one" | |||
regreg | does perl6 have any GUI library? | 22:32 | |
jdv79 | wasnt that part of the design? all one needs to impl is pull-one and the rest builds on that (probably suboptimally) | ||
grondilu | I don't know. Those Seq and Iterator classes are complicated. | 22:33 | |
Skarsnik | regreg, there is a part of Gtk that has a binding (search gtk-simple on the ecosystem) | ||
:eco gtk | |||
x) | |||
timotimo tries it out | |||
grondilu | FYI, I took Str.comb as a model to write permutations. | ||
22:33
joeschom joined
|
|||
timotimo | yeah, that was a good idea | 22:35 | |
weird. my fast path doesn't get executed | 22:37 | ||
22:38
PotatoGim left
22:39
cognominal joined
|
|||
timotimo | please push exactly 2147483647 | 22:39 | |
so why the F does that method get called a fuckton of times? | 22:40 | ||
Skarsnik | to piss you off? | ||
timotimo | probably. | 22:41 | |
hum. | 22:43 | ||
it does push 8 at a time | |||
i really don't get it :) | 22:44 | ||
jdv79 | you need to become one with the GLR | ||
grondilu | yeah that's definitely GLR-specific stuff | 22:45 | |
timotimo | oh! | 22:46 | |
there's another pull-one that gets called 362951 times | |||
40323 calls of push-exactly and 40321 calls of the "expensive" pull-one | 22:47 | ||
imagine my surprise :) | |||
22:49
sno joined
22:50
sno left
22:59
joeschom left
|
|||
lizmat | timotimo: are you sure it's not calling the "default" push-exactly ? | 23:02 | |
timotimo | lizmat: it is! | 23:03 | |
lizmat | ah, but every time only for 1 elem, right ? | ||
timotimo | nah, many thousands :) | ||
lizmat | I recall seeing that and wondered why it wouldn't be calling pull-one directly | ||
timotimo | it's not as bad as i thought it'd be | 23:04 | |
grondilu: i'm about to merge your PR. are you ok with that? | |||
lizmat: i wonder if we can do better than what List.permutations does now | 23:07 | ||
lizmat | probably :-) | ||
23:07
RabidGravy left
|
|||
timotimo | like, the normal permutations function currently does a full copy of @!a, but the permutations method of list doesn't modify that list, so it *could* return the original. but it would have to get that passed in somehow | 23:08 | |
masak | 'night, #perl6 | ||
timotimo | ginte masak! | ||
the overhead of pulling the values from that list is about 6 seconds | 23:09 | ||
that was less than half when we began optimizing, but now it's almost 3x as much :) | |||
nine | MadcapJake: there's nqp::getenvhash | 23:10 | |
dalek | kudo/nom: 7e9610c | grondilu++ | src/core/native_array.pm: small permutations improvement use XOR swap trick, as suggested by timotimo |
23:12 | |
23:12
dalek left
23:13
dalek joined,
ChanServ sets mode: +v dalek,
loren joined
23:15
loren left
|
|||
nine | Why oh why does the require Inline::Perl5; in src/core/control.pm's EVAL sub not find CompUnit::RepositoryRegistry at runtime ($*W.symbol_lookup(['CompUnit', 'RepositoryRegistry'], $/)) while every other require statement can? | 23:15 | |
lizmat | nine: because you twiddle with the context ? | 23:16 | |
23:16
Skarsnik left
|
|||
nine | lizmat: err...what does that mean? | 23:16 | |
23:17
regreg left
|
|||
lizmat | so, you're not passing a :context ? | 23:17 | |
nine | lizmat: not that I'm aware of, no | 23:18 | |
Could not find symbol 'RepositoryRegistry' | |||
23:18
sufrostico left
23:19
kid51 joined
|
|||
timotimo | what does your block stack look like at that point? | 23:19 | |
because all it does is look at all the Block objects it's entered so far and try to find CompUnit::RepositoryRegistry in there | |||
lizmat | nine: maybe you need to stub it ? | ||
nine | Is symbol_lookup actually the right tool for this job? This used to be find_symbol but I degraded it to a runtime lookup (or at least try to) so I could get rid of CompUnit::RepositoryRegistry in the BOOTSTRAP | 23:21 | |
lizmat | nine: not sure... | ||
nine | That's the full backtrace: gist.github.com/niner/67d4f2170d7e37db3858 | 23:22 | |
What I find odd about it is the FALLBACK in there | |||
Makes me think that maybe I'm looking at the wrong place. But there's not that many places which refer to CompUnit::RepositoryRegistry (formerly CompUnitRepo) directly. And only one where the name is actually split into those components. | 23:23 | ||
timotimo | nine: comes from the Failure class | 23:24 | |
nine | Ok there's 2 places: the other is method comp_unit in Perl6::Actions | ||
timotimo | hoelzro: did you see? permutations($n) improved by almost 6x | 23:27 | |
hoelzro | \o/ | 23:28 | |
timotimo++ grondilu++ | |||
way to go! | |||
timotimo | i think the permutations method on ranges should check if the range is from 0 to some value and just call the permutations sub directly instead of self.flat.permutations | ||
nine | Oooh...it _is_ actually method comp_unit if the debug print is to be believed | 23:31 | |
23:32
Zoffix joined
|
|||
nine | And there I still use find_symbol which will not find it because it's no longer in BOOTSTRAP | 23:33 | |
timotimo | oh! | 23:34 | |
23:38
lucasb joined
|
|||
lucasb | I read in the backlog that ++/-- are slower than manually increment/decrement? | 23:40 | |
23:41
Zoffix left,
PotatoGim joined
|
|||
timotimo | lucasb: on native integers | 23:41 | |
lizmat | at the moment | 23:43 | |
lucasb | ah, I just tested. thanks, timotimo | ||
nine | Now I'm back to "Cannot call method 'AT-KEY' on a null object" when loading a precomp file :/ | ||
lucasb | strange that with "my $i", $i++ is faster than "$i=$i+1", but with "my int $i", it's the other way around | ||
flussence | is Str.encode('utf16') big or little endian? | ||
23:44
Zoffix joined
|
|||
Zoffix | Hm, rakudobrew build-panda still freezes for me on JSON::Fast :( | 23:45 | |
lucasb | panda wasn't updated | ||
Zoffix | oh, it includes it with it :/ | ||
lucasb | you can call update-subtree.pl ext/JSON__Fast in panda root | 23:46 | |
timotimo | oh, sorry, i forgot to do that | ||
Zoffix | Where's panda root? | ||
23:47
cdg left
|
|||
timotimo | there we go. | 23:47 | |
Zoffix | looks like ~/.rakudobrew/moar-nom/panda | ||
lizmat | lucasb: that's not strange if you realize that for a native int to be ++, it basically needs to upgraded to an Int, and then downgraded again | ||
timotimo | lizmat: more or less | 23:48 | |
Zoffix | timotimo++ that fixed it thanks. | ||
lucasb | lizmat: hm, I didn't know that, thanks for the info | ||
23:48
Zoffix left
|
|||
timotimo | lucasb: the main source of performance trouble is that our inliner doesn't yet understand ++ on native ints, so it ends up doing full function calls | 23:48 | |
lucasb | so, IOW, boxing and unboxing just to increment it :( | ||
timotimo | not quite boxing/unboxing. taking a native reference in this case | 23:49 | |
plus, on something as simple and cheap as ++, making the reference and calling the function is 99% overhead at least | |||
at some point, spesh will understand native references completely and when the ++ sub gets inlined then, it'll not have to generate the reference; it'll just do the increment/decrement in place on the register and *then* it'll be crazy cheap | 23:50 | ||
the thing about Int, on the other hand, is that it's a full object with the potential to become infinitely big | |||
23:51
colomon joined
|
|||
timotimo | lucasb: does that explain things? | 23:51 | |
lucasb | timotimo++, explain very well! :) | 23:52 | |
timotimo | i'm deep into the whole performance topic. sadly, not good enough at it to make a dent in either of those problems :| | 23:56 | |
either meaning a) the inliner recognizing NativeRef properly and b) spesh not turning NativeRef into a direct usage of the given register/lexical |