»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:02
sena_kun left
00:04
mcmillhj joined
00:05
sufrostico joined
00:09
mcmillhj left
00:11
girafe left
00:12
Sgeo joined
00:18
sufrostico left
00:19
cyphase left
00:24
cyphase joined,
xenu joined
|
|||
xenu | code examples at perl6.org have messed up formatting | 00:26 | |
i can fix it, i have a commit bit | |||
but the question is 4 spaces or 2 spaces? | |||
before commit that broke it, first example had two spaces and third one had four spaces | 00:27 | ||
(second doesn't need any indenation) | |||
indentation* | |||
MasterDuke | average it out then, 3 | ||
xenu | nah, (4+2+0)/3 == 2 | 00:28 | |
MasterDuke | well, my non-joking vote is 4 | 00:29 | |
00:29
mcmillhj joined
00:30
Brass_Lantern left
00:34
mcmillhj left
00:41
mcmillhj joined
00:42
mantovani left,
BenGoldberg joined,
mantovani joined
00:46
mcmillhj left
00:47
dainis joined
00:48
wamba left
00:50
wamba joined
00:52
mcmillhj joined
00:53
trnh left
00:56
wamba left
|
|||
dalek | href="https://perl6.org:">perl6.org: 5617d84 | (Tomasz Konojacki)++ | source/index.html: normalize code snippets indentation (4 spaces) |
00:56 | |
00:56
labster left
|
|||
xenu | went with 4 spaces, i prefer it that way too | 00:56 | |
00:58
mcmillhj left
00:59
adu left,
bob777 left
01:02
bob777 joined
01:03
labster joined,
webstrand joined
01:08
Actualeyes joined
01:09
adu joined,
mcmillhj joined
01:14
mcmillhj left
|
|||
BenGoldberg | m: gather { take 42 }; 43; | 01:15 | |
camelia | rakudo-moar 8ede35: OUTPUT«WARNINGS for <tmp>:Useless use of constant integer 43 in sink context (line 1)» | ||
BenGoldberg | Why doesn't gather in sink context warn? | ||
01:20
cyphase left
01:21
cibs left
01:22
TEttinger left
01:23
cibs joined
01:24
dainis left,
TEttinger joined,
cyphase joined
01:25
mohae_ joined
01:26
cognominal joined
01:27
canopus left,
mohae left
|
|||
timotimo | m: gather { say "hi"; take 1; say "boo"; take 2; }; 99; | 01:31 | |
camelia | rakudo-moar 8ede35: OUTPUT«WARNINGS for <tmp>:Useless use of constant integer 99 in sink context (line 1)hiboo» | ||
timotimo | ^- because sinking a gather executes its contents | ||
01:32
canopus joined
01:33
zacts joined
01:40
mcmillhj joined
01:45
mcmillhj left
01:51
johndau joined
01:52
mcmillhj joined
01:54
ParsonsNose left
01:56
mcmillhj left
02:07
holyghost left
02:08
holyghost joined
02:26
adu left
02:29
kid51 left
02:33
AlexDaniel left
02:35
mcmillhj joined
02:39
noganex_ joined
02:40
mcmillhj left
02:41
noganex left
02:49
mcmillhj joined,
Actualeyes left
02:53
mcmillhj left
02:57
kaare__ joined
03:01
adu joined
03:03
molaf joined
03:05
mcmillhj joined
03:06
holyghost left
03:07
holyghost joined
03:10
mcmillhj left
|
|||
Hotkeys | p6 doesn't have TCO does it? | 03:20 | |
or rather rakudo | 03:21 | ||
03:22
mcmillhj joined
03:26
mcmillhj left
03:27
zacts left
03:42
labster left
03:49
khw left
03:51
Actualeyes joined
03:55
itaipu joined
03:56
nic joined,
nic is now known as nicq
|
|||
nicq | Is anyone on ATM? | 03:57 | |
Anyone know if there is an effort to add Rakudo with the moarVM to a package repo for Ubuntu or other distro? | 03:59 | ||
04:03
nicq left
04:07
mcmillhj joined
04:10
johndau left
04:11
johndau joined
04:12
mcmillhj left
04:19
mcmillhj joined
04:20
tx0h joined
|
|||
tx0h | hello | 04:20 | |
04:20
molaf left
|
|||
gfldex | m: say "ohai tx0h!" | 04:20 | |
camelia | rakudo-moar 8ede35: OUTPUT«ohai tx0h!» | ||
tx0h | is there a way to check if a dbiish connection is still alive? i like to keep my connection persistent open but it may happen that the database server needs to restart but the $dbh isn't connected after the restart (of cause) | 04:22 | |
konobi | query with SELECT 1 every so often =0) | 04:23 | |
tx0h | ok, but is this select cheaper than setting up a new connection? | 04:24 | |
04:25
mcmillhj left
|
|||
konobi | yup | 04:27 | |
04:30
itaipu left
04:32
adu left
|
|||
tx0h | oh, but a do('select 1') also throws an error, error handling on dbiish isn't documented. | 04:33 | |
geekosaur | .u 61612 | 04:39 | |
yoleaux | No characters found | ||
04:45
Cabanossi left
04:48
Cabanossi joined
04:49
AlexDaniel joined
|
|||
AlexDaniel | please don't get angry about FAQ issues that I submit. I find it funny, hope you have a good laugh too. | 04:49 | |
04:53
skids left
|
|||
tx0h | ok, try..CATCH works well | 04:54 | |
i try to do my first perl6 web project :-) | 04:56 | ||
04:59
holyghost left
05:00
xinming left,
xinming joined
05:05
labster joined
05:07
avis joined
05:13
mcmillhj joined
|
|||
stmuk | AlexDaniel: your comments are useful but I'm not keen on things being described as "weird". | 05:14 | |
05:16
avis left
05:18
mcmillhj left
|
|||
AlexDaniel | stmuk: Couldn't find any better word. Didn't try harder because I thought that the word choice there is not important | 05:20 | |
stmuk | github seems totally broken anyway :/ | ||
AlexDaniel | yeah, down | ||
05:25
nemo left
|
|||
Roamer` | hmm, is there any appreciable difference between for %hash{*}:kv and for %hash.kv? | 05:42 | |
TimToady | the latter is likely to be a bit faster | 05:43 | |
(I could be wrong about that, of course.) | 05:45 | ||
psch | m: my %h = :1a, :2b, :3c; say %h{*}.kv eqv %h.kv | 05:46 | |
camelia | rakudo-moar 8ede35: OUTPUT«False» | ||
psch | m: my %h = :1a, :2b, :3c; say %h{*}.kv.perl; say %h.kv.perl | ||
camelia | rakudo-moar 8ede35: OUTPUT«(0, 1, 1, 3, 2, 2).Seq("a", 1, "c", 3, "b", 2).Seq» | ||
Roamer` | erm, psch, {*}:kv, not {*}.kv | ||
psch | oh | ||
my bad | |||
TimToady | oh, {*} is a list | ||
psch | m: my %h = :1a, :2b, :3c; say (%h{*}:kv).perl; say %h.kv.perl | 05:47 | |
camelia | rakudo-moar 8ede35: OUTPUT«("a", 1, "c", 3, "b", 2)("a", 1, "c", 3, "b", 2).Seq» | ||
Roamer` | TimToady, would that be because the {*} has to build a list of the pairs first and then iterate over them, and the .kv just starts iterating? | ||
yeah, looks that way, thanks to you both | |||
TimToady | :kv may have to check each key to see that it exists, unless it's smart about * producing all existing keys | 05:48 | |
05:48
ufobat joined
|
|||
TimToady | it it's smart enough, it could just translate {*}:kv to .kv though | 05:49 | |
ufobat | good morning p6 :-) | 05:51 | |
05:52
BenGoldberg left
|
|||
TimToady | o/ | 05:52 | |
05:52
agent_white joined
|
|||
tx0h | what i really don't like are the nuance differences between p5 and p6. the space between if and ( for instance, or the asterisk in %*ENV... | 06:03 | |
06:03
canopus left
|
|||
TimToady | it's all in the interests of namespace management for extensibility | 06:04 | |
keywords are not functions, so you may not call a keyword as if it were one | |||
06:05
CIAvash joined
|
|||
TimToady | that let's us add keywords or functions independently | 06:05 | |
*lets | |||
06:05
mohae_ left
|
|||
TimToady | likewise you don't have to know that ENV is special, the * tells you that it's a dynamic/global variable | 06:05 | |
in p5 you have to memorize the list of special symbols | |||
tx0h | but you have to agree that these differences are annoying. especially if you you program in both languages parallel | 06:07 | |
TimToady | everything is annoying, if you let it :) | ||
06:09
canopus joined
06:10
AlexDaniel left
|
|||
tx0h | i hope for a epic6 or such alike module for eclipse, that would be great. | 06:10 | |
06:14
flaviusb joined
06:17
dogbert2 joined
06:20
dogbert17 left
06:24
nemo joined,
domidumont joined,
nemo is now known as Guest78450,
labster left
06:27
mcmillhj joined
06:28
firstdayonthejob joined,
labster joined
06:29
darutoko joined,
domidumont left
06:32
mcmillhj left
|
|||
stmuk | I always found if( annoying in perl 5 | 06:33 | |
tx0h | stmuk: you didn't got forced to don't use a whitespace | 06:36 | |
06:36
canopus left
|
|||
tx0h | use or not use whitespaces is part of freedom of expression. thats why i don't like the python block concept, where whitespaces are part of the syntax. now p6 follows this idiocracy | 06:38 | |
06:42
johndau left,
mcmillhj joined,
johndau joined
|
|||
stmuk | github.com/FROGGS/p6-Slang-Tuxic may be of interest | 06:44 | |
06:44
firstdayonthejob left,
domidumont joined
06:47
mcmillhj left,
domidumont left
06:48
domidumont joined
|
|||
tx0h | yepp, there are some approaches | 06:50 | |
ty | |||
this already shows that there is a problem (even if it is a psychological) | 06:51 | ||
TimToady yawns | |||
06:52
johndau left,
johndau joined
|
|||
tx0h | sry | 06:56 | |
06:57
mcmillhj joined
06:59
canopus joined
07:01
mcmillhj left
07:02
froobar left
07:08
domidumont left,
domidumont joined
07:09
canopus left,
mcmillhj joined
07:14
mcmillhj left
07:18
canopus joined
07:20
rindolf joined
07:23
avis joined
07:24
mcmillhj joined
07:25
domidumont left
07:28
mcmillhj left
07:29
abraxxa joined
07:33
cyphase left
07:34
sno left
07:35
domidumont joined
07:36
avis left
07:37
cyphase joined
07:39
freeside joined,
mcmillhj joined
07:43
RabidGravy joined,
mcmillhj left
07:47
wamba joined
|
|||
Roamer` | I guess there wouldn't really be a way to uninstall a single installed module (or even a module and everything that depends on it) from a repository | 07:51 | |
is there then a way to blow away everything that has been installed by panda? | |||
of course I can rakudobrew nuke and then build again, but is there a faster way? | |||
DrForr | That's more of a package-manager thing. | 07:52 | |
07:54
pmqs left
|
|||
moritz | Roamer`: I think zef supports uninstallation, or something | 07:56 | |
07:58
dakkar joined
|
|||
Roamer` | moritz, ahh, I guess it's time I actually tried a different package manager. Okay, thanks | 07:59 | |
07:59
mcmillhj joined
08:03
agent_white left,
mcmillhj left
|
|||
lizmat | TimToady: so $supply.emit --> Nil, what about sub emit ? | 08:04 | |
Making that also --> Nil breaks some expectations, I'm afraid | |||
however, I would be all for it, as it would allow for easier / better optimisations | 08:05 | ||
08:09
ufobat left,
ufobat joined,
mcmillhj joined
08:10
pmqs joined
08:14
mcmillhj left
08:16
dj_goku left,
dj_goku joined,
dj_goku left,
dj_goku joined
|
|||
stmuk | Roamer`: zef has module uninstall | 08:21 | |
as moritz says | |||
08:22
mcmillhj joined
|
|||
stmuk | me-- # not fully reading scrollback | 08:22 | |
08:25
zakharyas joined
08:26
vendethiel joined,
mcmillhj left
08:34
mcmillhj joined
08:35
Actualeyes left
08:36
ParsonsNose joined
08:39
mcmillhj left
08:46
mcmillhj joined,
sno joined
08:47
nowan_ joined
08:48
domidumont left
08:50
nowan left
08:51
mcmillhj left
08:52
mr-foobar joined
08:53
mr-fooba_ joined
08:54
domidumont joined
08:56
mr-foobar left
09:00
Poisson joined
09:01
salv0 joined
09:06
bob777 left
09:08
xinming left
09:15
telex left
09:16
telex joined
09:32
ribasushi left,
kurahaupo joined
09:33
kurahaupo left
09:35
kurahaupo joined,
kurahaupo left
09:38
ribasushi joined
09:40
domidumont left
09:41
domidumont joined,
zakharyas left
09:43
zakharyas joined
09:45
ChoHag joined
10:00
ParsonsNose left
10:02
zakharyas1 joined
10:10
johndau left
10:12
ismailarilik joined
|
|||
ismailarilik | Hi! | 10:12 | |
I has seen this error message: | |||
===SORRY!=== Unable to write bytecode to 'C:\Users\ismail\Öğretmen\lib\.precomp\03419F43BFFCE0AEDE2CD622AE91E8513382EF49.1468939074.63395\A3\A3416250288174506BE179C4BE847ECCB7196C9A.bc' | |||
10:14
xescugc joined
|
|||
ismailarilik | I have two related files: lib\model.pm6 and bin\komut-arayüzü.p6 | 10:14 | |
10:14
tx0h left
|
|||
ismailarilik | The first line of lib\model.pm6: unit module Model; | 10:14 | |
The first line of bin\komut-arayüzü.p6: use Model; | 10:15 | ||
10:15
tx0h joined
|
|||
ismailarilik | I run bin\komut-arayüzü.p6 file on the project directory with this command: perl6 -I "lib" bin\komut-arayüzü.p6 | 10:16 | |
Where am I wrong? | |||
10:18
molaf joined
|
|||
psch | ismailarilik: the problem is that the perl6 executable can't open the file for writing | 10:19 | |
10:19
RabidGravy left
|
|||
psch | ismailarilik: that's more likely to be a permission problem in your operating system than a bug in your Perl 6 code | 10:19 | |
ismailarilik | The project directory is in my home directory | ||
C:\Users\ismail\Öğretmen>perl6 -I "lib" bin\komut-arayüzü.p6 | |||
Is it related with a encoding problem? | 10:20 | ||
psch | possibly | ||
i don't know how windows/ntfs encodes paths | 10:21 | ||
ismailarilik | Okay, I will use ASCII for files and directories and try again | ||
psch | in any case, the error you're getting is from the VM backend and happens if the call to fopen fails | ||
10:21
hwcomcn joined
|
|||
ismailarilik | Command has worked on this directory: C:\Users\ismail\Ogretmen | 10:23 | |
So it is related with an encoding problem. | |||
Thanks a lot. =) | |||
psch | ismailarilik: what's your filesystem? | 10:27 | |
ismailarilik | I guess it is NTFS | 10:28 | |
How I can learn it precisely? | |||
psch | right click on the partition and click "Properties" | 10:29 | |
your system encoding probably also plays a role | |||
ntfs internally encodes as utf16, and we encode the filename as utf8, so that might be it already | 10:30 | ||
we do have a dev on windows, but i assume they're pretty anglocentric in path and filenames :) | |||
ismailarilik | I have looked up | 10:36 | |
It is NTFS | |||
I created all these files, not fetched from a VCS host, for ex. GitHub. | 10:37 | ||
10:43
Vazyla joined
10:47
Poisson left
10:48
zakharyas1 left
|
|||
mniip | $ perl6 test.pl6 | 10:58 | |
Segmentation fault (core dumped) | |||
I suppose that's not something that's supposed to happen | |||
gfldex | ismailarilik: git and shares don't mix well. Make sure you don't got any anything, including the temp dir on a share, before you write a bug report. | 11:00 | |
masak | mniip: you suppose correctly | ||
gfldex | mniip: please rakudobug | ||
jnthn | Well, unless you did something silly with nativecall :) | 11:01 | |
mniip | nah I was doing a some pretty primitive messing around | 11:02 | |
and I think I accidentally multi'ed a builtin | |||
jnthn | hm, most of 'em are multis. But yeah, file it :) | ||
11:03
xescugc left
|
|||
mniip | bpaste.net/show/25676c934f42 | 11:06 | |
gfldex | gist.github.com/gfldex/491d637082d...7adcd2746c | 11:08 | |
m: gist.github.com/gfldex/491d637082d...7adcd2746c | |||
camelia | rakudo-moar 7f9623: OUTPUT«(signal SEGV)» | ||
gfldex | m: multi cross(&f, @ ($x, *@xs), @ys) { flat map({&f($x, $_)}, @ys), cross(&f, @xs, @ys); }; multi cross(&f, @ (), @ys) { (); } | 11:09 | |
camelia | rakudo-moar 7f9623: OUTPUT«(signal SEGV)» | ||
gfldex | m: multi cross(&f, @ ($x, *@xs), @ys) { flat map({&f($x, $_)}, @ys), cross(&f, @xs, @ys); }; multi cross(&f, @, @ys) { (); } | ||
camelia | rakudo-moar 7f9623: OUTPUT«(signal SEGV)» | ||
gfldex | m: multi cross(&f, @ ($x, *@xs), @ys) { flat map({&f($x, $_)}, @ys), cross(&f, @xs, @ys); }; multi cross(&f, @, @ys) {} | ||
camelia | rakudo-moar 7f9623: OUTPUT«(signal SEGV)» | ||
gfldex | m: multi cross(&f, @ ($x, *@xs), @ys) {}; multi cross(&f, @, @ys) {} | 11:10 | |
camelia | rakudo-moar 7f9623: OUTPUT«(signal SEGV)» | ||
gfldex | m: multi cross() {}; multi cross() {} | ||
camelia | rakudo-moar 7f9623: OUTPUT«(signal SEGV)» | ||
gfldex | m: multi cross() {}; | 11:11 | |
camelia | rakudo-moar e87752: OUTPUT«(signal SEGV)» | ||
mniip | haha | ||
gfldex | that may be the shortest segfault we ever had :) | ||
11:16
cibs left
|
|||
masak | no, I think we've had shorter ones | 11:16 | |
diakopter++ holds some hard-to-beat records in that department | 11:17 | ||
gfldex | mniip: please rakudobug the golfed version | ||
11:18
cibs joined
|
|||
mniip | I guess I can golf it a but further | 11:18 | |
m: multi cross{} | 11:19 | ||
camelia | rakudo-moar e87752: OUTPUT«(signal SEGV)» | ||
masak | src/core/List.pm:my &cross = &infix:<X>; | 11:20 | |
that's the declaration | |||
hm... | |||
m: my &foo = &infix:<X>; multi foo{} | |||
camelia | rakudo-moar e87752: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Redeclaration of routine fooat <tmp>:1------> 3my &foo = &infix:<X>; multi foo{}7⏏5<EOL>» | ||
masak | m: my &foo = &infix:<X>; { multi foo{} } | ||
camelia | ( no output ) | ||
masak | ok, hypothesis disproved | 11:21 | |
mniip | um | ||
crashes over here | |||
masak | not here | ||
This is Rakudo version 2016.07.1-57-g0419194 built on MoarVM version 2016.07-3-gc01472d | 11:22 | ||
mniip | This is Rakudo version 2016.07.1 built on MoarVM version 2016.07 | ||
masak | bisectable: my &foo = &infix:<X>; { multi foo{} } | ||
bisectable | masak: On both starting points the exit code is 0 and the output is identical as well | ||
masak: Output on both points: | |||
masak | bisectable says it works always :) | ||
bisectable | masak: On both starting points the exit code is 1 and the output is identical as well | ||
masak: Output on both points: ===SORRY!=== Error while compiling /tmp/NsiSKwsZ9pPreceding context expects a term, but found infix : insteadat /tmp/NsiSKwsZ9p:1------> says it works always :<HERE>) | |||
11:22
TEttinger left
|
|||
masak | oh come on, bisectable | 11:23 | |
bisectable: help | |||
bisectable | masak: Like this: bisectable: good=2015.12 bad=HEAD exit 1 if (^∞).grep({ last })[5] // 0 == 4 # RT128181 | ||
masak | bisectable: url? | ||
bisectable | masak: On both starting points the exit code is 1 and the output is identical as well | ||
masak: gist.github.com/1417c4b529e8c813d6...e45f8e4df6 | |||
masak finds github.com/perl6/bisectbot | |||
mniip | ! | 11:24 | |
it crashes if you enter it as two lines into the repl | |||
11:25
TEttinger joined,
labster left
|
|||
lizmat | fwiw, I'm testing a fix on the segv | 11:26 | |
masak | aha -- metacpan.org/source/HINRIK/Bot-Bas...ot.pm#L669 means that the ":" is optional after "bisectbot" | 11:29 | |
I think I have what I need to put together a patch | |||
lizmat | 998a1ef has a fix for the "multi cross" segv | 11:32 | |
mniip | gfldex, perhaps I'm eligible for "least time spent with perl to make it crash" because I literally only started figuring out the language yesterday | 11:44 | |
11:45
Guest78450 is now known as nemo
|
|||
El_Che | mniip: you figured out perl? :) | 11:46 | |
11:46
mantovani left
|
|||
masak | yes, do tell :P | 11:47 | |
lizmat | mniip++ # but now it doesn't crash anymore :-) | ||
mniip | El_Che, I can't say I did that yet | 11:48 | |
so far I'm not seeing the large scale idea | |||
11:48
mantovani joined
11:52
maddingue left,
mantovani left
11:55
maddingue joined
11:57
Actualeyes joined
12:00
kid51 joined,
mantovani joined
|
|||
gfldex | mniip: quite a few things are not implemented yet. You can't have autothreading if your threading stuff produces odd behaviour including segfaults. | 12:00 | |
12:03
jkramer joined
|
|||
jkramer | Ahoy! | 12:03 | |
12:03
kid511 joined
12:04
kid51 left
|
|||
jkramer | How can I re-export used modules from a module? Or just some stuff from a module? Is there something like 'use SomeModule is export;'? | 12:04 | |
gfldex | jkramer: see: docs.perl6.org/language/modules#EXPORT | 12:05 | |
12:06
itaipu joined
12:07
mantovani left
|
|||
dalek | c: bd72f04 | (Wenzel P. P. Peppmeyer)++ | doc/Language/modules.pod6: add sub EXPORT to index |
12:08 | |
mniip | lizmat, hmm, are those builtin modules somehow special? | 12:14 | |
is there something preventing us from doing a similar setup with something different from cross | |||
ah I see you created an issue on moarvm | 12:16 | ||
12:18
itaipu left
|
|||
[Coke] | table of contents hide/show is broken for me on chrome, os x, docs.perl6.org/type/AST | 12:18 | |
12:19
mantovani joined
|
|||
Ulti | if I wanted a sliding window over a list is there a nice builtin for it? so the list (1,2,3,4) I would want returned for a window of 2 ((1,2),(2,3),(3,4)) | 12:21 | |
rotor but on a position rather than value is sort of that thing | |||
[Coke] | ok, reload makes it work, but now the hide is silly - it just blanks it out, doesn't free up any space. | 12:22 | |
[Coke] finds/opens a ticket. :| | |||
[Coke] bumps github.com/perl6/doc/pull/767 - my recommendation is to revert for now. | 12:24 | ||
jnthn | m: say (1,2,3,4).rotor(2, -1) | ||
camelia | rakudo-moar aa5e49: OUTPUT«===SORRY!===Cannot have elems < 1, did you mean to specify a Pair with => -1?» | ||
jnthn | m: say (1,2,3,4).rotor(2 => -1) | ||
camelia | rakudo-moar aa5e49: OUTPUT«((1 2) (2 3) (3 4))» | ||
jnthn | Ulti: ^^ | 12:25 | |
Ulti | thats neat | 12:27 | |
I just came up with one that invokes a scary error! :D | |||
m: say (2,3,4).combinations.grep: 1 < *.elems < 3 | |||
camelia | rakudo-moar aa5e49: OUTPUT«===SORRY!===QAST::Block with cuid 1 has not appeared» | ||
Ulti | wat | ||
m: say (2,3,4).combinations.grep: 1 < *.elems | |||
camelia | rakudo-moar aa5e49: OUTPUT«((2 3) (2 4) (3 4) (2 3 4))» | ||
Ulti | not what I wanted | 12:28 | |
but its an interesting error | |||
thanks jnthn | |||
jnthn | wat | ||
Yeah, indeed it is | |||
Ulti | I'll take your solution and give you a bug ;) | ||
feels fair | |||
jnthn | Dammit :P | ||
otoh, at least it's not another concurrency bug :) | |||
12:28
shillo joined
|
|||
Ulti | yeah and it came ready golfed | 12:29 | |
jnthn | :) | ||
m: 1 < *.elems < 3 | |||
camelia | rakudo-moar aa5e49: OUTPUT«===SORRY!===QAST::Block with cuid 1 has not appeared» | ||
jnthn | Golfeder | ||
Ulti | golfest | ||
shillo | Hey, is this a known problem? Pushing into large arrays (>4M elemenets) seems to have square complexity | ||
For instance, small arrays: | 12:30 | ||
perl6 -e 'my @a; @a.push($_) for ^1000000' 0.99s user 0.06s system 99% cpu 1.052 total | |||
perl6 -e 'my @a; @a.push($_) for ^2000000' 2.08s user 0.08s system 99% cpu 2.163 total | |||
perl6 -e 'my @a; @a.push($_) for ^4000000' 4.72s user 0.12s system 99% cpu 4.845 total | |||
.. and then larger ones: | |||
perl6 -e 'my @a; @a.push($_) for ^8000000' 12.25s user 0.22s system 99% cpu 12.482 total | |||
jnthn | shillo: Yes, every time it resizes it has to copy. It doens't know how many elements you're going to have up front. | ||
shillo | perl6 -e 'my @a; @a.push($_) for ^16000000' 36.75s user 0.53s system 99% cpu 37.346 total | 12:31 | |
12:31
TEttinger left
|
|||
shillo | perl6 -e 'my @a; @a.push($_) for ^32000000' 124.53s user 1.17s system 99% cpu 2:05.91 total | 12:31 | |
yeah, but if you allocate double size from the original, that gives you linear amortized | |||
12:31
hwcomcn left
|
|||
shillo | ... and it'd happen for small arrays, too, unless you start resizing into smaller sizes than double | 12:31 | |
jnthn | I don't think it doubles every time. | 12:33 | |
I think it does that up to a point | |||
And then goes in smaller increments | |||
jnthn checks | |||
12:34
TEttinger joined
|
|||
jnthn | github.com/MoarVM/MoarVM/blob/mast...ray.c#L318 | 12:34 | |
We *could* change it to just double every time, though that is of course a trade-off. | 12:35 | ||
shillo | yeah, I think it's the right choice because if you've gone up to 10M, what's the chance you'll stop anytime soon? But YMMv. | 12:36 | |
12:36
itaipu joined,
itaipu left
|
|||
shillo | ... OTOH, one way to optimize would be to know what's the chunk size that malloc can accomodate without its own overhead | 12:36 | |
... Moar uses system malloc, though? Or its own? | |||
jnthn | System malloc once you're at that size. | 12:37 | |
shillo | ok :) | ||
mniip | at that size it's time to call mmap though | 12:38 | |
shillo | ... by choosing I mean something that's double, then round to closest that fits malloc prefered chunk size (which tends to be mmap page size - malloc headers size) | ||
... the mallocs I looked at do just that, mniip. They just substract a few words for headers. | 12:39 | ||
mniip | I wrote an allocator that did nothing but mmap once | 12:40 | |
shillo | a number of mallocs will mmap when they run out, and will return the completely empty mmaped pages to the OS | ||
mniip | it was fun to see lua consume hundreds of megabytes for simple tasks | 12:41 | |
shillo | Oh, just pure mmap? Fun :) | 12:42 | |
mniip | yeah, whole page for even 1 byte allocations | ||
12:42
trnh joined,
trnh left,
trnh joined
|
|||
shillo | jnthn: about doubling always, statistically you'll only be wasting 25% memory on average. Because the first half arrived from copy, and will be full, then (if the array sizes are random) the second half will end at a random spot | 12:44 | |
jnthn | I'm not sure what the full history on that code is. I know that I took it from the QRPA implementation that pmichaud did on Parrot, but I don't know what that was inspired by. I've no idea what Perl 5 does, though somebody here probably does. :) | ||
shillo | jnthn: So the fill will be 50%-100%, with not-that-much waste. | ||
12:45
TEttinger left
|
|||
jnthn | I'd be fine with a patch to change it, if somebody wants to try tweaking it and do measurements to see if it's an improvement. | 12:45 | |
timotimo | the problem about "always double" is when you reach half the size of your user's RAM | ||
you'll try to double, but hit the ceiling, and stay at only half | 12:46 | ||
jnthn | tbh, if you're dealing with that much data you maybe want to think your problem through a tad more than using a dynamic array. ;) | ||
timotimo | right; like for the code above you'd probably want a native array to conserve some more memory | ||
jnthn | Yeah, the heap analyzer uses native arrays to good effect :) It's good if your data is integers. | 12:47 | |
Or floats | |||
12:47
TEttinger joined
|
|||
timotimo | also, pushing a bunch of boxed values into the same array is pessimal for our GC, as the amount of objects that go on to the gen2 is far too large | 12:47 | |
shillo | .... just looking at benchmark, it's not quadratic, in any case. | ||
timotimo: Well, yes, but with quadratic complexity, you'll run out of time long before you run out of RAM | |||
jnthn | timotimo: Yeah, there is that, though GC only runs so often :) | 12:48 | |
timotimo | does realloc allow you to recover when it couldn't malloc enough space? | ||
jnthn | But yeah, pre-tenuring is an interesting thing for the future. | ||
timotimo | yup | ||
using @a.push($_) for ^1_000_000 gives me 46 GC runs, 3 of which are full | 12:49 | ||
shillo | jnthn: I think I remember you made GC always double the last generation size, so GC is not the problem | ||
timotimo | 14.62% spent in GC :) | ||
shillo | (... and I read the GC source, so...) | ||
12:49
Actualeyes left
|
|||
jnthn | shillo: Yes, but the first generation is fixed in size and because everything gets a second stay in GC before promotion, then you'll end up with a collection that frees little, then one that promotes a lot, and vice versa | 12:50 | |
um, vice versa wasn't what I wanted | |||
shillo | yeah, I know | ||
jnthn | But anyway, that pattern. | ||
shillo | ... but that's normal for generational GCs when you allocate a lot | ||
jnthn | Yup | ||
shillo | ... I don't see that as a problem | ||
timotimo | imgur.com/TBSr6fQ | 12:51 | |
gregf_ | where does the sub/method 'cross' get picked from? | ||
timotimo | "picked"? | ||
shillo | jnthn: Mind you, I don't see a series of pushes to be the best pattern for most applications, but it will be idiomatic for people coming from either perl5 or C++/STL | 12:52 | |
gregf_ | i thought that the same sefault should get thrown for evey global function thats overridden :| | ||
er, picked == "called" # :/ sorry, my bad | |||
s/evey/every/ | |||
s/sefault/segfault/ | 12:53 | ||
jnthn | shillo: Yeah, the interesting work in this area is dynamic profiling of allocation sites, to see which things tend to end up getting promoted reliably and then compiling their allocations to always be directly in the old generation. | ||
timotimo | gregf_: you should be able to figure it out by looking at the commit that fixed the problem | ||
shillo | jnthn: Interesting. :) | ||
timotimo | github.com/rakudo/rakudo/commit/998a1ef168 | ||
gregf_ | timotimo: cool, ta | 12:54 | |
shillo | timotimo: I'm still not sure it's good to slow down very badly for arrays of ~10M elements in order to not run out of memory with arrays around 200M-1000M elements. | 12:55 | |
jnthn | We could just pick a much larger threshold | ||
8K elements isn't really very many given the memory size of modern computers :) | 12:56 | ||
12:56
salv0 left
|
|||
shillo | timotimo: I mean, if you look at this as 'How much data I can handle before I need to change my program?', well. | 12:56 | |
timotimo | If realloc() fails, the original block is | ||
left untouched; it is not freed or moved. | |||
^- we should be able to compare the previous pointer value with the returned value and try smaller increases before giving up and throwing our hands in the air | |||
12:57
zakharyas left
|
|||
timotimo | if that's something you consider worth trying, anyway | 12:57 | |
shillo | What exactly is ssize in that code? Because it doesn't seem to be a number of elements | 13:00 | |
... Had to go into milions before it started to slow down | |||
jnthn | storage size | ||
The number of elements we can hold | |||
13:01
mcmillhj joined
|
|||
jnthn | When we unshift, we ++ start, and -- elems | 13:01 | |
So unshift doesn't involve a memcpy | |||
And can be cheap | |||
perlpilot | sounds just like Perl 5 | ||
shillo | Uh, so why doesn't it slow down much sooner? | ||
13:01
RabidGravy joined
|
|||
jnthn | Cache boundaries maybe? | 13:01 | |
jkramer | What's the equivalent of $some_object->$method_name_in_variable in P6? | 13:02 | |
timotimo | $some_object."$method_name_in_var"() | ||
jkramer | Thanks :) | ||
timotimo | YW | ||
jnthn | Once you get into the millions, then the memory associated with the array won't fit in any of the CPU caches any more | ||
shillo | True | 13:03 | |
jnthn | And trips to main memory cost up to 100 times more than cache hits | ||
timotimo | and when you're copying stuff over, you're probably holding two arrays in cache | ||
jnthn | (For L1...for L3 "only" 5-10 times I guess...) | ||
timotimo | unless memcpy is clever enough somehow to skip writing to the cache and somehow writes directly to main memory? | ||
or maybe it causes some DMA coprocessor to run? | |||
i really have no idea how modern machines do such things | 13:04 | ||
shillo | Wait, no, I mean, it doesn't slow down at all. I just tried replacing 8192 with 81920000. The smallish case doesn't speed up even slightly. | ||
jnthn | How are you measruing? | ||
*measuring | |||
shillo | Or wait, I'm blind. It does. :p | 13:05 | |
timotimo | measruing wrnog, clearly | ||
jnthn | ah :) | ||
shillo | perl -e 'my @a; push @a, $_ for 0..20000000' 1.38s user 0.18s system 99% cpu 1.563 total | ||
timotimo | clraelry? | ||
shillo | No, that's perl5 | ||
Duh, I pulled a wrong line from history | |||
13:06
ptolemarch joined
|
|||
timotimo | m: $_ = "measuring wrong, clearly"; s[ <:Letter>+ ] = $/.comb.pick(*).join; .say | 13:07 | |
camelia | rakudo-moar aa5e49: OUTPUT«geusrnami wrong, clearly» | ||
timotimo | m: $_ = "measuring wrong, clearly"; s:g[ <:Letter>+ ] = $/.comb.pick(*).join; .say | ||
camelia | rakudo-moar aa5e49: OUTPUT«agsmirnue ngwor, elyracl» | ||
timotimo | that's .. a bit radical :) | ||
shillo | jnthn: I think that realloc was the wrong place to look | ||
timotimo | m: $_ = "measuring wrong, clearly"; s:g[ <:Letter> ** 1..3 ] = $/.comb.pick(*).join; .say | ||
camelia | rakudo-moar aa5e49: OUTPUT«maeusrgin worgn, leclray» | ||
shillo | ... no speedup in any cases | ||
perl6 -e 'my @a; @a.push($_) for ^4000000' 4.76s user 0.12s system 99% cpu 4.883 total | 13:08 | ||
perl6 -e 'my @a; @a.push($_) for ^8000000' 12.29s user 0.24s system 99% cpu 12.536 total | |||
jnthn | No shenanigans like "forgot to make install"? | ||
shillo | (that's with if (ssize < 819200000) {) | ||
No, but I only did make install on Moar | 13:09 | ||
timotimo | you know when i said "14.62% spent in GC"? | ||
shillo | ... I assume I don't need to rebuild nqp/rakudo? | ||
jnthn | That should be enough | ||
timotimo | i 10x'd the amount of pushes and gc went up to 35.02% | ||
13:09
AndyBotwin joined
|
|||
timotimo | The average nursery collection time was 23.4ms. The average full collection time was 145.93ms. | 13:09 | |
the last full collection took 371 ms | |||
that wouldn't cause the time to go quadratic, but it's kinda bad :) | 13:11 | ||
unmatched} | m: sub foo { say <foo bar ber>.map: * ~ "_" x $++ }; foo; foo; foo | 13:12 | |
camelia | rakudo-moar aa5e49: OUTPUT«(foo bar_ ber__)(foo___ bar____ ber_____)(foo______ bar_______ ber________)» | ||
unmatched} | m: sub foo { say <foo bar ber>.map: { $_ ~ "_" x $++ } }; foo; foo; foo | ||
camelia | rakudo-moar aa5e49: OUTPUT«(foo bar_ ber__)(foo bar_ ber__)(foo bar_ ber__)» | ||
perlpilot | timotimo: What's it look like for unshift rather than push? | ||
13:12
skids joined
|
|||
perlpilot guesses it's worse | 13:12 | ||
timotimo | for GC? should be the same | ||
shillo | Oh, *facepalm* | ||
unmatched} | So the WhateverCode doesn't get treated as its own block for the anon vars? | ||
jnthn | Doubt it | ||
timotimo | unmatched}: there's no curlies, so there's no lexical scope, nor a block | ||
moritz | correct | ||
shillo | ... this is fast because realloc reserves a *lot* more than you asked | ||
unmatched} | Thanks | 13:13 | |
shillo | ... and in most cases doesn't trigger a copy | ||
timotimo | it's valuable to keep that as a simple rule | ||
shillo | I put a printf("%ld %ld %ld\n", ssize, slots, slots_old); after realloc (and saved slots into slots_old) and got that it copies... rarely. Basically when you double the size, until it hits a limit size | 13:14 | |
I mean, when you hit double the size of the last copy, until a limit set in realloc implementation. | 13:15 | ||
timotimo | cool | ||
literal | is there a way to force Panda to use https as the git protocol when building Rakudo Star? | 13:16 | |
timotimo | i think we have GIT_PROTOCOL support in some places | ||
however, rakudo star is supposed to install stuff from the files we ship along with it | 13:17 | ||
literal | both NQP and Rakudo default to https, but Panda doesn't for some modules | ||
timotimo | without hitting the 'net | ||
literal | my build is dying because it's trying to clone a git:// repository from github (moritz/svg.git) | ||
shillo | timotimo: Not really cool, because this relies on a particular malloc implementation to work in linear time for even smallish arrays. | 13:18 | |
timotimo | oh | ||
well, fair enough | |||
13:18
Vazyla left
|
|||
timotimo installed 8 gigs of swap space so the next 10x can hopefully finish | 13:19 | ||
gfldex | literal: you can force git to do that, ask google how | 13:20 | |
perlpilot | pretty sure panda groks GIT_PROTOCOL | 13:21 | |
timotimo | here comes the swap | 13:23 | |
my music is suffering from it already | |||
tadzik | pretty sure panda coined it :) | 13:24 | |
dalek | c/revert-767-animated_css: feb4798 | Altai-man++ | / (2 files): Revert "Css-based TOC animation" |
13:25 | |
[Coke] | perlpilot: yes it does, I use it all the time | 13:26 | |
dalek | c: feb4798 | Altai-man++ | / (2 files): Revert "Css-based TOC animation" |
13:27 | |
c: 5f09019 | Altai-man++ | / (2 files): Merge pull request #774 from perl6/revert-767-animated_css Revert "Css-based TOC animation" |
|||
13:28
BronsonFlorence joined
|
|||
dalek | c: f151451 | Altai-man++ | html/css/style.css: Delete remainder of github.com/perl6/doc/pull/774 |
13:28 | |
timotimo | wow, the 100_000_000 items array push run finished | 13:29 | |
[Coke] wonders how he can get back to a working doc build on os x. :| | |||
ismailarilik | gfldex: I don't think I understand you... | ||
timotimo | 80% time spent in GC :) | ||
the last full run it did took a measly 13.8 seconds | 13:30 | ||
probably due to swapping? | |||
so i suppose i can throw that test result into the bin | |||
gfldex | ismailarilik: just make sure you don't got anything on a share because rakudo can't do anything about problems that arise from shares | 13:31 | |
13:33
sena_kun joined
13:35
Sgeo left
|
|||
timotimo | OK, with 40_000_000 items GC is down to 64%, which is fine ... | 13:35 | |
13:35
TEttinger left,
ismailarilik left
|
|||
shillo | timotimo: ... and I just remembered the real tradeoff with doubling-before-calling-realloc: if you reserve your own space by doubling, and realloc reserves its own space by, basically, ignoring your request, | 13:36 | |
timotimo | yup | ||
shillo | You end up with two independent chunks of wasted space, only one of which is usable by your application for array growth | ||
... which is why I think that the correct thing to do here is to double always (until you run out) but have a known malloc implementation so you know which numbers to double to | 13:37 | ||
... so that realloc doesn't waste extra space for you | 13:38 | ||
... OR | |||
13:38
MilkmanDan joined
|
|||
shillo | ... double manually but call malloc / memcpy on your own | 13:38 | |
... and hope malloc won't reserve space like that. | |||
13:38
TEttinger joined
|
|||
shillo | (most mallocs are very tight and actually won't) | 13:38 | |
timotimo | btw, for 40_000_000 elements but using a native array, you get 3% GC time and only 19 seconds (instead of 3:58 minutes) on my machine | 13:39 | |
perlpilot | Perl 5 grows its arrays by doubling last time I checked ... I wonder how it does that. | ||
shillo | perl5, 160,000,000, 11 sec | 13:40 | |
... normal array | |||
perl -e 'my @a; push @a, $_ for 0..160000000' 10.26s user 1.06s system 99% cpu 11.331 total | |||
timotimo | well, perl6 is known to be a bit slower than perl5 for many things :) | 13:41 | |
oh, that was also with --profile, which adds a bit of extra overhead to every call and allocation | |||
i get that in 49 seconds. 5x slower than perl5 isn't that bad, really. | 13:42 | ||
FWIW, when i use "my int @a = ^160_000_000", it's done in only 2.5 seconds | 13:43 | ||
shillo | pypy -c 'a=[] for i in xrange(160000000): a.append(i)' 1.92s user 1.04s system 99% cpu 2.973 total | ||
timotimo | oh come on, now. that's just unfair! :) | 13:44 | |
pypy is 100% space technology from space | |||
shillo | Yeah. pypy is evil :) | ||
It also hates threading, otherwise it'd be a go-to solution for implementing.. anything. | 13:45 | ||
(meaning, any language) | |||
timotimo | we lose about 30% time through invocation overhead for the push + for thing | ||
shillo | ... oh, today I benchmarked push specifically to see if it gained anything from declared return Nil | ||
timotimo | i count frame_invoke, fixed_size_alloc, try_return, allocate_frame, alloc_zeroed, fixed_size_free, frame_destroy, args_proc_init, args_set_result_obj, and frame_find_invokee_multi_ok as those things | 13:46 | |
13:47
travis-ci joined
|
|||
travis-ci | Doc build passed. Altai-man 'Revert "Css-based TOC animation"' | 13:47 | |
travis-ci.org/perl6/doc/builds/148033822 github.com/perl6/doc/commit/feb479880cd5 | |||
13:47
travis-ci left
|
|||
shillo | ... and also, apology to everyone for bringing up a microbenchmark - I realise this is not the kind of thing that should be the primary opt target :) | 13:47 | |
timotimo | nah, it's fine | ||
it's a bit surprising to me that spesh doesn't inline the push call there | 13:49 | ||
shillo | Like I said the other day, the only more practical code I wrote is slowed down by IO.basename, and that one waits on regexp search/replace. I suspect that p6 web frameworks that use grammars for routing will probably wait on the parsers to finish | ||
timotimo | yeah, probably | 13:50 | |
invocation of regexes isn't optimized enough | |||
13:52
ab6tract joined
|
|||
timotimo | huh, it's not even turning the invoke into a fastinvoke | 13:53 | |
[Coke] | so, I can't get a clean install of Pod::To::BigPage due to various dependency failures on sergot's and cosimo's modules. | 13:55 | |
gfldex | [Coke]: disable the test that is getting IO::Socket::SSL involved and see if that fixes your problem. If it does, send a PR. | 13:57 | |
14:00
pyrimidine left
|
|||
shillo | timotimo: how do you look into spesh output? By turning on spesh log or? | 14:02 | |
timotimo | yes, MVM_SPESH_LOG=/tmp/foo.txt | ||
and then just start reading from the bottom :D | |||
14:03
TEttinger left
14:05
pyrimidine joined
14:06
TEttinger joined
14:14
TEttinger left
|
|||
unmatched} | So I got this line of code: dd [$_, $s.channels] for |$s.channels; And it outputs [("#zofbot", "#perl6"), Array[<anon>].new($("#zofbot", "#perl6"))] How come it doesn't flatten the @.channels attribute's value? I want to iterate over each item | 14:15 | |
14:16
TEttinger joined
|
|||
timotimo | if it's an array, you probably want to .List (or .list?) that | 14:16 | |
unmatched} | dd [$_, $s.channels] for |$s.channels.List; gives the same result. | 14:17 | |
unmatched} is really pissed off. | |||
Just spent 20 minutes wrestling with a :%arg not being passed as an Associative and now this ~_~ | 14:18 | ||
timotimo | oh | ||
gfldex | unmatched}: looks like $s.channels is 2 levels deep | ||
we do have .deepmap but we don't got .deepiterator. I found myself wanting the latter a few times. | 14:20 | ||
unmatched} | gfldex++ thanks that was it. | ||
Man, the % and @ sigils are warps of Perl 6. | 14:21 | ||
I'm gonna avoid them from now on whenever I can | |||
14:21
vendethiel left
|
|||
unmatched} | *warts | 14:21 | |
jkramer | I think I came up with the most cleverest epic web framework ideas ever, made possible by perl6! dpaste.com/2BSBVFB | 14:26 | |
gfldex | m: sub deep (@a) { gather { @a.deepmap({take $_}); } }; my @l = [1,[2,3,[4,5,6]]]; .say for deep @l; | ||
camelia | rakudo-moar aa5e49: OUTPUT«123456» | ||
gfldex | unmatched}: ^^^ | ||
Juerd | jkramer: Translating user input to internal identifiers. What could possibly go wrong? | 14:27 | |
jkramer | I don't want to brag, but I think I'm a genius | ||
Juerd | jkramer: It should at least match against some kind of whitelist to make sure that those methods were intended to be called externally. | ||
jkramer | Juerd: it does | 14:28 | |
Juerd rereads | |||
14:28
sufrostico joined
|
|||
jkramer | Juerd: return $.bad-request unless $method ~~ any(<get post head put delete>); | 14:28 | |
Juerd | Oh, it does | ||
14:28
shillo left
|
|||
Juerd thinks of something better to nag about | 14:28 | ||
I got it! Whitelists suck! :) | |||
jkramer | :D | ||
Juerd | Instead, would there be a way to indicate this at the method itself? | 14:29 | |
14:29
BronsonFlorence left
|
|||
Juerd | multi method get (...) is web { ... } | 14:30 | |
gfldex | jkramer: matching against a string literal with a signatuer is quite clever indeed. You may actually have invented that. | ||
jkramer | Juerd: I was playing with traits first, but I think since we know what HTTP methods exist it's easier/more conclusive to do it like this. Also having a get method that's supposed to be called and other get methods that are not doesn't really make sense | ||
Juerd | jkramer: Good point | 14:31 | |
jkramer | Also I want to use traits for stuff like get(...) is memcached later. It's gonna be awesome :D | ||
Juerd | I like the idea | ||
I wonder if some kind of relative paths could be used | |||
14:32
cibs left
|
|||
Juerd | So you can load (mount?) an application and stick it on a custom path prefix | 14:32 | |
jkramer | Yeah, I'm thinking about that right now. Something like "class Foo does Blurgh has Prefix(...)" or whatever you can do with traits | ||
Also I need a better name | |||
Juerd | Well, if you use instances instead of classes, you can mount the same application twice with different parameters | 14:33 | |
unmatched} | jkramer: it's neat. Another point of awesomeness with that interface: multi method get ('blog', |c) { self.blog: |c }; multi method blog ('read', $id) {...}; multi method blog ('create', ... ) { ... } | ||
Similar to Mojolicious's under() | 14:34 | ||
Juerd | I wonder, can roles have parameters? | ||
14:34
cibs joined
|
|||
timotimo | of course they can | 14:34 | |
we have roles so that we can have parameterized types | |||
psch | m: role R[::T] { method foo { T.new() } }; class A does R[Int] { }.foo.say | ||
camelia | rakudo-moar aa5e49: OUTPUT«0» | ||
Juerd | timotimo: But can I load a role twice in the same class? :) | 14:35 | |
jkramer | unmatched}: What is |c? Never seen that | ||
unmatched} | jkramer: a capture | ||
hug[tab][tab] Capture | |||
damn bot | |||
timotimo | the role bodies will probably conflict, but if the role bodies are empty that should work | ||
well ... it might | 14:36 | ||
psch | m: role R[::T] { multi method foo(T $a) { $a.succ } }; class A does R[Int] does R[Str] { }.foo("foo").say | ||
camelia | rakudo-moar aa5e49: OUTPUT«fop» | ||
14:36
huggable joined
|
|||
unmatched} | huggable: Capture | 14:36 | |
huggable | unmatched}, Argument list suitable for passing to a: docs.perl6.org/type/Capture | ||
14:36
huggable left
|
|||
psch | m: role R[::T] { multi method foo(T $a) { $a.succ } }; my $a class A does R[Int] does R[Str] { }; $a.foo("foo").say; $a.foo(1).say | 14:36 | |
camelia | rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3ti method foo(T $a) { $a.succ } }; my $a7⏏5 class A does R[Int] does R[Str] { }; $a expecting any of: infix infix stopper …» | ||
14:36
huggable joined
|
|||
psch | m: role R[::T] { multi method foo(T $a) { $a.succ } }; my $a = class A does R[Int] does R[Str] { }; $a.foo("foo").say; $a.foo(1).say | 14:36 | |
camelia | rakudo-moar aa5e49: OUTPUT«fop2» | ||
psch | Juerd: ^^^ looks good from here | 14:37 | |
14:37
kurahaupo joined
|
|||
tadzik | unmatched}: that reminds me of my old idea of using grammars for routing :D | 14:38 | |
unmatched} | :D | 14:39 | |
tadzik: sounds cool. How did it work out? | |||
tadzik | ttjjss.wordpress.com/2010/11/ | 14:40 | |
Hacker News liked it :P | |||
unmatched} | tadzik++ that's awesome :D | 14:41 | |
tadzik | :) | ||
gregf_ | m: say [1,"a"].map(*.succ) | 14:42 | |
camelia | rakudo-moar aa5e49: OUTPUT«(2 b)» | ||
tadzik | holy batman that was over 5 years ago | ||
14:48
sufrostico left,
khw joined
|
|||
jkramer | When I have an attribute in a role, can I set a default value for that attribute in a class that does the role? | 14:51 | |
Just overriding has $attribute = 123 gives me an error. | 14:52 | ||
timotimo | you'll have to make the default value a parameter of the role, or make your BUILD do the right thing | 14:53 | |
jkramer | How does the syntax for the role parameter look like? | ||
timotimo | see psch's eval a quarter-hour ago | ||
the ::T was a type capture, so instead of giving you the value, it'll give you the type | 14:54 | ||
so just use $defval instead | |||
psch | m: role R[$def] { has $.a = $def }; class C does R[10] {}.new.a.say | ||
camelia | rakudo-moar aa5e49: OUTPUT«10» | ||
jkramer | Ah right, I though that was for type parameters only. Thanks! | 14:55 | |
14:57
sena_kun left
|
|||
timotimo | nope, ::T is a thing in any signature, and role parameters go via signatures | 14:57 | |
you should be able to do anything a regular signature can do in there | |||
14:59
vendethiel joined
|
|||
psch | m: role R[&c:(Int $, Str $ --> Bool)] { has &.c = &c }; class C does R[sub (Int $a, Str $b --> Bool) { $a < 10 && $b.chars < 10 }] { }; C.new.c()(1, "foo").say | 15:00 | |
camelia | rakudo-moar aa5e49: OUTPUT«True» | ||
psch hadn't known that its a Signature in the brackets | 15:01 | ||
dalek | osystem: c4040ad | (Brian Duggan)++ | META.list: added oauth2-client-google |
15:02 | |
osystem: 75a8370 | Altai-man++ | META.list: Merge pull request #230 from bduggan/oauth2-client-google added oauth2-client-google |
|||
15:02
sena_kun joined
|
|||
jkramer | I have an error that I don't really understand. This line: @path.first($.prefix.arity) ~~ $.prefix (where $.prefix is a Signature :('post') and @path is ['post', 1] gives me this: Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏post' | 15:03 | |
psch | m: <foo bar baz>.first(2).say | ||
camelia | rakudo-moar aa5e49: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | the @path.first($.prefix.arity) runs a smart match against the number over all the things | ||
yeah, what psch showed | |||
psch | m: <foo bar baz>.first("bar").say | 15:04 | |
camelia | rakudo-moar aa5e49: OUTPUT«bar» | ||
psch | m: <foo 1>.first("1").say | 15:05 | |
camelia | rakudo-moar aa5e49: OUTPUT«1» | ||
jkramer | Ah damn, I should start reading the actual description of methods in the docs | ||
timotimo | perhaps | ||
jkramer | .head is what I wanted | ||
yoleaux | jkramer: Sorry, that command (.head) crashed. | ||
timotimo | ah, hehe | ||
gfldex .oO( Make the docs telepathic. ) | 15:06 | ||
perlpilot | that's one way to head-desk | 15:07 | |
15:08
mohae joined,
cdg joined
15:10
sufrostico joined
|
|||
jkramer | Not sure if this is the best way to do it, but I added signature prefixes: dpaste.com/1PHD6CN | 15:10 | |
I guess next I should add nested routes, ie. route classes inside other route classes with dispatching to nested routes using their prefixes or something. | 15:11 | ||
gfldex | jkramer: you may be able to do that and more with MOP and .assuming | 15:13 | |
ab6tract | jkramer: nice :) | 15:17 | |
gfldex | jkramer: also, while considering different solutions you may want to measure the request/s you can achieve. It doesn't help you much the have A Most Elegant Webframework that is slow as fuck. | ||
mst | actually, for real world use I find benchmarking requests/second of a raw framework is stupid | 15:19 | |
it doesn't help you much to have spent hours micro-optimising your web framework when it turns out the bottleneck isn't in the framework | 15:20 | ||
tadzik | "our JS UI toolkit doesn't do jack shit but hell is it fast!" | ||
mst | gfldex: anyway, if I wanted to ricer, I'd build a gentoo stage 1 install and then write golang :D | ||
15:21
kurahaupo left
15:22
TEttinger left
|
|||
gfldex | tadzik: "our JS UI toolkit does literally everything but wont finish until tomorrow" Does that sound better? | 15:24 | |
15:25
TEttinger joined
|
|||
jkramer | gfldex: Currently there's no way of benchmarking anyway because HTTP::Server::Async crashes after a few requests :) Guess I should use something else or use something more generic/pluggable | 15:27 | |
mst | gfldex: yes, because then you profile it to find the parts that are *actually* slow | 15:28 | |
jkramer | Right now it's just a POC of the idea anyway, don't know how far I'll take it | ||
mst | jkramer: your example has a 'get /foo/new/123' that changes data | ||
jkramer: GET requests that change data: not even once. not even in examples. please. | 15:29 | ||
jkramer | Pff yeah whatever mom | 15:30 | |
15:32
Actualeyes joined
|
|||
timotimo | Mom Said To == mst | 15:33 | |
jkramer | ;) | 15:36 | |
15:36
Actualeyes left,
TEttinger left
15:37
petercommand joined
15:38
sunnavy joined
15:39
TEttinger joined
15:42
CIAvash left,
ssqq joined
15:49
ssqq left,
ssqq joined
15:56
Actualeyes joined
|
|||
jkramer | Can I use type parameters for Hash to restrict the types of both the keys and the values? I tried Hash[Int, Str] but it does weird stuff | 15:57 | |
15:57
abraxxa left
|
|||
jkramer | Although I was just guessing the syntax | 15:57 | |
timotimo | you can, but the parameters are the other way around from what you expect | 15:58 | |
hoelzro | it would nice if we had named parameters for parameterized roles | 15:59 | |
timotimo | we ... we don't? | ||
hoelzro | eg. Hash[:key(Int), :value(Str)] | ||
hoelzro shrugs | |||
maybe we do | |||
perlpilot thought we did | |||
hoelzro | oh, awesome! | ||
jkramer | timotimo: I tried both ways but complains about the values type either way | ||
perlpilot | (I had exactly the same reaction in my head as timotimo) | ||
hoelzro | shows how much Perl 6 I've done recently =S | ||
I can't wait until this house thing is done - then I can hack again \o/ | |||
jkramer | m: my Hash[Int,Str] %x; %x{123} = 'foo' | 16:00 | |
camelia | rakudo-moar aa5e49: OUTPUT«Type check failed in assignment to %x; expected Hash[Int,Str] but got Str ("foo") in block <unit> at <tmp> line 1» | ||
timotimo | jkramer: can you write a small test case for your stuff? | ||
jkramer | m: my Hash[Int,Str] %x; %x{'foo'} = 123 | ||
camelia | rakudo-moar aa5e49: OUTPUT«Type check failed in assignment to %x; expected Hash[Int,Str] but got Int (123) in block <unit> at <tmp> line 1» | ||
timotimo | aha! | ||
you're declaring that you want a hash of hashes of int and str | |||
m: my %x is Hash[Int, Str]; %x{'foo'} = 123 | 16:01 | ||
camelia | rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Can't use unknown trait 'is ' in a variable declaration.at <tmp>:1------> 3my %x is Hash[Int, Str]7⏏5; %x{'foo'} = 123 expecting any of: TypeObject default dyn…» | ||
jkramer | Oh shit, wrong sigil I guess | ||
timotimo | okay, is is wrong there | ||
gfldex | m: my Int %h{Str}; %h{'abc'} = 10; dd %h; | ||
camelia | rakudo-moar aa5e49: OUTPUT«Hash[Int,Str] %h = (my Int %{Str} = :abc(10))» | ||
timotimo | yeah, what gfldex just showed is the proper way | ||
jkramer | Ah, thanks! | ||
16:02
mcmillhj left
16:03
ab6tract left,
TEttinger left
|
|||
gfldex | we seam not to doc the value time in docs.perl6.org/type/Hash | 16:04 | |
16:04
domidumont left
|
|||
gfldex | or am i just blind? | 16:04 | |
hoelzro | do we have a " | ||
ugh, finger slipped | |||
16:04
TEttinger joined
|
|||
hoelzro | do we have a "Perl 5 -> Perl 6 pitfalls" section on docs.perl6.org? | 16:04 | |
I noticed we have a "traps" section | |||
TimToady | isn't a pitfall a kind of trap? | 16:05 | |
gfldex | hoelzro: there are some pitfalls stated in the 5to6 sections | ||
16:05
MahBot joined
|
|||
MahBot | gfldex, Message forwarded | 16:05 | |
16:05
MahBot left
|
|||
unmatched} | oops | 16:05 | |
gfldex | EUNKNOWNBOT | 16:06 | |
16:06
MahBot joined
|
|||
MahBot | Hey, everybody! ZoffixW over at local/#perl6 says I ♥ you! | 16:06 | |
16:06
MahBot left
|
|||
unmatched} | :D Multi-server tunnel with Perl 6 IRC::Client :D | 16:06 | |
timotimo | cute. | 16:07 | |
unmatched} | This is the code that dun it: gist.github.com/zoffixznet/0d37221...c61091bf0d | 16:08 | |
16:08
mantovani left
|
|||
hoelzro | TimToady: sure enough =) | 16:08 | |
gfldex: should the traps section link to that Perl 5 traps section? | 16:09 | ||
16:09
TEttinger left
16:10
zakharyas joined
16:11
mantovani joined
|
|||
hoelzro | oh good, the trap I thought of is already in there =) | 16:12 | |
gfldex | hoelzro: there is no explicit Perl 5 trap sections. Links would go all over the place. | ||
hoelzro | ok | ||
unmatched} | This trap gets me frequently: | 16:13 | |
m: my %h = :42foo :45bar; dd %h | |||
camelia | rakudo-moar aa5e49: OUTPUT«Hash %h = {:foo(42)}» | ||
16:13
TEttinger joined
|
|||
unmatched} | m: class { method bar (:$foo, :$bar){ dd[ $foo, $bar ] } }.bar: :42foo :45bar | 16:14 | |
camelia | rakudo-moar aa5e49: OUTPUT«method bar» | ||
unmatched} | wat? | 16:15 | |
The space is missing between dd and [, but what's with the output? :S | |||
dalek | osystem: 8866514 | (Peter Pentchev)++ | META.list: Add Getopt::Std - POSIX getopt(3) options processing. |
16:16 | |
osystem: 1393b78 | (Steve Mynott)++ | META.list: Merge pull request #231 from ppentchev/roam-getopt-std Add Getopt::Std - POSIX getopt(3) options processing. |
|||
jnthn | m: dd | ||
camelia | rakudo-moar aa5e49: OUTPUT«block <unit>» | ||
jnthn | m: sub foo() { dd } | 16:17 | |
camelia | ( no output ) | ||
jnthn | m: sub foo() { dd }; foo | ||
camelia | rakudo-moar aa5e49: OUTPUT«sub foo» | ||
unmatched} | Ah. jnthn++ | ||
jnthn | Heh, TIL. :) | ||
timotimo | i didn't even know about that | ||
jnthn | Did anyone else know about that? :P | ||
I guess lizmat must have :) | |||
16:17
trnh left
|
|||
dalek | c: e19bb99 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Hash.pod6: show value constraints on Hash |
16:18 | |
gfldex | i'm very pleased with the example i found for that one | ||
16:21
adu joined
|
|||
timotimo | great :) | 16:22 | |
unmatched} | .&dd shouldn't really be in the docs. It's Rakudo-specific helper | 16:26 | |
m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; %h{'Goku'} = 9001; | |||
camelia | ( no output ) | ||
unmatched} | :S | ||
oh | 16:27 | ||
m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; %h{'Goku'} = 900; | |||
camelia | rakudo-moar aa5e49: OUTPUT«Type check failed in binding to assignval; expected Powerfull but got Int (900) in block <unit> at <tmp> line 1» | ||
gfldex | unmatched}: the ecosystem may disagree with you when it comes to dd | 16:30 | |
16:32
dakkar left
|
|||
TimToady | the ecosystem does not define Perl 6 | 16:32 | |
mst | unmatched}: Powerful | ||
TimToady | and roast doesn't test dd | ||
unmatched} | gfldex: no, the ecosystem uses a Rakudo-specific helper that's not part of the Perl 6 specification | ||
16:32
sno left
16:34
TEttinger left
16:35
zakharyas left
16:36
TEttinger joined
|
|||
dalek | c: 9b1ca52 | (Zoffix Znet)++ | doc/Type/Hash.pod6: s/Powerfull/Powerful/ mst++ |
16:36 | |
16:36
zakharyas joined
16:41
zakharyas left
16:45
mcmillhj joined
|
|||
gfldex | TimToady: the ecosystem defines how Perl 6 is used. I'm very unhappy with all those says in the docs because it gives the impression that say is a good default. Data will be lost, tears will be shed. | 16:46 | |
16:47
matt_ left
16:51
user9 left
|
|||
[Coke] | I agree that dd shouldn't be in the doc site. | 16:52 | |
I'm OK with say being used for things that have trivial .gists, but would be fine if more complicated things used put. | |||
(I'm also ok if we just use put everywhere) | 16:53 | ||
16:55
user9 joined
|
|||
unmatched} | put's not really the same thing tho | 16:56 | |
m: put IO::Socket::Async | |||
camelia | rakudo-moar aa5e49: OUTPUT«Use of uninitialized value of type IO::Socket::Async in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at <tmp> line 1» | ||
unmatched} | m: say IO::Socket::Async | ||
camelia | rakudo-moar aa5e49: OUTPUT«(Async)» | ||
unmatched} | This is curious: | 16:57 | |
stmuk | say :$foo.perl is a little like dd | ||
unmatched} | m: put -∞..∞; say -∞..∞ | ||
camelia | rakudo-moar aa5e49: OUTPUT«*..*-Inf..Inf» | ||
timotimo | it not being the same thing is the whole point, isn't it? | ||
unmatched} | Sure, but it's not suitable to replace all of `say`s in the docs. | 16:58 | |
timotimo | not all of it, of course | ||
[Coke] | m: my $a = -∞..∞; say ~$a; say $a; | ||
camelia | rakudo-moar aa5e49: OUTPUT«*..*-Inf..Inf» | ||
timotimo | i thought the problem was that say tends to abbreviate lists and such? | ||
[Coke] | unmatched}: we can't *just* replace say with put, no | ||
17:01
vendethiel left
17:02
vendethiel joined
|
|||
dalek | c: 2bd91a5 | (Zoffix Znet)++ | doc/Type/Hash.pod6: Simplify example |
17:03 | |
[Coke] | yay, got make test working again locally for perl6/doc | 17:05 | |
dalek | c: 267c0ad | (Zoffix Znet)++ | doc/Type/Hash.pod6: Add missing comment marker |
||
17:13
TEttinger left
17:14
firstdayonthejob joined
|
|||
gfldex | m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; try { %h{'Goku'} = 900; CATCH { say $_ } } | 17:15 | |
camelia | rakudo-moar aa5e49: OUTPUT«Type check failed in binding to assignval; expected Powerfull but got Int (900) in block <unit> at <tmp> line 1Type check failed in binding to assignval; expected Powerfull but got Int (900) in block <unit> at <tmp> line 1Actually throw…» | ||
17:16
domidumont joined
|
|||
gfldex | the reason I use dd there is that I got the fully quallified name of the exception for free | 17:16 | |
unmatched}: if you remove the type of the exception from the example please add that type in the descriptive text | 17:18 | ||
m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; try { %h{'Goku'} = 900; CATCH { say $_.WHAT } } | 17:21 | ||
camelia | rakudo-moar aa5e49: OUTPUT«(Binding)Type check failed in binding to assignval; expected Powerfull but got Int (900) in block <unit> at <tmp> line 1» | ||
unmatched} | .^name | ||
gfldex | m: subset Powerfull of Int where * > 9000; my Powerfull %h{Str}; try { %h{'Goku'} = 900; CATCH { when X::TypeCheck::Binding { put .^name } } }; say 'alive'; | 17:23 | |
camelia | rakudo-moar aa5e49: OUTPUT«X::TypeCheck::Bindingalive» | ||
dalek | c: 46e69e3 | (Zoffix Znet)++ | doc/Type/Hash.pod6: Restore exception message into code example |
17:25 | |
17:30
mcmillhj left
17:32
mcmillhj joined
17:38
adu left
17:41
Actualeyes left
17:51
trnh joined,
trnh left,
trnh joined
17:54
telex left
17:55
telex joined
17:56
girafe joined
17:58
matt_ joined,
FROGGS joined,
matt_ is now known as Guest8704
|
|||
unmatched} | .oO( a "chat" section on perl.org that lets you chat on this channel... ) |
18:02 | |
18:02
spider-mario joined
18:03
AlexDaniel joined
|
|||
gfldex | unmatched}: i had the wild idea to have webchat.freenode.net/ on docs.perl6.org | 18:03 | |
"if you have any further questions ..." | |||
or some easy way to seach the irclogs | 18:04 | ||
ENEEDMORETEA | |||
mst | that would be wesome | ||
sena_kun | m: say say Int.^methods(:all).pick.name; | ||
camelia | rakudo-moar aa5e49: OUTPUT«sechTrue» | ||
mst | awesome | ||
DBIx::Class pioneered that with mibbit, it's been very nice | |||
unmatched} | Yeah, I like the "Questions? Chat with us" button (on the left, middle) here: metacpan.org/pod/Moose | 18:05 | |
sena_kun | m: say Int.^methods(:all).pick.name; | ||
camelia | rakudo-moar aa5e49: OUTPUT«fmt» | ||
mst actually got the 'other' box added to mibbit specifically so irc.perl.org could use it | |||
unmatched} | :o | ||
mst | sadly they threw an epic tantrum at the freenode opers a few years back and got very banned | ||
unmatched} | wow | 18:06 | |
mst | culminating in them saying "no, we won't guarantee that we won't mine users' chat history to serve better converting ads" | ||
unmatched} | I was thinking of more a rolling chat. You don't have to log in or anything. You just load the site and you can see humans talking and you can talk too | 18:07 | |
mst | hm | ||
18:07
gfldex_www joined
|
|||
mst | oooh, what you'd want for that is something like a convos instance, except one that maintained a bot, so it only had to actually connect a nick when you started trying to speak | 18:07 | |
18:08
gfldex_www left
|
|||
unmatched} | I've never used convos. I'm thinking it doesn't even need to connect a nick. The bot would make up a nick based on IP address and would prefix messages with that nick, talking on behalf of that person. | 18:08 | |
I think #go-lang has this sort of thing | |||
Well, maybe not the via their site, but I've seen a bot talk on behalf of people | 18:10 | ||
mst | oh, you mean more like the XMPP bridge in #tcl | ||
18:10
Tonik joined
|
|||
unmatched} | Probably | 18:11 | |
dalek | osystem: ba55f31 | (Matt Oates)++ | META.list: Add Math::FourierTransform First features for FourierTransform |
18:12 | |
Ulti | ^ was surprisingly slick to write in P6 | 18:14 | |
looks nicer than the python just because maths functions for complex numbers are already there and you don't need a complex numbers import | 18:15 | ||
unmatched} | My first full draft of IRC::Client blog post is 5325 words >_< | ||
Ulti | blag golf | ||
unmatched} | github.com/MattOates/Math--FourierTransform | 18:16 | |
TimToady | flog galb | ||
m: complex | 18:18 | ||
camelia | rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routine: complex used at line 1» | ||
TimToady | pity we don't have native complex yet | 18:19 | |
sena_kun | m: say ((1, 2), <a b>).flatmap(&uc).join('|'); # 1|2|A|B | ||
camelia | rakudo-moar aa5e49: OUTPUT«1 2|A B» | ||
TimToady | oh, I guess Complex is compact nums though already | ||
Ulti | is it? I assumed it was two Rats or something underneath? | 18:20 | |
TimToady | well, most complex computations don't come out exact anyway | 18:21 | |
so Rats would be mostly wasted | |||
and turn into nums anyway | |||
Ulti | yeah I noticed my code didn't really match other langs functions 100% | ||
should probably do an actual numeric test using sin() | 18:22 | ||
feels like maths functions someone should write a general testing framework for everyone to test against | |||
18:24
TEttinger joined
18:26
cdg left
|
|||
mantovani | (stupid, stupid, stupid question) why does you guys created MoarVM and just used jvm as backend ? | 18:29 | |
and not just used jvm* | |||
a friend of my ask it, and I didn't know what to answer | 18:30 | ||
18:30
sufrostico left
|
|||
mantovani | oh I found, sorry | 18:31 | |
perl6advent.wordpress.com/2014/12/...6-in-2014/ | |||
japhb | mantovani: A few different reasons, but for *me* the most important is that JVM has really slow startup. Sucks for interactive tools. | ||
mantovani | "MoarVM provides much lower memory usage, faster startup time, and is significantly faster than parrot at runtime" | ||
18:32
sufrostico joined
|
|||
japhb | Parrot has gone "biologically stable" | 18:32 | |
unmatched} | Also, we can modify MoarVM for Perl 6 needs :) | ||
mantovani | since perl 6 run on jvm I thought it satisfy all perl 6 needs | 18:33 | |
geekosaur | well, it sort-of runs... | 18:34 | |
unmatched} | Well, you can drive a screw in with a hammer, but it's much better to have a screw driver. | ||
mantovani understood | |||
arnsholt | To expand a bit on it, the JVM conception of classes and dispatch and such isn't quite the same as the Perl 6 one | 18:35 | |
So it's not just a matter of compiling to JVM classes and invoking JVM methods directly on those objects | 18:36 | ||
So the Rakudo/JVM runtime code has to do a fair bit of legwork to translate between the different models, leading to increased overhead | |||
18:36
huggable left
18:38
huggable joined
|
|||
mantovani | so the jvm implementation was just to learn/for fun ? | 18:38 | |
18:38
dwarring joined
|
|||
dalek | c: a8bb893 | (Wenzel P. P. Peppmeyer)++ | html (2 files): add link to webchat |
18:39 | |
unmatched} | mantovani: no, to run on JVM. Some organizations, for example, require the projects must run on JVM, not on some arbitrary platform | ||
[Coke] | a big selling point for running on the JVM for me was that I could run it in a managed j2ee container. this became much less relevant with docker. | ||
mantovani | so jvm implementation will be stable as MoarVM ? | ||
[Coke] | but up to about six months ago, rakudo on jvm was going to be the only way to get perl 6 running here at work. | 18:40 | |
mantovani: that's the goal, but we're not there. | |||
arnsholt | Also, the JVM backend was implemented before Moar was started | ||
In the beginning, there was Parrot | |||
mantovani | ok, because I come here in the channel few days ago ... because the best of java are the libraries and since perl 6 run it on jvm should not be hard use jar libraries in perl as I do in scala. | 18:41 | |
arnsholt | Then jnthn++ implemented multi-backend, and Rakudo ran on both Parrot and JVM | ||
Then, later on (a year or two, I think) MoarVM was implemented | |||
sena_kun | Is `yada` method name an abbreviation or it just comes from "いやだ"? | ||
unmatched} | sena_kun: I'd think this www.dictionary.com/browse/yada--yada?s=t | 18:42 | |
sena_kun | unmatched}, thanks. How interesting. | 18:43 | |
18:45
setty1 joined
|
|||
arnsholt | mantovani: I think we have at least partial JVM interop | 18:47 | |
But the exact translation of Perl 6 method invocations to Java invocations are a bit tricky, because method resolution is different in Java and Perl 6 | |||
sena_kun | m: my ($a, $b) = SetHash.new(1, 2, 3), SetHash.new(2, 4); say $a (^) $b; | 18:48 | |
camelia | rakudo-moar aa5e49: OUTPUT«set(4, 3, 1)» | ||
sena_kun | Is this elements order machine-specific? | ||
18:49
molaf left
|
|||
timotimo | our hashes don't keep order around | 18:50 | |
perlpilot | sena_kun: sets aren't ordered | ||
gfldex | pitty the irclog doesn't show that the webchat was used to join. Would be interresting to see if the link on docs.perl6.org actually lures folk in. | ||
18:50
harmil_wk joined
|
|||
sena_kun | Thanks. | 18:50 | |
18:50
harmil left
|
|||
hoelzro | gfldex: we could change the link to redirect to the webchat, and see how many people hit that redirect link | 18:51 | |
psch | arnsholt: mmd on Java classes is mostly solved. we do lack marshalling for Positional and Associative to corresponding Collection classes though | ||
arnsholt: what i'm anticipating to be the hardest part is translating between interfaces and Roles though | |||
unmatched} | m: gist.github.com/zoffixznet/729acd1...9619eba91f | 18:52 | |
gfldex | hoelzro: it's in the apache logs. But so is every spider and bot that hits the site. I somehow doubt the bots would solve the captcha to talk to us. | ||
arnsholt | psch: Oh, cool! I've been away long enough that so many of the things that were hard to fix have been figured out \o/ | 18:53 | |
camelia | rakudo-moar aa5e49: OUTPUT«(timeout)Starting irc.freenode.netStarting localhostirc.freenode.net: IO::Socket::Async<139743539025240>Got stuff! :kornbluth.freenode.net NOTICE * :*** Looking up your hostname... | ||
unmatched} | I guess expecting redo inside a promise to redo a loop is expecting too much? | ||
I'm trying to pop open a bunch of sockets and reconnect them when they disconnect :/ | |||
hoelzro | ahhh | 18:54 | |
psch | j: use java::lang::System:from<JavaRuntime>; System.get_out.println("foo") | ||
camelia | rakudo-jvm cd19db: OUTPUT«foo» | ||
unmatched} | gfldex: match IPs between chat logs and apache logs | ||
18:54
sufrostico left
|
|||
psch | arnsholt: fields aren't wrapped in Proxies yet, which is also hard, but Perl 6 level hard, not codegen hard. hence 'get_out' above :) | 18:54 | |
gfldex | unmatched}: the irclogs that i can see don't got ips | 18:55 | |
unmatched} | Maybe someone here has more detailed logs | ||
sena_kun | m: my $n = bag "a" => 0, "b" => 1, "c" => 2, "c" => 2; say $n.keys.perl; # ("a" => 0, "b" => 1, "c" => 2, "c" => 2).list | 18:57 | |
camelia | rakudo-moar aa5e49: OUTPUT«(:c(2), :b(1), :a(0)).Seq» | ||
sena_kun | Wow. | 18:58 | |
gfldex | @gateway/web/freenode/ip is the string to grep for | ||
18:59
FROGGS left,
freeside left
|
|||
unmatched} | Hm, I'm gonna try to reimagine my problem as a supply with socket disconnection events | 18:59 | |
19:02
mantovani left
19:05
pmqs left
19:07
darutoko left
19:08
andrzejku joined
19:10
labster joined
|
|||
unmatched} | m: react { whenever supply { start { emit 42 }; } { .say } }; sleep 2 | 19:12 | |
camelia | ( no output ) | ||
unmatched} | I can't emit into a supply from within a Promise? | ||
avar | Does anyone here know offhand whether Inline::Perl6 embedded in a perl without multiplicity or threading is capable of : perl5 -> perl6 -> *call subs in perl5* | 19:13 | |
TimToady | m: my $n = ("a" => 0, "b" => 1, "c" => 2, "c" => 2).Bag; say $n.perl | 19:14 | |
camelia | rakudo-moar aa5e49: OUTPUT«("c"=>4,"b"=>1).Bag» | ||
TimToady | sena_kun: ^^^ looking for that? | 19:15 | |
this is why the composer is different from the coercer | |||
19:16
ssqq left
|
|||
sena_kun | TimToady, not really. I'm just checking correctness of example's output in our docs. And it seems our real compiler behavoir is slightly different from what documentation says. | 19:17 | |
TimToady | m: my $n = bag "a" => 0, "b" => 1, "c" => 2, "c" => 2; say $n.perl | ||
camelia | rakudo-moar aa5e49: OUTPUT«(:c(2)=>2,:b(1)=>1,:a(0)=>1).Bag» | ||
19:17
pmqs joined
|
|||
TimToady | well, keys should never list "c" => 2 twice | 19:17 | |
sena_kun | TimToady, it really should. That's because I check and fix it now. :) | 19:18 | |
Or rather "Because of that", oh. | 19:20 | ||
19:20
Tonik left
19:23
canopus left
19:24
richi235 joined
19:30
canopus joined
19:32
domidumont left
|
|||
unmatched} | Solved my problem with a Channel. Rough version: gist.github.com/zoffixznet/24d292d...f8d2754e03 | 19:40 | |
19:42
andrzejku left
|
|||
harmil_wk | m: sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3 | 19:45 | |
camelia | rakudo-moar aa5e49: OUTPUT«WARNINGS for <tmp>:Useless use of $a in sink context (lines 1, 1, 1)7625597484987» | ||
harmil_wk | Am I missing something, there? Seems like there should be no warning. | ||
unmatched} | bisect: m: sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3 | 19:47 | |
[Coke] | it doesn't warn for me locally on 2016.07.1 | ||
bisectable | unmatched}: Exit code is 0 on both starting points, bisecting by using the output | 19:48 | |
unmatched}: bisect log: gist.github.com/369412d2b8ff352b2e...b35f89846f | |||
unmatched}: (2016-07-26) github.com/rakudo/rakudo/commit/5334cb7 | |||
unmatched} | harmil_wk: would you please open a ticket for it? | ||
harmil_wk | Sure | ||
unmatched} | huggable: rakudobug | ||
huggable | unmatched}, To report a bug, email detailed description and any test cases to [email@hidden.address] or use perl6 query on rt.perl.org ; see github.com/rakudo/rakudo/#reporting-bugs | ||
harmil_wk | I've been pretty prolific with the bug reports of late. I'm worried I'm going on a list ;) | 19:49 | |
unmatched} | :) | ||
[Coke] | harmil_wk: you'll never catch up with masak, so dont' worry. :) | ||
unmatched} | harmil_wk: oh and would you include the link to the commit that bisectable gave above? | 19:50 | |
TimToady: if you're around and have time, seems it points to the sinkiness propagation: github.com/rakudo/rakudo/commit/5334cb7 | |||
[Coke] | unmatched}: note that, in general, we want files attached to tickets, not links to pastebots. | ||
but I realize that's a pita in general. | 19:51 | ||
unmatched} | [Coke]: I mean the link to the commit | ||
unmatched} & bus | |||
[Coke] | \o/ Spinning up a perl 6 docker container at work for a CI solution. | ||
unmatched}: WHOOPS, my bad, sorry | |||
AlexDaniel | [Coke]: generally, is there any need to provide bisect log at all? If one doubts that this is the right commit, he can always build on commit^ and check it himself. | 19:52 | |
[Coke] | on the ticket? not required, but can't hurt, I'd wager. | 19:53 | |
[Coke] finds -13- perl 6 docker containers on docker registry. huh | 19:54 | ||
harmil_wk | rakudobugged it. Also, can I just say that being able to define ↑↑↑↑ so trivially makes me feel awe, joy and horror all at the same time. | 19:55 | |
AlexDaniel | commit 5334cb7 sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3 | 19:56 | |
committable | AlexDaniel: ¦«5334cb7»: WARNINGS for /tmp/Mzi8nSUmqf:Useless use of $a in sink context (lines 1, 1, 1)7625597484987 | ||
AlexDaniel | commit 5334cb7^ sub infix:<↑>($a, $b) is assoc<right> {$a ** $b}; sub infix:<↑↑>($a, $b) is assoc<right> { [↑] $a xx $b }; sub infix:<↑↑↑>($a, $b) is assoc<right> { [↑↑] $a xx $b }; sub infix:<↑↑↑↑>($a, $b) is assoc<right> { [↑↑↑] $a xx $b }; say 3↑↑3 | ||
committable | AlexDaniel: ¦«5334cb7»: 7625597484987 | ||
AlexDaniel | just wanted to make sure because there's some “timed out after 10 seconds” warning in the bisect log… | ||
19:56
wbill joined
|
|||
AlexDaniel | MasterDuke: oh uh! Did I break it? :) | 19:58 | |
[Coke] | hoelzro: what is your docker perl6 instance? mj41's? | 19:59 | |
oh, I can just build my own, let me do that. :) | |||
20:04
mcmillhj left,
labster left
20:14
adu joined
20:15
wbill left,
zacts_raincity joined
20:22
cdg joined,
cdg left
20:23
cdg joined
20:31
zacts_raincity left,
perlpilot left
20:34
kaare__ left
20:40
zacts___ joined
20:41
zacts___ left
|
|||
gfldex | we have map and deepmap but grep and <insert-missing-sub-here>. Is there a reason for the gap? | 20:45 | |
masak | gfldex: do you see a use case? my guess is someone did for deepmap | 20:46 | |
gfldex | masak: we get the question why flat doesn't flatten recursively quite often. And my suspicion is that they actually ask for deepgrep (because deepmap is already there). | 20:48 | |
jnthn | Wouldn't they want deepflat? :) | 20:50 | |
mst | oooh, deepgrep would be really cool | ||
masak | so, deepgrep would traverse things in pre-order, omitting whole subtrees when it got falsy from its callback? | 20:51 | |
gfldex | we do have flatmap, but that doesn't recurse | ||
jnthn | Right, nor does flat | ||
Well | |||
It does until it sees a Scalar container | |||
gfldex | m: sub deep (@a) { gather { @a.deepmap({take $_}); } }; my @l = [1,[2,3,[4,5,6]]]; .say for deep @l; | 20:52 | |
camelia | rakudo-moar aa5e49: OUTPUT«123456» | ||
jnthn | Which is fine, but then an Array is a bunch of Scalar containers, so .flat on an array is just identity | ||
masak .oO( "Finally, just deepzip your Supply with a HyperBag. As you can see, it's easy once you see the trick!" ) | |||
gfldex | deep would be a recurseing iterator | ||
jnthn | Something along those lines would deal with the boilerplate. deep isn't verb, alas. | 20:53 | |
gfldex | we don't got that in core either (and lizmat would like make it faster then I did) | ||
geekosaur | spelunk? :p | 20:54 | |
jnthn | So it'd need to be something like visit or walk or something better. :) | ||
gfldex | visit or I would have to change a module :-> | 20:55 | |
jnthn | Oh no, naming...time to run away. :-) | ||
gfldex | for descend @a {} | ||
dalek | c/literal_examples: 405fd02 | Altai-man++ | doc/ (30 files): Almost all example outputs were changed to literal versions |
20:57 | |
masak | descend++ | 20:58 | |
gfldex | m: sub deep (@a) { gather { @a.deepmap({take $_}); } }; say [+] deep (1,2) Z (3,4); | ||
camelia | rakudo-moar aa5e49: OUTPUT«10» | ||
gfldex | masak: ^^^ usecase (because we dont got |Z) | ||
20:59
skids left
|
|||
gfldex | slippy metaops might kill most of the usecases tho | 21:00 | |
21:04
kid511 is now known as kid51
21:05
labster joined
21:13
kurahaupo joined
21:16
sufrostico joined
21:23
ptolemarch left
21:27
ab6tract joined,
canopus left
21:29
canopus joined
|
|||
avar | Suggestion for a namespace to package perl6 modules under perl5 namespaces? 6Wrap::* ? | 21:29 | |
Maybe just Six::* | 21:30 | ||
21:30
wbill joined
|
|||
kurahaupo | a namespace in perl5 that starts with a digit is going to be entertaining to use | 21:31 | |
21:31
inkjetunito joined
|
|||
timotimo | how about roman numeral 6? | 21:36 | |
avar | I think I'll go for Six::*, easy to say, not in use | 21:37 | |
21:37
sno joined
21:40
ab6tract left
21:42
Sgeo joined,
canopus left
21:43
canopus joined
|
|||
Ulti | geekosaur: spelunk more like dive :P | 21:44 | |
or maybe delve | |||
21:46
adu left
21:50
AndyBotwin left
|
|||
AlexDaniel | sena_kun: wow, what a lovely job you did | 21:50 | |
sena_kun | AlexDaniel, thanks. We have one more question to resolve, look my last comment on the issue page. | 21:51 | |
timotimo | where do i have to look to see what you're talking about? | 21:52 | |
sena_kun | Let's see... | 21:53 | |
AlexDaniel | github.com/perl6/doc/issues/761 github.com/perl6/doc/pull/775 | ||
sena_kun | Ah, already ansered. | 21:54 | |
dalek | c: 405fd02 | Altai-man++ | doc/ (30 files): Almost all example outputs were changed to literal versions |
21:56 | |
c: 34f2b67 | (Wenzel P. P. Peppmeyer)++ | doc/ (30 files): Merge pull request #775 from perl6/literal_examples Almost all example outputs were changed to literal versions |
|||
AlexDaniel | sena_kun: we need more options | 21:59 | |
sena_kun | AlexDaniel, I'll update my answer then. Perhaps it's reasonable to close this issue(since it's solved) and file new? | 22:01 | |
AlexDaniel | sena_kun: yes | ||
sena_kun | AlexDaniel, okay. | ||
timotimo | cool | 22:03 | |
22:03
niceperl joined,
mcmillhj joined
22:05
niceperl left
|
|||
sena_kun | New issue - github.com/perl6/doc/issues/776 | 22:08 | |
22:08
mcmillhj left
22:14
lichtkind_ left
22:16
mcmillhj joined
22:20
maddingue left
22:21
mcmillhj left
22:22
canopus left
22:23
inkjetunito left
22:24
maddingue joined
22:27
firstdayonthejob left,
mcmillhj joined
22:28
canopus joined
22:30
mantovani joined
22:32
mcmillhj left
22:33
canopus left
22:37
RabidGravy left
22:38
spider-mario left,
huggable left
22:40
dainis joined
22:44
trnh left
22:45
mcmillhj joined
|
|||
harmil_wk | Have to go eat, but thought this would amuse: github.com/ajs/perl6-Math-Arrow | 22:46 | |
22:47
sufrostico left
22:48
dainis left
22:49
harmil_wk left
22:50
mcmillhj left
22:52
mantovani left,
kurahaupo left
22:55
mcmillhj joined
22:59
mcmillhj left
23:05
girafe left
23:07
setty1 left
23:08
rindolf left,
wamba left,
wamba joined
23:09
mcmillhj joined
|
|||
AlexDaniel | sena_kun: not sure if I understand your point. camelia already runs the latest rakudo, and you can use star: to run it on the latest Star release. I do agree that you should not depend on camelia for writing docs (you probably want to configure your setup so that you can type such characters), but I still did not get what you mean… | 23:10 | |
23:10
zacts joined
23:11
ARM9 joined
|
|||
sena_kun | AlexDaniel, eeeh, it seems my grammar gets worse and worse with time... I'll try to explain now. | 23:11 | |
But firstly, one question. I cannot have camellia-like output if I only have rakudo built on my machine? | 23:12 | ||
My point is that if I cannot, then it will be hard to type characters like newline and "<<"/">>" everytime. If I have camelia on my localhost with default rakudo - it's easy to just copy-paste output. But if not, then I need to type such characters everytime. | 23:14 | ||
timotimo | oh, you don't have a compose key or something? | ||
23:14
mcmillhj left
|
|||
AlexDaniel | sena_kun: I am kinda playing devil's advocate here, but why don't you just PM real camelia on freenode? :) | 23:15 | |
timotimo | might not always have internet connectivity | ||
AlexDaniel | and to fix that you are ready to run camelia locally with a your own local irc server just to not have to type unicode characters? I don't know, it sounds weird… | 23:16 | |
-a | |||
sena_kun | timotimo, nope. And I, to be honest, don't want it too much. But it's my problems and I doubt it relevant to question. | ||
Just as a pure example, I suppose. I cannot be docs writer, so it's just hypothetical here. | 23:17 | ||
It's only plain old me, so if majority thinks unicode formatting is cool - I'm okay with it. | 23:18 | ||
*think | |||
Ah. | |||
23:19
zacts left
|
|||
sena_kun | I'll make a note to my comment now. | 23:20 | |
timotimo | i'm a bit annoyed that i can't easily type most emoji on my keyboard | ||
AlexDaniel | m: my $output = “hello world\ntest\nfoo”; say “OUTPUT: «$output.subst(:g, “\n”, ‘’)»” | ||
camelia | rakudo-moar aa5e49: OUTPUT«OUTPUT: «hello worldtestfoo»» | ||
AlexDaniel | sena_kun: what about this ↑ ? | ||
23:22
zacts joined
|
|||
sena_kun | AlexDaniel, hmm. Is it formatting function for an author to use or you propose to lie it on repository shoulders? If first, I'm okay with it. | 23:23 | |
AlexDaniel | sena_kun: I mean that you can replicate what camelia does with a simple one-liner, it's not a big problem | 23:24 | |
23:25
sufrostico joined
|
|||
sena_kun | AlexDaniel, ah, that's what it is. Yes, then it's no problem. And even if you're without internet connection, you can just copy characters from some another page. Okay, this point is solved. | 23:25 | |
23:26
mcmillhj joined
|
|||
sena_kun | I've updated my comment. | 23:26 | |
AlexDaniel | I'm still against «» just because a lot of examples in the docs tend to have (), and «()» is OK but less than awesome. But I really think that typability of some characters should not be the main deciding factor in this case | 23:27 | |
sena_kun | Sorry, guys, but I'm done already for today. Good night, #perl6. | 23:28 | |
23:30
mcmillhj left
23:43
sena_kun left
23:47
mcmillhj joined
23:52
mcmillhj left
23:58
mcmillhj joined
|