»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋 Set by Zoffix on 25 July 2018. |
|||
00:00
nebuchadnezzar left
00:08
sena_kun left,
nebuchadnezzar joined
00:20
zengargoyle left,
leont joined
00:22
zengargoyle joined,
vrurg joined
00:42
rindolf left
00:43
cpan-p6_ left,
cpan-p6 joined
01:17
zacts joined
01:20
zacts left
01:41
kurahaupo_ left,
kurahaupo joined
|
|||
Geth | doc: cdabde82a5 | cfa++ | doc/Language/pod.pod6 an → a (#2604) |
01:44 | |
synopsebot | Link: doc.perl6.org/language/pod | ||
cpan-p6 | New module released to CPAN! SDL2-Raw (0.3) by 03TIMOTIMO | 01:45 | |
01:45
kurahaupo_ joined
01:47
kurahaupo_ left
01:48
kurahaupo_ joined
01:49
kurahaupo left
01:53
kurahaupo joined,
kurahaupo_ left
02:04
markoong left
02:11
molaf left
02:16
kurahaupo left,
kurahaupo joined
|
|||
leont | Another day, another rakudobug | 02:19 | |
02:19
ferreira joined
02:23
molaf joined
02:25
kurahaupo_ joined,
kurahaupo_ left,
kurahaupo_ joined
|
|||
vrurg is finally got enough bravery to try fixing one of them... | 02:27 | ||
02:28
kurahaupo left
02:29
ferreira left
02:36
ferreira joined
02:40
kurahaupo joined,
kurahaupo left,
kurahaupo joined
02:41
kurahaupo_ left
02:42
zacts joined
02:44
leont left
02:45
kurahaupo left,
kurahaupo_ joined
|
|||
cpan-p6 | New module released to CPAN! Path-Finder (0.2.0) by 03LEONT | 02:46 | |
02:49
ferreira1 joined
02:50
ferreira left
02:53
zacts left,
zacts joined
02:59
kurahaupo_ left
03:16
kurahaupo joined
03:22
ferreira joined
03:23
ferreira1 left
03:33
cpan-p6_ joined
03:42
kurahaupo_ joined
03:43
kurahaupo_ left
03:44
kurahaupo_ joined
03:45
cpan-p6 left
03:46
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
kurahaupo left
03:47
kurahaupo joined
03:48
dant left
03:49
kurahaupo left,
kurahaupo_ left,
kurahaupo joined
03:52
kurahaupo_ joined
03:53
kurahaupo left
03:56
kurahaupo joined,
kurahaupo_ left
04:07
kurahaupo_ joined,
kurahaupo left
04:27
zacts left
05:12
w17t joined
05:16
molaf left
05:27
vrurg left
05:49
pmurias joined
06:12
robertle left
06:16
kurahaupo joined
06:19
sno left
06:20
kurahaupo_ left,
kurahaupo_ joined
06:21
kurahaupo left
06:31
kurahaupo_ left,
kurahaupo joined
06:37
domidumont joined
06:40
jmerelo joined
06:46
kurahaupo left,
kurahaupo joined
06:56
random_yanek left
06:57
kurahaupo left,
kurahaupo joined
06:59
sno joined
|
|||
Geth | doc: 9787750528 | (JJ Merelo)++ | 3 files Clarifications and reflow |
07:01 | |
doc: ab39e38999 | (JJ Merelo)++ | 3 files More clarifications, reindentations and reflow |
|||
07:08
kurahaupo left,
random_yanek joined,
kurahaupo joined
07:18
kurahaupo left,
ravenousmoose joined
07:19
kurahaupo joined,
domidumont left
07:21
cpan-p6_ left
07:22
cpan-p6 joined,
ufobat_ joined
07:26
ufobat__ left
07:29
xinming joined
07:32
kurahaupo left,
kurahaupo joined
07:33
abraxxa joined
07:42
jmerelo left
07:46
kurahaupo left,
kurahaupo joined
08:00
kurahaupo left,
domidumont joined
08:01
kurahaupo joined
08:07
andrzejku_ joined
08:11
andrzejku left,
andrzejku_ is now known as andrzejku
08:13
kurahaupo left,
kurahaupo joined
08:23
kurahaupo left,
kurahaupo joined
08:27
ravenousmoose left
08:29
zakharyas joined
08:30
rindolf joined
08:36
kurahaupo left
08:37
kurahaupo joined
08:46
kurahaupo left
08:47
kurahaupo joined
08:50
aborazmeh left
08:52
dakkar joined
08:55
ravenousmoose joined
08:57
kurahaupo left,
kurahaupo joined
09:02
kurahaupo_ joined,
kurahaupo_ left
09:05
kurahaupo left
09:06
kurahaupo joined
09:17
Sgeo_ left
09:18
Sgeo_ joined
09:23
mercury^ joined
09:25
saki joined
|
|||
mercury^ | Hi. Is there a rationale somewhere for types being undefined values of themselves, instead of defined values of Type? This seems to have changed between the relevant Apocalypse and the later spec for the object model. I ask because the initial plan seems more intuitive to me. | 09:28 | |
jnthn: you are a maintainer of MoarVM, is that right? I noticed that some scripts download the Unicode data via ftp and do no verification. The data is available via HTTPS also. | 09:31 | ||
09:34
kensanata joined
09:45
ravenousmoose left
09:46
ravenousmoose joined
|
|||
moritz | mercury^: "defined" is (usually) the distinction between being a type object and an instance | 09:51 | |
mercury^ | moritz: but why was this design chosen? | 09:52 | |
09:57
ravenousmoose left
|
|||
moritz | mercury^: so that a type conforms to itself | 09:57 | |
I'm not too deep into the semi-circular approach to MOPs though, I guess jnthn++ or TimToady++ could explain it better | 09:58 | ||
mercury^ | p6: sub f(Any:U $t, $x) returns Array[$t] { return $x; }; f(Int, Array[Int](4)) | 09:59 | |
camelia | Type check failed for return value; expected Array[Mu] but got Array[Int] (Array[Int].new(4)) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
mercury^ | Why does that fail? | ||
10:00
abraxxa1 joined
10:01
abraxxa left
10:05
pmurias left,
pmurias joined
10:08
aborazmeh joined,
aborazmeh left,
aborazmeh joined
10:09
pmurias left
10:11
tino joined,
ravenousmoose joined
10:14
pmurias joined
|
|||
moritz | dunno | 10:15 | |
m: sub f(Any:U ::T, $x --> Array[T]) { $x }; f Array[Int].new() | |||
camelia | Too few positionals passed; expected 2 arguments but got 1 in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
moritz | m: sub f(Any:U ::T, $x --> Array[T]) { $x }; f Int, Array[Int].new() | ||
camelia | Type check failed for return value; expected Array[T] but got Array[Int] (Array[Int].new()) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
10:17
notagoodidea joined
10:20
pmurias left
10:21
pmurias joined
10:22
mowcat joined
10:28
ExtraCrispy left
10:33
pmurias left
10:43
aborazmeh left
10:49
cpan-p6 left,
cpan-p6 joined
|
|||
dakkar | oh, type captures are weird | 10:57 | |
m: sub f(::T $x, T $y) { $x+$y }; f(1,2); f(1.Int,2.Num) | |||
camelia | Type check failed in binding to parameter '$y'; expected Int but got Num (2e0) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
dakkar | m: sub f(::T $x, T $y) { $x+$y }; f(1,2); f(1.Int,2.Int) | ||
camelia | ( no output ) | ||
dakkar | this is as I'd expect | 10:58 | |
but… | |||
m: sub f(::T $x, T $y --> T) { $x+$y }; f(1.Num,2.Num) | |||
camelia | Died with X::TypeCheck::Return in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
dakkar | ??? | ||
evalable6 | Stub code executed in block <unit> at /tmp/wcYMIFUXl_ line 1 |
||
dakkar | also: | 10:59 | |
m: sub f(::T $x, Array[T] $y) { $y.push($x) }; f(1.Int,Array[Int].new()) | |||
camelia | Type check failed in binding to parameter '$y'; expected Array[T] but got Array[Int] (Array[Int].new()) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
dakkar | is this the expected behaviour? | ||
11:09
Sgeo_ left
11:10
Sgeo_ joined
|
|||
mercury^ | I need to go. If anyone can answer my questions, please feel free to. I will check the logs for answers later. | 11:31 | |
11:32
mercury^ left
|
|||
AlexDaniel | .tell samcv colabti.org/irclogger/irclogger_lo...02-04#l153 | 11:37 | |
yoleaux | AlexDaniel: I'll pass your message to samcv. | ||
11:40
Xliff left
12:14
Sgeo_ left,
Sgeo_ joined
12:26
zakharyas left
12:38
sena_kun joined
12:40
isomorphismes joined
12:43
tino left
|
|||
tobs | m: say Array[Int] ~~ Array[Int] | 12:43 | |
camelia | True | ||
tobs | m: say Array[Int] ~~ -> $t { Array[$t] }.(Int) | 12:44 | |
camelia | True | ||
12:46
ChoHag joined
12:47
markoong joined
12:52
lucasb joined
|
|||
sena_kun | m: class A { has Positional["Failure oh-huh"] $.a }; A.new(a => Array[Str].new('a', 'b')); | 13:02 | |
camelia | Type check failed in assignment to $!a; expected Positional[Str] but got Array[Str] (Array[Str].new("a", "b")) in block <unit> at <tmp> line 1 |
||
sena_kun | beware of this ^ | ||
notagoodidea | timotimo: thx for answering on SO (had to go yesterday and forget to say that I will check the log). As I understand the grapheme definition is implicit in grammar ? Do you know if someone is working on implementing :bytes modifiers and so on or on making the grapheme definition explicit? | 13:20 | |
13:38
cjkinni joined
13:44
w17t left
|
|||
moritz | graphemes are defined at the string level, not the grammar level | 13:56 | |
13:57
isomorphismes left
14:06
drbojingle joined
14:09
zacts joined
14:10
zakharyas joined
14:16
hythm_ joined
14:17
cpan-p6_ joined,
b2gills left,
b2gills joined
14:19
vrurg joined
14:21
zacts left
14:23
cpan-p6 left
|
|||
ufobat_ | how much work would it be to make regexes/grammars work on Blobs? | 14:24 | |
how hard could it be.... :p | |||
14:33
SyrupThinker joined
|
|||
hahainternet | i thought they did tbqh | 14:33 | |
oh, blobs, not bufs | |||
hmm | |||
MasterDuke | theres' been a lot of interest in using grammars/regexes for binary data recently | 14:45 | |
14:46
leont joined
|
|||
ufobat_ | MasterDuke, is there something I could read about that? | 14:47 | |
14:58
mowcat left
14:59
zacts joined
|
|||
MasterDuke | ufobat_: about the questions people have had recently? if so, i'd just search the logs of this chanel ( colabti.org/irclogger//irclogger_l...arch/perl6 ) for "binary" or something like that | 15:01 | |
otherwise the synopses (i don't know which one) may have something about what was originally proposed | 15:02 | ||
15:07
skids joined
|
|||
MasterDuke | also, i think the nqp binary reading/writing ops that jnthn recently specced and nine implemented were a prerequisite for anything further | 15:08 | |
15:18
kurahaupo left
|
|||
ufobat_ | ahh :) cool, thanks MasterDuke | 15:18 | |
15:22
kurahaupo joined
15:40
zacts left
15:42
ferreira left
|
|||
Geth | doc: titsuki++ created pull request #2606: Update README.jp |
16:00 | |
doc: 87d343bf58 | titsuki++ | resources/i18n/jp/README.jp.md Update README.jp |
|||
doc: eff189e02c | (Itsuki Toyota)++ (committed using GitHub Web editor) | resources/i18n/jp/README.jp.md Merge pull request #2606 from titsuki/fix-readme-jp Update README.jp |
|||
doc: 60511c1c58 | (Itsuki Toyota)++ (committed using GitHub Web editor) | resources/i18n/jp/README.jp.md Fix typo |
16:01 | ||
16:01
jme` left,
lucasb left
16:12
notagoodidea_ joined,
notagoodidea left
|
|||
notagoodidea_ | hahainternet: Juste catching conversation, what is the difference between Blob and Buf ? | 16:14 | |
ufobat_: It was in Synopse 05 that I found the part about grammars and parsing binary data | 16:15 | ||
16:20
ChoHag left
16:23
jmerelo joined
16:24
ravenousmoose left,
MilkmanDan left
16:27
MilkmanDan joined
16:29
saki left
|
|||
timotimo | blob is read-only, buf is read-write | 16:30 | |
wowza | 16:33 | ||
brendan eich just tweeted "Perl 6 is awesome." | |||
16:33
domidumont left
|
|||
timotimo | potentially sarcastically/ironically, but still | 16:33 | |
cpan-p6_ | New module released to CPAN! Device-Velleman-K8055 (0.0.3) by 03JSTOWE | 16:34 | |
16:34
Kaiepi joined
16:39
vrurg left
|
|||
Kaiepi | forgot to mention it here but i received the prize for my contributions in the last squashathon | 16:39 | |
jmerelo | Kaiepi: great! | 16:40 | |
16:41
MasterDuke left
16:42
MasterDuke joined
16:43
zakharyas left
17:06
kensanata left
|
|||
leont | Yeah I read it ironically | 17:13 | |
Runnng into a weird issue where mi6's tests fail because it can't load JSON::Pretty. | 17:22 | ||
Otherwise mi6 works fine and I do have JSON::Pretty installed | |||
jmerelo | leont: I have asked for clarification. Apparently, it's not a good thing to use Mu as part of the hierarchy. | 17:29 | |
17:30
dakkar left
17:33
robertle joined
17:35
domidumont joined
17:41
cpan-p6_ left,
cpan-p6 joined
|
|||
leont | Anyone have a clue what version of rakudo runs on travis? | 17:53 | |
17:53
molaf joined
17:54
hythm_ left
|
|||
sena_kun | isn't it configurable? or you mean `latest`? | 17:54 | |
17:56
Kaiepi left
|
|||
leont | I found it, it was hidden in de travis output. 2018.10 it seems. | 17:56 | |
17:56
Kaiepi joined
|
|||
Geth | perl6-most-wanted: f17db07d15 | (David Warring)++ (committed using GitHub Web editor) | most-wanted/bindings.md Note second attempt at libxml2 bindings |
18:11 | |
18:11
notagoodidea_ left
|
|||
Geth | doc: 1abf593a1d | (JJ Merelo)++ | doc/Type/Mu.pod6 Adds examples and minor improvements |
18:16 | |
synopsebot | Link: doc.perl6.org/type/Mu | ||
doc: 7fbd0a9001 | (JJ Merelo)++ | 2 files Revises ObjAt and Cool. Closes #2605 |
|||
18:17
ExtraCrispy joined
|
|||
cpan-p6 | New module released to CPAN! gtk-v3 (0.1.0) by 03MARTIMM | 18:20 | |
18:21
molaf left
18:27
patrickb joined,
vrurg joined
18:48
patrickb left
18:53
sno left
19:08
sno joined
19:11
patrickb joined
|
|||
Geth | doc: 90a23717c0 | Coke++ | xt/duplicates.t fix skiplist |
19:13 | |
doc: 48a2782db9 | Coke++ | doc/Language/pod.pod6 skip code snippets that contain POD fragments The fragments are valid, but won't compile as is. |
|||
synopsebot | Link: doc.perl6.org/language/pod | ||
doc: b97ce05798 | Coke++ | doc/Type/CompUnit/Repository/FileSystem.pod6 this method refers to a private method, so stub it now the method can be compiled |
|||
synopsebot | Link: doc.perl6.org/type/CompUnit::Repos...FileSystem | ||
doc: 802b717bc7 | cfa++ | doc/Language/glossary.pod6 Fix broken glossary link. |
19:21 | ||
synopsebot | Link: doc.perl6.org/language/glossary | ||
19:31
sauvin left
19:36
woolfy joined
19:40
molaf joined
|
|||
woolfy | Perl 6 Weekly is delayed, maybe till tomorrow. This morning both lizmat and I woke up with a severe cold after meeting large amounts of people at FOSDEM in Brussels during the weekend. | 19:41 | |
leont | Self care is important :-) | 19:42 | |
tadzik | :( Get well! | ||
ufobat_ | when I have a signature in a role like method foo(Str $a) { .... } and I want to implement this interface | 19:45 | |
there is a difference whether I will implement foo(Str $a is copy) or foo(Str $a) | |||
which i dislike because you add the is copy because of its implementation | 19:46 | ||
because 'is copy' usually just saves you from having another variable inside | |||
Geth | doc: de882160f0 | Coke++ | 3 files Clean up bracket/brace language |
19:51 | |
19:55
cfa joined
|
|||
cfa | o/ | 19:55 | |
still pondering whether this is a trap or not: colabti.org/irclogger/irclogger_lo...1-30#l329. any thoughts? | 19:57 | ||
20:01
ferreira1 joined
|
|||
ufobat_ | cfa, it is suprising to me | 20:02 | |
20:05
domidumont left
|
|||
timotimo | hum. you're using SetHash there which is explicitly "the mutable version of Set" | 20:05 | |
cfa | right | 20:06 | |
the same applies to MixHash and BagHash | |||
timotimo | it's still surprising that you can "just" = into it | ||
cfa | the issue is ro vs. rw | ||
where the ro method (or sub, same applies) means that = is storing | |||
20:06
patrickb left
|
|||
cfa | vs. rw which is re-assigning | 20:06 | |
m: for (BagHash, MixHash, SetHash) -> $h { { .a = <a b>; .b = <a b>; .&dd } given class { has $.a = $h.new; has $.b is rw = $h.new }.new } | |||
camelia | <anon|1>.new(a => ("b"=>1,"a"=>1).BagHash, b => $("a", "b")) <anon|1>.new(a => ("b"=>1,"a"=>1).MixHash, b => $("a", "b")) <anon|1>.new(a => SetHash.new("a","b"), b => $("a", "b")) |
||
timotimo | yeah | 20:07 | |
cfa | i you're checking the log---the subtler version is what bit me originally | ||
because you end up with a nested SetHash vs. a fresh assignment | |||
(nested due to store) | |||
also, arrays don't behave this way which makes things doubly confusing imo | 20:08 | ||
timotimo | m: class { has $.a = Array.new }.new.a = 1, 2, 3 | ||
camelia | ( no output ) | ||
cfa | m: { .a = <c d>; .b = <c d>; .&dd } given class { has @.a = <a b>; has @.b is rw = <a b> }.new; | ||
camelia | <anon|1>.new(a => ["c", "d"], b => ["c", "d"]) | ||
20:09
ferreira1 left
|
|||
timotimo | m: do { .a = 1, 2, 3; .a.say; .perl.say } given class { has $.a = Array.new }.new | 20:09 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unsupported use of do...given; in Perl 6 please use repeat...while or repeat...until at <tmp>:1 ------> 3 given class { has $.a = Array.new }.new7⏏5<EOL> |
||
timotimo | m: { .a = 1, 2, 3; .a.say; .perl.say } given class { has $.a = Array.new }.new | ||
camelia | [1 2 3] <anon|1>.new(a => $[1, 2, 3]) |
||
20:11
pecastro joined
|
|||
cfa | m: { .a = <a b>; .b = <a b>; .&dd } given class { has $.a = Array.new; has $.b is rw = Array.new }.new; | 20:11 | |
camelia | <anon|1>.new(a => $["a", "b"], b => $("a", "b")) | ||
cfa | hmm | ||
well, maybe that's confusing too :) | |||
timotimo | or it's consistent :P | ||
cfa | yeah | ||
but in conclusion: aaaaaaagh | |||
timotimo | m: { .a = 1, 2, 3; .&dd } given class { has @.a } | 20:12 | |
camelia | Cannot look up attributes in a <anon|1> type object in method a at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
20:12
kensanata joined
|
|||
timotimo | m: { .a = 1, 2, 3; .&dd } given class { has @.a }.new | 20:12 | |
camelia | <anon|1>.new(a => [1, 2, 3]) | ||
20:13
ferreira joined
|
|||
ufobat_ | m: { .a = 1, 2, 3; .&dd } given class { has @.a is ro }.new | 20:13 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Can't use unknown trait 'is' -> 'ro' in an attribute declaration. at <tmp>:1 expecting any of: rw readonly box_target leading_docs trailing_docs |
||
ufobat_ | m: { .a = 1, 2, 3; .&dd } given class { has @.a is readonly }.new | ||
camelia | <anon|1>.new(a => [1, 2, 3]) | ||
timotimo | our immutability is only shallow, as is our .clone | 20:16 | |
cfa | the issue with all of this is that assigning to the readonly lvalue is implicitly a store | 20:17 | |
inside of the container | |||
(ahem, feel free to reword that until it's not incorrect :)) | |||
ufobat_ | I think most of the time when I write = I actually think := | 20:18 | |
cfa | like, it's implicitly a store into the existing container rather than an a re-assignment | ||
ufobat_ | and i am not aware of the magic of = | 20:19 | |
cfa | i think STORE stuff is underdocumented | ||
at least, outside of @ | |||
ufobat_ | jmerelo :p | ||
cfa | personally for these *Hash types i would've preferred the = on ro to give an error, requiring use of .push or .append methods | 20:21 | |
but hey | |||
ufobat_ | I feel the same. | 20:22 | |
20:23
zacts joined
|
|||
cfa | tangentially, in golfing this, { ...; .&dd } given class { ... }.new made me happy | 20:24 | |
timotimo | yeah, given is super nice | ||
cfa | so is .&sub | ||
timotimo | yup | ||
.&sub is barely shorter than sub $_ | |||
it's just the space | 20:25 | ||
cfa | so is class { }.new okay i'll stop | ||
ufobat_ | i recently discovered .&sub | ||
:D | |||
cfa | ufobat_: :) | ||
timotimo: yeah, true | |||
timotimo: but i find the flow cleaner | |||
especially here where just have a sequence of transformations on $_ | |||
timotimo | true | ||
cfa | { .a = ...; .b = ...; c $_; } | ||
vs. | |||
{ .a = ...; .b = ...; .&c } | |||
i find the latter lceaner | 20:26 | ||
also, cleaner | |||
ufobat_ | timotimo, its a space plus you need the shift key 2times for the $ and for the _ at least for germany keyboards | ||
timotimo | gist.github.com/timo/44efb53aa1368...d1656c8aa9 - i should finally put this up on the ecosystem | 20:27 | |
jmerelo | ufobat_: hi | 20:45 | |
busy with concurrent stuff, now. | |||
20:56
drbojingle left
|
|||
jmerelo | Just posted this: stackoverflow.com/q/54524245/891440 | 21:00 | |
jnthn | jmerelo: Something looks a tad off with the indentation in the for loop, around the `if` | 21:03 | |
jmerelo | jnthn: right. Copy/pasta before golfing. Will fix. | 21:04 | |
jnthn: could channels leak? | 21:06 | ||
jnthn: the problem is that I'm using that for an experiment, and it comes to a point where it simply hangs, taking several gigabytes of memory. | |||
21:07
cpan-p6 left,
cpan-p6 joined
|
|||
jnthn | jmerelo: Nothing's impossible, but if they were then we'd perhaps notice a leak in every concurrent program, in that the VM-level bit of channels is the same thing that is used for thread pool schedulers | 21:08 | |
cfa | jmerelo: have you profiled? | ||
jnthn | jmerelo: "it seems to be always using the same thread for "processing"" - what is "processing" referring to here? | ||
jmerelo | jnthn: the first one, of which theoretically I'm starting 4 | 21:09 | |
cfa: not really. I'm not sure how to do that. | |||
cfa | you could add `start { sleep 30; exit }` before `await @promises;` | 21:10 | |
then run with --profile to see where you're allocating | |||
ofc if you're only seeing heavy allocation later adjust to suit | 21:11 | ||
jnthn | jmerelo: Sure, though if it actually bottlenecks elsewhere (in the other react) then it may be there just ain't enough stuff in the channel. | ||
cfa | (just suggestion) | ||
jnthn | So one thread is enough | ||
cfa | er, just a* | ||
jmerelo | cfa: I can do that. Thanks. | ||
jnthn | (You aren't really starting threads, just allowing 4 concurrent threads to work on the thing if there's enough work to do) | ||
RAKUDO_SCHEDULER_DEBUG=1 in the environment will tell you how many threads it's really making | 21:12 | ||
jmerelo | jnthn: OK, I'll try that. | ||
I'm going AFK now. Any help will be much appreciated. | 21:13 | ||
Thanks! | |||
21:13
jmerelo left
21:16
chee joined
21:21
mercury^ joined
|
|||
mercury^ | Hi. I was here earlier, but as far as I can see no one has answered my questions in the meantime. | 21:25 | |
jnthn: I was told you might be able to help. Are you around? | |||
timotimo | the question was what was the design decision between type objects being undefined or being used for undefined versions? | 21:26 | |
mercury^ | Yes, I was looking for a rationale for type objects being instances of themselves. | 21:27 | |
Then I was also confused by the following: | |||
timotimo | for one it's nice to be able to call Type.new | 21:28 | |
mercury^ | p6: sub f($t, $x) returns Array[$t] { return $x; }; f(Int, Array[Int](3)); | 21:29 | |
camelia | Type check failed for return value; expected Array[Mu] but got Array[Int] (Array[Int].new(3)) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
mercury^ | timotimo: but you could still call Type.new; you could maybe not call instance.new. | 21:30 | |
timotimo | then we'd also have to have something for static methods | ||
p6: sub f($t, $x --> Array[$t]) { return $x; }; f(Int, Array[Int](3)); | 21:31 | ||
camelia | Type check failed for return value; expected Array[Mu] but got Array[Int] (Array[Int].new(3)) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
timotimo | $t doesn't have a compile-time value, that's probably why that doesn't work | 21:32 | |
mercury^ | Ah, so no dependent types. | ||
timotimo | i think that that doesn't work is a bug | 21:33 | |
p6: sub f(::T $t, $x --> Array[T]) { return $x; }; f(Int, Array[Int](3)); | |||
camelia | Type check failed for return value; expected Array[T] but got Array[Int] (Array[Int].new(3)) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
timotimo | BBL | 21:34 | |
mercury^ | p6: sub f($t, Array[$t] $x) returns Array[$t] { return $x; }; f(Int, Array[Int](3)); | 21:35 | |
camelia | Type check failed in binding to parameter '$x'; expected Array[Mu] but got Array[Int] (Array[Int].new(3)) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
timotimo | fwiw the "returns" annotation is on the way out, or at least fallen out of favor | 21:36 | |
mercury^ | Oh, ok. | ||
jnthn | mercury^: I doubt there was one rationale so much as it fitting neatly with the language design overall. Types being values meant some object had to exist to represent the type. At the same time, it wasn't desirable to confuse a type and its backing meta-object, which has its own distinct type. And making the type be represented as an empty instance gave typed undefined values. Further, it meant `new` and | 21:37 | |
other constructors were simply normal methods, which is an idea going back to Perl 5. | |||
So, the design satisfied quite a few goals at once. | 21:38 | ||
mercury^ | I suspect that what I would call a type is what you call meta-object. | ||
jnthn | It means stuff like `my Foo $x .= new` would also Just Logically Work: a typed variable $x is populated initial with the type object Foo, and then new method is called on that (.) and assigned (=) into the result. | ||
I'd say "type" is a pretty overloaded word used to mean quite a few different things anyway. | 21:40 | ||
I see a meta-object as more saying what a given type means. | |||
21:41
drolax joined
|
|||
mercury^ | I would say that the type determines the structure of its values. | 21:41 | |
jnthn | So Foo represents the type and Foo.HOW is the object that describes how the type Foo works (how does it relate to other types? how does it dispatch methods? how does it represent its state?) | ||
In theory a type could have multiple different representations. In fact, a given meta-object type might be used with multiple different representations. | 21:42 | ||
For example, ClassHOW describes how a class functions, but it might be used with P6opaque (the default), CStruct (O(1) marshalling to C structure layout), etc. | 21:43 | ||
21:43
drolax left,
drolax joined
|
|||
jnthn | How method dispatch works and subtyping relationships are different concerns from how an object is laid out in memory. | 21:43 | |
mercury^ | So, for every type there is a value of type ClassHOW that describes how it "works"? | ||
jnthn | Well, for every type defiend with the `class` keyword, yes. And assuming no module has been imported that changes what `class` means in that scope. :) | 21:44 | |
An `enum` type is backed by EnumHOW, `subset` by SubsetHOW, etc. | 21:45 | ||
Some modules introduce their own kind of type; for example, the Red ORM introduces a `model` keyword backed by its own meta-object. | |||
mercury^ | I find it slightly odd that values of the type are responsible for constructing values of the type, instead of the respective ClassHOW value being responsible for that. | ||
Although I assume that the values of the type delegate to the respective ClassHOW value? | 21:46 | ||
How much of the HOW stuff is part of the language? | 21:48 | ||
jnthn | Well, the resolution of, say, the `new` method delegates to that, yes. | ||
Increasingly much of it; we started out with very little of it specified, and gradually, as things have settled down, covered increasing amounts of it in the language test suite, which is what specifies the language. | |||
21:49
kensanata left
|
|||
mercury^ | So that KnowHOW which is its own HOW will also be part of it eventually? | 21:49 | |
jnthn | I'm not sure about that; I think the `SomePerl6Type.HOW` level we'll specify, but once you're asking .HOW.HOW it's implementation defined. | 21:50 | |
Don't want to box in future implementations too much, and there's probably little practical reason to be digging that deep. | 21:51 | ||
Don't really want to box in current implementations too much either. :) | |||
mercury^ | Well, the advantage of X.HOW ≡ X being part of the language would be that one can dig as deep as one likes. :D | 21:52 | |
jnthn | Yes, I find that it bottoms out somewhere like that pleasing. | 21:53 | |
21:54
robertle left
|
|||
mercury^ | jnthn: do you know what is going on with the errors in my attempt to see if the language has dependent types? | 21:54 | |
jnthn | mercury^: Traits are applied at compile-time, but parameters are passed at runtime, and it's not (yet? :)) smart enough to know to perhaps leave the thing generic and instantiate it at runtime. | 21:55 | |
afk for a bit | 21:58 | ||
mercury^ | p6: sub t($b) { return b ?? Int !! Cool; }; sub f($b, t($b) $x --> t($b)) { return $x; }; f(True, 3); | 21:59 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Expected a term, but found either infix ?? or redundant prefix ? (to suppress this message, please use a space like ? ?) at <tmp>:1 ------> 3sub t($b) { return b ??7⏏5 Int !! Cool; }; sub f… |
||
mercury^ | p6: sub t($b) { b ?? Int !! Cool; }; sub f($b, t($b) $x --> t($b)) { return $x; }; f(True, 3); | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Expected a term, but found either infix ?? or redundant prefix ? (to suppress this message, please use a space like ? ?) at <tmp>:1 ------> 3sub t($b) { b ??7⏏5 Int !! Cool; }; sub f($b, t(… |
||
mercury^ | Huh, I thought the conditional expression was written like that? | ||
Kaiepi | m: use NativeCall; class Foo is repr('CStruct') { my Str constant LIB = './foo'.IO.absolute; sub foo_init(Pointer[::?CLASS] is rw --> int32) is native(LIB) {*} } | 22:00 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> An exception occurred while parameterizing Pointer at <tmp>:1 Exception details: Cannot resolve caller ACCEPTS(Bool:U: Foo); none of these signatures match: (Bool:D: Mu \topic, *%_) … |
||
Kaiepi | is there a workaround for this? | ||
mercury^ | Oh, I forgot the sigil. | ||
p6: sub t($b) { $b ?? Int !! Cool; }; sub f($b, t($b) $x --> t($b)) { return $x; }; f(True, 3); | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Invalid typename 't' in parameter declaration. at <tmp>:1 ------> 3($b) { $b ?? Int !! Cool; }; sub f($b, t7⏏5($b) $x --> t($b)) { return $x; }; f(Tru |
||
mercury^ | p6: sub t($b) { $b ?? Int !! Cool; }; sub f($b, &t($b) $x --> t($b)) { return $x; }; f(True, 3); | 22:01 | |
camelia | 5===SORRY!5=== Shape declaration with () is reserved; please use whitespace if you meant a subsignature for unpacking, or use the :() form if you meant to add signature info to the function's type at <tmp>:1 ------> 3$b) { $b ?? Int… |
||
mercury^ | p6: sub t($b) { $b ?? Int !! Cool; }; sub f($b, :t($b) $x --> t($b)) { return $x; }; f(True, 3); | 22:02 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Redeclaration of symbol '$b' at <tmp>:1 ------> 3 { $b ?? Int !! Cool; }; sub f($b, :t($b7⏏5) $x --> t($b)) { return $x; }; f(True, expecting any of: shape declaration |
||
mercury^ | Sorry for the spam. :( | 22:03 | |
22:03
dvdl joined
22:04
drolax left
|
|||
TreyHarris | Oh--a discussion on a perl6/doc issue (github.com/perl6/doc/issues/1185) reminded me that I created a `perl6-contrib` organization to save the name in case it became useful at some point, but I just realized I never told anyone about it for some reason, even though I set it up complete with a free-sketched Camelia as an avatar picture. (I assume I got interrupted and never came back to it.) But in case | 22:06 | |
anyone ever has a use for it, it's at github.com/perl6-contrib -- just let me know and I'll give access | |||
22:07
[particle]1 joined
22:09
[particle] left
22:13
skids left
22:17
[particle]1 is now known as [particle]
22:19
ChoHag joined
22:34
ChoHag left
22:43
hythm_ joined
22:44
dvdl left
|
|||
hythm_ | p6: role R {}; my @a does R; my @b = @a; say @a.WHAT; say @b.WHAT; | 22:51 | |
camelia | (Array+{R}) (Array) |
||
hythm_ | how to get a copy of @a (not binding)? | 22:53 | |
22:53
eseyman left
|
|||
hythm_ | so i can modify @a and @b separately | 22:54 | |
22:56
notagoodidea joined
22:57
zacts left
22:58
eseyman joined
|
|||
cfa | timotimo: re: your mutator tunnel operator, i think that's often referre to as method cascading | 22:58 | |
though i guess you take an arbitrary function | 23:00 | ||
timotimo | how does it look in other languages? | 23:03 | |
23:06
mercury^ left,
sena_kun left
23:08
hythm_ left
|
|||
timotimo | so dart has .. for that, interesting | 23:11 | |
23:16
rindolf left
|
|||
Kaiepi | how else can i manage errors when initializing a struct besides passing a double pointer to the struct to the init function and returning the error number? i can't do it that way because of github.com/rakudo/rakudo/issues/2673 | 23:22 | |
i tried passing a void pointer instead and casting it to Pointer[::?CLASS] but that throws the same error | |||
cfa | timotimo: yeah, the .. is quite nice (as is smalltalk's ;) | 23:26 | |
23:27
rindolf joined
|
|||
Kaiepi | m: role R {}; my @a does R; my @b = @a.clone; say @a.WHAT; say @b.WHAT | 23:28 | |
camelia | (Array+{R}) (Array) |
||
23:40
hythm_ joined
|
|||
hythm_ | p6: role R {}; my @a does R; my $b = @a; say @a.WHAT; say $b.WHAT; | 23:42 | |
camelia | (Array+{R}) (Array+{R}) |
||
hythm_ | p6: role R {}; my @a does R; my $b = @a; my @b = $b; say @b.WHAT; | 23:43 | |
camelia | (Array) | ||
23:45
aborazmeh joined,
aborazmeh left,
aborazmeh joined
23:47
cpan-p6_ joined
|
|||
hythm_ | so i can't copy @ or % as is? only $ works. | 23:49 | |
23:50
pecastro left
|
|||
AlexDaniel | weekly: Wanted: New release manager. As AlexDaniel temporarily won't have enough time in the upcoming months, a new release manager is needed. If you have time and passion for Perl 6, please let us know. A glimse of the responsibilities is here: github.com/rakudo/rakudo/blob/mast..._guide.pod | 23:52 | |
notable6 | AlexDaniel, Noted! | ||
23:53
kurahaupo_ joined
23:54
kurahaupo_ left,
kurahaupo_ joined
23:55
kurahaupo left,
kurahaupo joined,
kurahaupo_ left,
silug left
|
|||
cfa | m: role Cascading { method cascade (&code) { code(self); self } }; ("foobarbaz".comb.Array but Cascading).cascade(*.splice(3,1,"X")).join.say | 23:57 | |
camelia | fooXarbaz | ||
23:57
kurahaupo left
|
|||
cfa | enh | 23:57 |