»ö« 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. |
|||
timotimo | worst case i'd create a throw-away scalar and find its .VAR.type or .VAR.of or what it's called | 00:00 | |
00:00
cpage_ joined
00:05
Juerd joined
|
|||
timotimo | hmm | 00:07 | |
m: my Mu $foo := Metamodel::CoercionHOW.new_type(Str, Any); say $foo | 00:09 | ||
camelia | rakudo-moar be4e43: OUTPUT«(Str(Any))» | ||
timotimo | well, that looks good enough. may want to have that stashed away somewhere for re-use, though | 00:10 | |
00:12
KotH left
00:13
KotH joined
00:16
BenGoldberg joined
00:19
BenGoldberg left
00:24
BenGoldberg joined
00:27
Skarsnik_ joined
00:28
Skarsnik_ left
00:31
Skarsnik left
00:32
huggable left
00:45
BenGoldberg left
00:49
colomon left
00:50
colomon joined
00:52
BenGoldberg joined
00:57
BenGoldberg left,
colomon left
00:58
colomon joined
01:01
ssotka left
01:05
colomon left
01:14
erdic left,
BenGoldberg joined
01:15
erdic joined,
esh joined
01:17
KotH left,
KotH joined
01:19
BenGoldberg left
01:21
ggoebel114 left
|
|||
raydiak | .u ▶ | 01:24 | |
yoleaux | U+25B6 BLACK RIGHT-POINTING TRIANGLE [So] (▶) | ||
01:24
BenGoldberg joined
01:27
cpage_ left
01:31
BenGoldberg left
01:32
kalkin- joined
01:34
cpage_ joined
01:36
molaf left
01:37
kalkin-_ left
01:45
BenGoldberg joined
01:47
kid51 left
01:48
molaf joined
01:51
BenGoldberg left
01:52
pierre joined
01:53
Zoffix joined
01:54
jberger joined
|
|||
jberger | Zoffix: o/ | 01:54 | |
01:54
BenGoldberg joined,
BenGoldberg left
|
|||
Zoffix | Hey all. jberger is trying to calculate pi using monte carlo method. I tried to write it with .race, but it was slower than single-thread way. Now, I rewrote it with Promises, but it *still* doesn't offer any speed improvement on my 4-core box. Any idea why? Is my code wrong: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | 01:55 | |
m: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | |||
camelia | rakudo-moar be4e43: OUTPUT«3.13798» | ||
jberger | for anyone interested in the actual math (not that its really that hard if you think about it) here is a link I found mathfaculty.fullerton.edu/mathews/n...pimod.html | 01:56 | |
01:57
cpage_ left
|
|||
Zoffix | Oh, HAHAHA. | 01:58 | |
jberger, try it out. I set my VM I'm running this on to use just one core :P | |||
jberger | hahahaha | ||
Zoffix | To that point, .race probably works too :P | 01:59 | |
01:59
pierre left
02:00
BenGoldberg joined
|
|||
jberger | yeah | 02:02 | |
it does | |||
or at least I see the cores all spinning | |||
02:03
cpage_ joined
|
|||
Zoffix | I think it's still buggy though. | 02:03 | |
m: sleep 1 for ^4 .race: :1batch; say now - INIT now; | |||
jberger | well we are going to hit the amount of good randomness in the computer at some point | ||
camelia | rakudo-moar be4e43: OUTPUT«1.008283» | ||
Zoffix | What about my code? Does it offer speed increase when you set CORES to 4 vs 1? I'm not seeing any difference when I run it on Windows 10 | 02:04 | |
jberger | yeah | 02:06 | |
Zoffix | m: await ^4 .map: { start sleep 1}; say now - INIT now | ||
camelia | rakudo-moar be4e43: OUTPUT«1.0044573» | ||
jberger | I get 11.5s with my original | ||
6.5 for yours (race) | |||
just the one liners | |||
Zoffix | I meant this one: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | 02:07 | |
jberger | on TIMES=800_000 | ||
argh, you actually want me to download it .... :p | |||
Zoffix | Well, I can use camelia, I guess | 02:08 | |
m: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | 02:09 | ||
camelia | rakudo-moar be4e43: OUTPUT«3.13907215.3952821» | ||
Zoffix | m: gist.github.com/zoffixznet/4e0b776...019736dbf7 | ||
camelia | rakudo-moar be4e43: OUTPUT«3.139717.11032489» | 02:10 | |
jberger | no I'm running it now | ||
mspo | camelia needs , stats=true to give timings :) | ||
jberger | when I set CORES=1 I still see my cores jump up | ||
Zoffix | oh | ||
jberger | I think to be a real test CORES=1 shouldn't try to thread it | 02:11 | |
Zoffix: that one doesn't nearly scale though | 02:12 | ||
an it doesn't actually utilize the cores well either | |||
the race one does much better at showing up in htop | |||
02:18
BenGoldberg left
|
|||
Zoffix | I found the problem. | 02:18 | |
m: gist.github.com/zoffixznet/cd814df...935e71ad52 | |||
camelia | rakudo-moar be4e43: OUTPUT«3.143722.19685761» | ||
Zoffix | m: gist.github.com/zoffixznet/be7b404...7e17b82910 | ||
camelia | rakudo-moar be4e43: OUTPUT«3.142521.6769645» | ||
Zoffix | The promises were returning a lazy list and it's only when I attempted to get at the results did all the calculations were happening. | ||
Doesn't explain why all 4 cores were spinning up though, before I made it eager | 02:19 | ||
02:19
skink left
|
|||
Zoffix | ¯\_(ツ)_/¯ a puzzle for another day | 02:19 | |
02:20
BenGoldberg joined
|
|||
jberger | ah | 02:21 | |
well thanks anyway | |||
and if you like the example you are welcome to post about it, it was why I asked you in the first place | 02:22 | ||
or don't, either way | |||
02:22
BenGoldberg left
02:28
BenGoldberg joined
02:31
vendethiel joined
02:35
BenGoldberg left
02:37
BenGoldberg joined
02:38
zacts left
02:43
BenGoldberg left
02:45
BenGoldberg joined
02:47
Zoffix left
02:48
noganex joined
02:51
noganex_ left
02:53
zacts joined
02:54
cpage_ left
02:56
colomon joined
03:01
jberger left
03:05
BenGoldberg left
03:06
BenGoldberg joined
03:18
BenGoldberg left
03:19
labster left
03:20
BenGoldberg joined
03:24
labster joined
03:25
BenGoldberg left
03:26
BenGoldberg joined
03:33
Zoffix joined
|
|||
Zoffix | ugexe, ah, I was using unspace wrong. I was doing .foo \.bar and that extra space before the backslash was giving trouble (RE: stackoverflow.com/questions/3742354...x/37425772 ) | 03:34 | |
03:46
bjz joined
03:51
vendethiel left
|
|||
dalek | osystem: 0b6c611 | (Richard Hainsworth)++ | META.list: Adding Algorithm::Tarjan to ecosystem Provides a method for finding cycles in a directed graph. See hhtps://github.com/finanalyst/p6-Algorithm-Tarjan |
04:00 | |
04:01
finanalyst joined
|
|||
finanalyst | just tried adding a module to ecosystem 'Algorithm::Tarjan'. Not sure if I have done this correctly. | 04:01 | |
I may have added directly to the Meta list without going through the pull request process. | 04:03 | ||
I'm still trying to figure out the git process | |||
04:08
finanalyst left
|
|||
Zoffix | Looks fine to me. | 04:11 | |
04:13
kaare_ joined
|
|||
diakopter | .u :smile_cat: | 04:22 | |
yoleaux | U+003A COLON [Po] (:) | ||
U+005F LOW LINE [Pc] (_) | |||
U+0061 LATIN SMALL LETTER A [Ll] (a) | |||
Zoffix | .u 😿 | ||
yoleaux | U+1F63F CRYING CAT FACE [So] (😿) | ||
Zoffix | .u cat face | ||
yoleaux | U+1F431 CAT FACE [So] (🐱) | ||
diakopter | heh | ||
04:26
cpage_ joined
04:33
Cabanossi left
04:34
khw left
04:35
Cabanossi joined
04:43
CIAvash joined
04:56
jack_rabbit joined
05:01
wamba joined
05:11
AlexDaniel left
05:18
cpage_ left
05:23
mohae left
05:34
wamba left
05:35
bjz_ joined,
cpage_ joined,
xfix left
05:36
bjz left
05:37
xfix joined
05:39
ssotka joined
05:44
kurahaupo left
05:55
bjz joined
05:56
wamba joined,
bjz_ left,
jack_rabbit left
06:02
buharin joined
06:07
ssotka left
06:26
ssotka joined
06:34
wamba left
06:46
Ven joined
06:48
RabidGravy joined
07:00
buharin left,
pierre joined
07:02
bjz_ joined
07:04
bjz left
07:06
jjido joined
07:15
jjido left
|
|||
RabidGravy | boom | 07:21 | |
07:22
domidumont joined
07:23
rindolf joined
07:25
buharin joined
07:26
domidumont left,
ssotka left
07:27
domidumont joined
07:37
wbill joined
07:45
domidumont left
07:46
buharin left
07:49
pierre left
07:52
cpage_ left
07:56
cpage_ joined,
firstdayonthejob joined
08:01
domidumont joined,
domidumont left,
domidumont joined
08:03
Emeric joined
08:06
Emeric1 joined,
pierre joined
08:09
Emeric left,
Emeric1 is now known as Emeric
08:11
pierre left
08:12
darutoko joined
|
|||
RabidGravy | why *does* github call the generated LICENSE file that? I'd never thought about it before, but in english that is the verb rather than the noun | 08:16 | |
08:16
BenGoldberg left
08:19
BenGoldberg joined
|
|||
huf | no, license is also the noun | 08:20 | |
Juerd | RabidGravy: US English uses the spelling 'license', sometimes 'licence', for both the noun and the verb, unlike advice/advise which is noun/verb in both UK and US English. | 08:23 | |
RabidGravy | huf, only in certain dictionaries | ||
Juerd | But, why would having a verb in a file name be an issue? README is neither, but does have a verb. | 08:24 | |
huf | RabidGravy: so? presumably whoever named the file was using one of those dictionaries | 08:25 | |
everyone gets to pick and choose :) | |||
Juerd | And sometimes it's called COPYING instead of LICENSE | ||
dalek | osystem: 1c0a6fb | palapitta++ | META.list: Movieinfo to get movie info from omdb |
||
osystem: 041e4df | RabidGravy++ | META.list: Merge pull request #211 from palapitta/patch-3 Movieinfo |
|||
huf | Juerd: but COP isnt a verb! | ||
(it is...) | 08:26 | ||
Juerd | huf: Makes me wonder what ying is. | ||
huf | yin + yang finally combined | ||
08:27
BenGoldberg left
|
|||
Juerd | That sounds slightly apocalyptical... | 08:27 | |
huf | yep | ||
the world *is* ending, it's just taking its sweet time about it | 08:28 | ||
Juerd | END { fork } | ||
Oh, hm, the fork will end just as well | |||
08:28
bjz_ left
|
|||
Juerd | Does Perl 6 has a way to restart your program? The ultimate 'goto 10'? | 08:29 | |
08:29
BenGoldberg joined
|
|||
Juerd | In Perl 5 I'd probably cheat with "exec $0" and hope both parts dwim. | 08:29 | |
RabidGravy | I think Zoffix was playing with something like that | ||
github.com/zoffixznet/perl6-Bailad...oRestarter | 08:31 | ||
08:32
hjst joined
|
|||
Juerd | That's managed externally with kill | 08:33 | |
08:36
Ven left,
vendethiel joined
08:41
wbill left
08:43
cpage_ left
08:47
spider-mario joined
08:52
zero-one left
08:53
wbill joined
08:55
wbill left
08:58
bjz joined
08:59
domidumont left
09:08
pierre_ joined
09:12
pierre_ left
09:13
finanalyst joined
09:22
BenGoldberg left
09:24
BenGoldberg joined
|
|||
finanalyst | module question: I put a 32x32 png in library logotype, but the logo did not show up in the module directory. Is meta info needed? | 09:27 | |
09:27
cibs joined
|
|||
finanalyst | s/library/directory/ | 09:28 | |
RabidGravy | don't think so | ||
09:29
pierre_ joined
|
|||
RabidGravy | ah logo_32x32.png apparently | 09:29 | |
(having just examined one where it does show) | |||
09:31
ab6tract joined
|
|||
ab6tract | o/ #perl6 | 09:32 | |
09:32
TEttinger left
|
|||
ab6tract | i'm happy to report some great progress has been made on the Sereal port! | 09:32 | |
i'd like to make it available both with a C backend and a PP one | 09:34 | ||
09:36
iH2O joined
|
|||
lizmat | timotimo: thanks for the tip, but for some reason I get locally: | 09:36 | |
$ 6 'my Mu $foo := Metamodel::CoercionHOW.new_type(Str, Any); say $foo' | |||
Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW' | |||
in block <unit> at -e line 1 | |||
09:37
iH2O left
|
|||
lizmat | The same I get with: | 09:37 | |
$ 6 'my Mu $a = Str(Any); say $a' | |||
Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW' | |||
in block <unit> at -e line 1 | |||
09:37
vendethiel left
|
|||
lizmat | it was that error that made me revert the patch | 09:38 | |
ab6tract | but I'm running into some confusion around how to reference subroutines in one role that will later get defined in a different role | 09:43 | |
i thought stubbing them in role A and defining them in role B and mixing them in 'does A does B' order would resolve it, but at run-time the stubs still get run | 09:44 | ||
09:44
Ven joined
09:45
RabidGravy left
09:48
BenGoldberg left
09:50
BenGoldberg joined,
cibs left
09:52
llfourn joined,
cibs joined
09:56
BenGoldberg left
09:58
BenGoldberg joined
|
|||
llfourn | .tell nine hoelzro++ has been able to trigger the precomp bug on the first run through with the right dependency tree (in case you missed it) RT #128268 | 10:00 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128268 | ||
yoleaux | llfourn: I'll pass your message to nine. | ||
ab6tract | there is always the EVAL option, but i was hoping for something less dirty | 10:04 | |
lizmat | timotimo: ah, missed a commit :-) | 10:14 | |
10:25
firstdayonthejob left
|
|||
masak | good afternoon, #perl6 | 10:26 | |
Ven | o/ masak | ||
10:27
cibs left
|
|||
lizmat | masak o/ | 10:29 | |
10:30
cibs joined,
pierre_ left
10:34
buharin joined
10:35
buharin left
10:38
Ven left
10:40
grondilu left
10:41
labster left
10:43
grondilu joined,
BenGoldberg left
|
|||
timotimo | Zoffix: currently, invocation requires two mallocs; one for the lexical environment, one for the space where all the register contents go. malloc will serialize access with locking. if you have an invocation-heavy thing inside your race (things not very well inlined, calls that are in there to make race work, ...) it'll spend most of its time spinning trying to acquire that lock | 10:44 | |
ab6tract | ive decided to make the backend distinction an environment setting, so i can punt it all to compile time and use needs/import :D | 10:45 | |
10:47
edehont joined
11:03
BenGoldberg joined
|
|||
Zoffix | timotimo, invocation is what? method calls? | 11:11 | |
lizmat | anything with () or a method call (which is () under the hood) | 11:13 | |
timotimo | Zoffix: anything that creates a call frame, really | 11:14 | |
if things go bad, even a pair of curlies inside a code body can cause an invocation to happen | |||
it's something jnthn is very much looking into making faster right now | |||
Zoffix | :S that makes .race kinda not very racy, considering most of the things would have () in them :/ | ||
At least it explains why I had 2x speed increase when I was using 4x the cores. | |||
timotimo | of course. that resource contention is going to go away | 11:15 | |
11:15
kid51 joined
11:17
iH2O joined
|
|||
Zoffix | Ah, palapitta reminds me of a young me. Ill-designed, untested code released for fun rather than utility. | 11:27 | |
Considering their first module was an implementation of the weather API I'm discussing in my workshop, I guess I'm at least partially responsible 😿 | 11:28 | ||
11:29
cibs left
11:30
iH2O left
11:31
cibs joined,
Emeric left
11:36
Emeric joined,
buharin joined
11:37
edehont left,
|meta joined
11:39
BenGoldberg left,
BenGoldberg joined
|
|||
masak | remind me -- does Perl 6 have something like Python's math.hypot ? | 11:40 | |
math.hypot(x, y) gives back math.sqrt(x * x + y * y) | |||
Zoffix | use NativeCall ... :P | 11:41 | |
BenGoldberg | I don't think there is one. | 11:42 | |
11:43
jjido joined
|
|||
Zoffix | m: use NativeCall; sub hypot(num64, num64 --> num64) is native {}; say hypot 3e0, 4e0 | 11:43 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5» | ||
Zoffix | m: sub hypot {sqrt $^a²+$^b²}(3, 4).say | 11:45 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5» | ||
dogbert17 | (x+yi).abs # perhaps | 11:49 | |
11:50
BenGoldberg left,
Zoffix is now known as anonymous
|
|||
dogbert17 | m: say (3+4i).abs | 11:50 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5» | ||
masak | heh :) | ||
anonymous | :o what sorcery is that | ||
11:50
anonymous is now known as Zoffix
|
|||
masak | the magic of complex arithmetic | 11:50 | |
Zoffix | m: say (25+666i).abs | 11:51 | |
camelia | rakudo-moar c5dfd7: OUTPUT«666.469054045272» | ||
masak | "abs($real)" can be seen as "the distance from 0 to the number $real" | ||
Zoffix | m: sub hypot {sqrt $^a²+$^b²}(25, 666).say | ||
camelia | rakudo-moar c5dfd7: OUTPUT«666.469054045272» | ||
Zoffix | m: say 3+4i | ||
camelia | rakudo-moar c5dfd7: OUTPUT«3+4i» | ||
masak | this notion can be extended to the complex numbers, which pulls in the Pythagorean Theroem as a side effect | ||
Zoffix: you're familiar with complex numbers? | 11:52 | ||
Zoffix | only that i is sqrt(-1) | ||
masak | heh :) | ||
it is, yes | |||
m: sqrt(-1 + 0i) | |||
camelia | rakudo-moar c5dfd7: OUTPUT«WARNINGS for /tmp/oHWXGCvXH4:Useless use of "sqrt(-1 + 0i)" in expression "sqrt(-1 + 0i)" in sink context (line 1)» | ||
masak | m: say sqrt(-1 + 0i) | ||
camelia | rakudo-moar c5dfd7: OUTPUT«0+1i» | ||
dogbert17 | a recent addition to the docs: doc.perl6.org/type/Complex#method_abs | 11:53 | |
masak | Zoffix: I think the best way to think about the complex numbers is that they "fix" the fundamental theorem of algebra | 11:54 | |
11:54
kurahaupo joined
|
|||
masak | Zoffix: with only the real numbers, a degree-2 polynomial can have *up to* 2 roots, a degree-5 polynomial can have *up to* 5 roots, etc | 11:54 | |
Zoffix: with the complex numbers, a degree-N polynomial has *exactly* N roots | 11:55 | ||
11:55
BenGoldberg joined
|
|||
masak | which, needless to say, is very neat and pretty | 11:55 | |
Zoffix | Oh, coolk | ||
masak | and when you put it like that, it's a minor miracle that setting `i := sqrt(-1)` fixes all that | 11:56 | |
it fixes it for *all* the polynomials. all the possible ones. | |||
11:56
kid51 left
|
|||
Zoffix | Ohhh, k, now I get why (3+4i).abs works :D | 11:56 | |
masak | what made it click? :) | 11:57 | |
Zoffix | hehe, neat :D dogbert17++ | ||
11:57
ab6tract left
|
|||
dogbert17 | glad to be able to help | 11:57 | |
Zoffix | I was thinking of it as "3" plus some other number. What made it click is realizing it's 3 with 4 on the imaginary plane and then you can see the distance to it would by a hypotenuse of a right triangle | ||
masak | I'm not a huge fan of abusing complex numbers as mere Cartesian coordinates | 11:58 | |
Zoffix | That's what made it click :) | ||
11:59
kid51 joined
|
|||
dogbert17 | .seen lizamt | 12:00 | |
yoleaux | I haven't seen lizamt around. | ||
dogbert17 | .seen lizmat | ||
yoleaux | I saw lizmat 11:13Z in #perl6: <lizmat> anything with () or a method call (which is () under the hood) | ||
lizmat is still here | 12:01 | ||
but about to get some fresh air | |||
dogbert17 | lizmat: I have some draft documentation for Hash.keyof. is it in touch with reality? gist.github.com/dogbert17/447575b4...0bb754fadd | ||
masak | lizmat: go go go! fresh air is important! :) | 12:02 | |
lizmat | say %h1.keyof; # (Any) # Str(Any) ?? | ||
jnthn | m: say Str(Any) | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(Str(Any))» | ||
jnthn | lizmat: I fixed ^^ last night... :) | ||
lizmat | yeah, noticed this moarn | ||
jnthn | :) | 12:03 | |
pochi | m: sub foo() returns Str, Int { return "hello", 42 } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hn3Banv5ecMissing blockat /tmp/hn3Banv5ec:1------> 3sub foo() returns Str7⏏5, Int { return "hello", 42 } expecting any of: new name to be defined» | ||
pochi | is there a way to specify a mixed return type? | 12:04 | |
jnthn | pochi: One way is to declare a `subset StrOrInt where Str | Int;` and then use it as the return type | ||
psch | m: sub f { return "hello", 42 }; f().WHAT.say | 12:05 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(List)» | ||
psch | pochi: you don't seem to be returning something mixed? | ||
lizmat | pochi: in p6 you only ever return one thing | ||
and if it has comma's in it, it's a List | |||
afk& | |||
pochi | hm, ok, but can I put constraints on the contents of List then? | ||
lizmat | I think that's specced, but not implemented yet | 12:06 | |
jnthn? | |||
llfourn | a junction? | ||
lizmat | really afk& | ||
12:06
AlexDaniel joined
|
|||
llfourn | m: sub foo() returns Str|Int { return "hello", 42 }; foo(); | 12:06 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/V63DQbH1yrMissing blockat /tmp/V63DQbH1yr:1------> 3sub foo() returns Str7⏏5|Int { return "hello", 42 }; foo(); expecting any of: new name to be defined» | ||
jnthn | Oh, you want to pattern match what's in a list... | ||
pochi | yes | ||
llfourn | m: sub foo() returns :(Str,Int) { return "hello", 42 }; foo(); | 12:07 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cdu_zP1NBFMalformed traitat /tmp/cdu_zP1NBF:1------> 3sub foo() returns7⏏5 :(Str,Int) { return "hello", 42 }; foo(» | ||
llfourn | m: sub foo() returns List where { $_ ~~ :(Str,Int) } { return "hello", 42 }; foo(); | ||
dogbert17 | lizmat++ thx for the feedback | ||
jnthn | m: subset IS where :(Int, Str); sub foo() returns IS { (4.2, 'hi') }; say foo | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Type check failed for return value; expected IS but got List ($(4.2, "hi")) in sub foo at /tmp/MTaWmxTvNo line 1 in block <unit> at /tmp/MTaWmxTvNo line 1» | ||
jnthn | m: subset IS where :(Int, Str); sub foo() returns IS { (4, 'hi') }; say foo | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(4 hi)» | ||
llfourn | is my last message flashing for anyone else? | 12:08 | |
pochi | it's flashing :-) | ||
Zoffix | No, but I see a null char | ||
jnthn | llfourn: No, white text on grey background for me :) | ||
llfourn | o.o | ||
pochi | what the 'where :()' syntax? | 12:09 | |
*what's | |||
jnthn | :(...) is a signature literal | ||
pochi | ah | ||
thank you :-) | |||
jnthn | And subest Foo where <conditon here>; is a refinement type | ||
Zoffix | FWIW, I opened a ticket a few days about vis-a-vis returning Int|Str and ther like: rt.perl.org/Ticket/Display.html?id=128262 | ||
12:09
CIAvash left
|
|||
jnthn | Zoffix: Yeah, confusing error... :) | 12:09 | |
Compiler's trying to be helpful and ends up being the opposite. :) | 12:10 | ||
m: sub foo() returns Itn { } | |||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DbnqYz0xveInvalid typename 'Itn'. Did you mean 'Int'?at /tmp/DbnqYz0xve:1------> 3sub foo() returns Itn7⏏5 { }» | ||
jnthn | m: sub foo() returns Int|Str { } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nZq9Zg2VRWMissing blockat /tmp/nZq9Zg2VRW:1------> 3sub foo() returns Int7⏏5|Str { } expecting any of: new name to be defined» | ||
jnthn | Oh, it wasn't that one? | 12:11 | |
Zoffix | m: sub foo(--> Int|Str) { } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hicSjxwiOMType 'Int' is not declared. Did you mean 'int'?at /tmp/hicSjxwiOM:1------> 3sub foo(--> Int7⏏5|Str) { }» | ||
jnthn | Oh, with --> | ||
Yeah, agree that wants some atention | |||
*attention | |||
llfourn | m: sub (Int|Str $var) { }; # I also try and do this sometimes | ||
camelia | rakudo-moar c5dfd7: OUTPUT«===SORRY!===No compile-time value for Str» | ||
jnthn | o.O | 12:12 | |
llfourn | also I even try regex literals :P | ||
12:12
bjz_ joined
|
|||
jnthn | Trouble with that one is that |foo is capture syntax inside a signature :) | 12:12 | |
12:13
bjz left
|
|||
llfourn | m: multi regex-dispatch(/fo+/) { }; multi regex-dispatch(/ba+/) {}; regex-dispatch("foo"); #something like | 12:13 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/go3EVCCVwdCalling regex-dispatch(Str) will never work with any of these multi signatures: (Int $ where { ... })  (Int $ where { ... })at /tmp/go3EVCCVwd:1------> 3) { }; multi regex-dispat…» | ||
jnthn | oh hah, I bet I can guess... It sees "(Int |Str" and declares a symbol Str that the capture will be bound in to. This in turn clobbers the Str symbol needed to produce the parse error that follows :P | ||
llfourn | ahh | 12:14 | |
psch | m: sub f($a, ::($a) $b) { }; f(Int|Str, "foo") # /o\ | ||
camelia | ( no output ) | ||
jnthn | That's pretty amusing. But yeah, if it's not already RT'd please do; the current error helps nobody.. | ||
llfourn | okie doke | ||
my last RT (5 mins ago) didn't go so well. Lets see if I can get it done in one email this time. | 12:15 | ||
12:16
jjido left
|
|||
jnthn | :) | 12:18 | |
lunch & | |||
dogbert17 | m: sub foo() returns IntStr { return IntStr.new(42, "hello") }; say foo().perl | 12:19 | |
camelia | rakudo-moar c5dfd7: OUTPUT«IntStr.new(42, "hello")» | ||
12:25
pierre joined
12:27
jjido joined
12:32
huggable joined
|
|||
dalek | c: 32541e4 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod: Added docs for method keyof in class Hash. lizmat++, jnthn++ |
12:35 | |
12:36
iH2O joined
12:37
BenGoldberg left
12:39
pierre left,
BenGoldberg joined
12:41
pierre joined
12:42
jjido left
12:43
iH2O left
12:44
pierre left
12:47
jjido joined
12:48
buharin left
12:49
setty1 joined
|
|||
dalek | c: 49f7f34 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod: get `where` into the index |
12:58 | |
c: 3948b65 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod: get `where` into the index |
|||
12:59
BenGoldberg left
13:00
BenGoldberg joined
13:07
pierre joined
13:10
jjido left,
pierre left
13:13
kaare_ left
|
|||
grondilu | m: say (my $).VAR.name; | 13:16 | |
camelia | rakudo-moar c5dfd7: OUTPUT«$» | ||
grondilu | m: say class { has $.x }.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class '<anon|57888480>' in block <unit> at /tmp/IRkz3SpHWR line 1» | ||
13:16
pierre joined
|
|||
grondilu | m: say class { has $.x }.x.VAR.name | 13:16 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Cannot look up attributes in a type object in block <unit> at /tmp/aqDkPFY7Nf line 1» | ||
pochi | $.x is a method that operates on $!x | 13:19 | |
psch | m: say class { has $.x }.new(:2x)x.VAR.name | ||
camelia | rakudo-moar c5dfd7: 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/9lF534opPv line 1Actually thrown at: in block <unit> at /tmp/9lF534opPv line 1» | ||
psch | m: say class { has $.x }.new(:2x).x.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/egiKpG4qqE line 1» | ||
13:20
BenGoldberg left
|
|||
Zoffix | m: say class { has $.x }.new(:2x).x.VAR.^name | 13:20 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Int» | ||
psch | m: say class { has $.x }.new(:2x).x.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/jR7xM3jJzE line 1» | ||
psch | m: say class { has $.x }.new(:2x).x.VAR.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/XmYzWLUUwC line 1» | ||
psch | vOv | ||
not even sure what's being looked for :) | |||
jnthn | m: say class { has $.x is rw }.new(:2x).x.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/gjscsjLZXL line 1» | ||
jnthn | m: say class { has $.x is rw }.new(:2x).x.VAR.name | 13:21 | |
camelia | rakudo-moar c5dfd7: OUTPUT«$!x» | ||
jnthn | Maybe that? :) | ||
Zoffix | :o | ||
psch | oh, right, no rw means no container there i suppose | ||
jnthn | Yeah, we take the thing out of its container | ||
When no "is rw" | |||
grondilu | what's :2x? | 13:23 | |
m: say :2x | |||
camelia | rakudo-moar c5dfd7: OUTPUT«Unexpected named parameter 'x' passed in block <unit> at /tmp/Ba1CO326bj line 1» | ||
pochi | :x(2) | ||
psch | m: say (:2x).WHAT | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(Pair)» | ||
psch | m: say (:2x).perl | ||
camelia | rakudo-moar c5dfd7: OUTPUT«:x(2)» | ||
grondilu | oh, that's a thing? Ok. | ||
jnthn | Most often shows up as things like :1st | ||
psch | m: $_ = "foo foo"; s:2nd/foo/bar/; .say | ||
camelia | rakudo-moar c5dfd7: OUTPUT«foo bar» | ||
Zoffix | or :42days :) | ||
Zoffix uses it for everything | 13:24 | ||
grondilu | can be useful for physical units and stuff | ||
dalek | c: fffe595 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod: link to definition of where |
13:26 | |
Zoffix | If anyone has a penchant for long technical documents and has interest in the new IRC::Client, I welcome feedback for my new design: github.com/zoffixznet/perl6-IRC-Cl...01-main.md | 13:27 | |
AlexDaniel, ^ you had some interest in it awhile back. | |||
13:27
aries_liuxueyang left
|
|||
AlexDaniel | yaaay | 13:28 | |
Zoffix: by the way, what's up with the memory leaks and stuff? | |||
Zoffix: have you found any way to localize it? | |||
Zoffix | No, I chose to go with "ignore it for now and hope someone fixes it" route. | ||
And they were before jnthn++'s frame work, so *shrug* they may not be there any more for all I know. | 13:29 | ||
AlexDaniel | because, you know… your module can be 100% gold but nobody is going to start using it because of such problems :( | ||
Zoffix: OK I'll read that and let you know what I think | 13:30 | ||
jnthn | Were they before or after the big gen2 leak fix in Moar also? | 13:31 | |
That was likely to blame for a lot of leakage in longer-running things. | |||
Zoffix | I'm 85% they were in this version: This is Rakudo version 2016.04-117-g7db7b46 built on MoarVM version 2016.04 | ||
*85% sure | 13:32 | ||
AlexDaniel | Zoffix: “provide a programmatic interface to IRC” it sound like a bot, why not say that it is for creating bots? Or are you hoping that people will create IRC clients on top of that? | 13:33 | |
s | |||
jnthn | Zoffix: 7f2a6fa8416 was the fix in question | ||
Zoffix: Which git describes itself as 2016.03-96-g7f2a6fa, so it's maybe not that | |||
Zoffix | AlexDaniel, they can if they want to. I might create one if I get bored enough :P | 13:34 | |
call it 6IRC | 13:35 | ||
13:35
RabidGravy joined
|
|||
Zoffix | with a stylzed logo of half a butterfly seen behind IRC :P | 13:35 | |
jnthn | Zoffix: If it still leaks, please do file a report though. I've spent quite some effort on fixing/building stuff that makes it easier to hunt leaks down. :) | ||
13:35
BenGoldberg joined
|
|||
Zoffix | jnthn, k :) | 13:35 | |
timotimo is sitting outside on a little (actually, big) picnic blanket :3 | 13:36 | ||
jnthn | timotimo: nice :) | ||
Hope you don't have thunderstorms forecast to start imminently like here ;-) | |||
AlexDaniel | Zoffix: “A program may have multiple Client Objects, but each of them can be connected only to one IRC server.” why? | 13:37 | |
dalek | osystem: 771c2a4 | yowcow++ | META.list: add Digest::MurmurHash3 |
||
osystem: 08c8b73 | titsuki++ | META.list: Merge pull request #212 from yowcow/add-digest-murmurhash3 Add Digest::MurmurHash3 |
|||
timotimo | AlexDaniel: because clients have state, like what channels they have been joined to, what flags they have, realname nickname, ... | 13:38 | |
Zoffix | AlexDaniel, simpler to implement. | ||
gfldex | m: sub f(&c where :(Int, Str)) { say c(10, 'ten') }; sub g(Int $i, Str $s){ $s ~ $i }; f(&g); | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Constraint type check failed for parameter '&c' in sub f at /tmp/rkBIxNJdUa line 1 in block <unit> at /tmp/rkBIxNJdUa line 1» | ||
timotimo | makes sense to have that per Client object | ||
Zoffix | AlexDaniel, also, you have nicks and usernames that likely are different on different servers | ||
psch | m: sub f(&c:(Int, Str)) { say c(10, 'ten') }; sub g(Int $i, Str $s){ $s ~ $i }; f(&g); | 13:39 | |
camelia | rakudo-moar c5dfd7: OUTPUT«ten10» | ||
AlexDaniel | yeah but if I wanted to create a bot that will connect to multiple servers at the same time, things will become seriously hard for me | ||
Zoffix | Like what? | 13:40 | |
As in, what is a specific area of hardness? | 13:41 | ||
start IRC::Client.new(:server<foo.net>).run; start IRC::Client.new(:server<bar.net>).run; | |||
timotimo | seriously hard seems like a really big overstatement here | 13:42 | |
AlexDaniel | unnecessarily hard is probably a better way to describe it | ||
Zoffix | my $stuff-that-does-things = IRC::Client::Plugin::Whatever.new; start { IRC::Client.new(:server($_), :plugins($stuff-that-does-thigns)).run } for <foo.net bar.net>; | ||
AlexDaniel | Zoffix: then what? I want to have the same state between several servers, but as far as I can see each plugin is probably going to be on its own | 13:43 | |
e.g. if it's a factoid, for example | |||
and also want no code duplication, because you know… | |||
my proposed solution was to just add a server:channel to the list of channels to join, and that's it. You handle everything else | 13:44 | ||
Zoffix | AlexDaniel, in the example above, you have just one plugin object. If it's a factoid, it'd be using the same DB. | ||
BenGoldberg | This isn't python, people. It's allowable to have more than one solution to a problem. | 13:45 | |
Zoffix | AlexDaniel, I don't see how such a solution would handle, say, using different nicks on different servers | 13:46 |