»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by moritz on 25 December 2014. |
|||
00:21
brrt left
00:27
skids joined
00:41
virtualsue left
|
|||
masak | 'night, #perl6 | 00:42 | |
00:43
virtualsue joined
|
|||
japhb | o/ | 01:01 | |
01:08
dj_goku left
01:13
dj_goku joined,
dj_goku left,
dj_goku joined
|
|||
adu | \o | 01:14 | |
or is it "o/" I'm not sure anymore | |||
parametric extensions, I have to remember that | 01:15 | ||
IMHO, I would have called 6pe "Perl6 Generics" | 01:16 | ||
01:23
japhb left
01:24
virtualsue left,
japhb joined
|
|||
japhb | He is in fact extending the 6model API with parameterization, so that name is apropos. | 01:24 | |
dalek | kudo-star-daily: 173b35c | coke++ | log/ (9 files): today (automated commit) |
01:35 | |
[Coke] is finally done with work and exercise and dinner, and hopes he can get the release out before the day ends locally. :) | 01:36 | ||
skids | ++ to whoever made all three Order enums 4 characters long. Little touches like that make code fun. | 01:46 | |
01:50
vendethiel left
|
|||
b2gills | gtodd: I couldn't help myself, I added a comment to that SO question | 01:52 | |
[Coke] | m: Order.perl.say | 02:00 | |
camelia | rakudo-moar 98db03: OUTPUT«Order» | ||
[Coke] | m: Order.keys.say | ||
camelia | rakudo-moar 98db03: OUTPUT«» | ||
raydiak | m: Order::.keys.say | 02:06 | |
camelia | rakudo-moar 98db03: OUTPUT«Less Same More» | ||
TimToady | skids: yeah, well, it also bothers me that Complex isn't Cpx or some such :) | 02:08 | |
adu | japhb: parameterized by types? or arbitrary parameterization? | 02:09 | |
skids: yeah | 02:10 | ||
raydiak: hi | |||
raydiak | hi there adu | ||
adu | raydiak: I got really close to making a new AST | ||
but I forgot to git push | |||
raydiak | heh well it's still somewhere, right? | 02:11 | |
adu | ok merged | 02:12 | |
[Coke] | bah. we know there's a leap second this year, but the site we pull from isn't updated yet. | 02:13 | |
adu | raydiak: all of the unit tests passed, so I think I did good | ||
raydiak | adu: nice, I'll try to check it out later tonight...did you sort out your syntactic vs semantic conundrums? | 02:14 | |
02:14
vendethiel joined
|
|||
adu | raydiak: yes, I made something called TypeOp.new() that is generic enough to represent both | 02:15 | |
TypeOp is kind of a misnomer, since it represents types and declarations | |||
TimToady | b2gills: actually you've got some superstitious parens in there | 02:16 | |
dalek | kudo/nom: ad1dc19 | coke++ | docs/ (2 files): First pass at 2015.01 releasework. |
02:21 | |
raydiak | adu: I see...awesome, looks like a good solution to me | 02:22 | |
adu | raydiak: I think I can use the same AST for C++ | 02:23 | |
raydiak | adu: did you know you have tabs on a couple lines in lib/C/AST.pm6 ? (and those lines miss trailing semicolons too, if you're worried about those) | ||
b2gills | TimToady: It's all of the switching back an forth between Perl 5 and 6 I've been doing | ||
adu | raydiak: I am very pedantic about formatting, but I just don't have the time to worry about that | 02:24 | |
dalek | p: 739d3d7 | coke++ | VERSION: bump VERSION to 2015.01 |
||
adu | I also have Rust projects, oh, and my job | ||
[Coke] | I changed the release announcement to have real quotes. | 02:25 | |
japhb | "real quotes"? | ||
[Coke] | no, “real quotes” | 02:26 | |
skids | m: my @s; @s = 0..Inf; for @s { .say; exit if $_ > 4 } | 02:27 | |
camelia | rakudo-moar 98db03: OUTPUT«012345» | ||
skids | m: my @s; @s <== 0..Inf; for @s { .say; exit if $_ > 4 } | ||
camelia | ( no output ) | ||
adu | raydiak: fixed | ||
dalek | kudo/nom: 48083f5 | coke++ | docs/release_guide.pod: whoops, fix release name. |
||
02:30
regreg left
|
|||
raydiak | adu: method direct-abstract-declarator in lib/C/Parser/Actions.pm6 is giving me "Could not find symbol '&Var'" | 02:33 | |
afk | 02:34 | ||
adu | I think I did s/Var/Name/ | 02:36 | |
sorry about that | |||
raydiak: fixed, kind of | 02:38 | ||
japhb | [Coke]: I thought someone did a CL way back to convert the quotes the other direction. Perhaps I am mistaken ... | 02:43 | |
[Coke] | I will not be offended if someone does it again, but I suspect we'll just be lazy and keep copying them. | 02:51 | |
02:53
chenryn joined
|
|||
jercos | m: "whatever".reverse | 02:58 | |
camelia | ( no output ) | ||
jercos | m: say "whatever".reverse | ||
camelia | rakudo-moar 98db03: OUTPUT«whatever» | ||
jercos | some things never change :p | ||
(.comb.reverse.join works fine, but lol) | |||
02:58
vendethiel left
|
|||
[Coke] | tag only pushes not reported by dalek? | 03:00 | |
japhb | m: say "whatever".flip | 03:06 | |
camelia | rakudo-moar 98db03: OUTPUT«revetahw» | ||
japhb | jercos: Is that ^^ what you wanted? | 03:07 | |
dalek | kudo/nom: 91aeeb7 | coke++ | tools/build/NQP_REVISION: [release] bump NQP revision |
03:11 | |
kudo/nom: eabaa68 | coke++ | VERSION: [release] bump VERSION |
|||
[Coke] | oh, right, it takes 10 hours to build a release! | 03:21 | |
moritz++ for providing a build box. | 03:25 | ||
03:26
japhb left
03:27
japhb joined
|
|||
[Coke] | one or two roast failure, no problema | 03:42 | |
03:47
vendethiel joined
03:52
noganex joined
03:56
noganex_ left
|
|||
[Coke] | AAAAAAAAAAAAAAAAGH | 04:00 | |
lost connection to hack during the LONGEST running step here. | |||
04:08
vendethiel left
04:14
anaeem1 joined
04:15
anaeem1 left,
anaeem1_ joined
04:19
[Tux] left
04:21
kaleem joined
|
|||
japhb | [Coke]: Not in a screen or tmux session, I take it? | 04:25 | |
04:27
[Tux] joined
|
|||
dalek | kudo/nom: bac0b62 | coke++ | docs/announce/2015.01.md: Pull in actual items from Changelog |
04:28 | |
raydiak | adu: now I get "Default constructor for 'Name' only takes named arguments", with the "abstract?!?" being passed in and all :) | 04:33 | |
adu | damnit | 04:35 | |
I need to rethink the abstract versions of the direct declarators | |||
raydiak | I see...I assume for now it would do whatever you were trying to just by passing it as :name<abstract?!?> instead? | 04:37 | |
adu | insert name => and it should work | 04:40 | |
but I'm not sure if I want to refactor the grammar, or refactor the actions, I would like to combine the direct and abstract versions if possible | 04:41 | ||
but I'm just now sure how yet | |||
raydiak | should I just put some of the failing lines I run into in a gist for you to check out at your leisure? | 04:49 | |
also, did you say __attribute__ should work now, or am I remembering something different? haven't tried it recently | 04:50 | ||
afk dinner | |||
adu | sure | 04:52 | |
my email is andjrob(AT)gmail.com | |||
skids | m: < foo < 1 >.perl.say # not sure whether this is intended behavior | 04:55 | |
camelia | rakudo-moar eabaa6: OUTPUT«===SORRY!=== Error while compiling /tmp/XhT4OF25o2Unable to parse expression in quote words; couldn't find final '>' at /tmp/XhT4OF25o2:1------> t sure whether this is intended behavior⏏<EOL> …» | ||
[Coke] | we don't have any releases claimed for the rest of the year. | 05:05 | |
05:07
vendethiel joined
|
|||
dalek | kudo/nom: 53c80a1 | coke++ | docs/release_guide.pod: Claim another release. |
05:08 | |
05:10
BenGoldberg left
05:19
kaleem left
|
|||
dalek | kudo/nom: cd87c47 | coke++ | docs/announce/2015.01.md: Fix date in announcement. |
05:29 | |
[Coke] | so: the announcement file in the repo as of the tag has the wrong date in the text of the announcement; Since I've already pushed the tags and this is a minor issue, I'm not going to re-push the tags. | 05:30 | |
the email will have the correct date. | |||
Release done. | 05:31 | ||
Thanks to everyone who did the actual work of improving perl 6 this month. | |||
jdv79 | [Coke]: i forget if i asked already - why the brackets on your nick? | ||
TimToady | [Coke]++ | 05:33 | |
05:34
muraiki_ left
|
|||
jdv79 | yes of course; [Coke]++ # as always | 05:35 | |
[Coke] | jdv79: because Coke was already taken | 05:47 | |
at the time I started using freenode, it was the common way to get a slightly different nick. | |||
05:49
telex left,
ggoebel111111119 joined
05:50
vendethiel left,
telex joined,
ggoebel111111118 left
06:03
gtodd1 joined
06:04
gtodd left
|
|||
b2gills | m: role Val { has Str $.Str }; sub val ($s) { $s.Numeric but Val($s) }; my $a = val('5e0'); say $a; say $a ~~ Num # fake NumStr | 06:06 | |
camelia | rakudo-moar 53c80a: OUTPUT«5e0True» | ||
06:18
agentzh joined
|
|||
agentzh | hi, i'm trying out rakudo today and i'm wondering if it supports automatic error message generation when my grammar parrser fails to parse the user input :) | 06:19 | |
i've noticed that Rakudo itself is using "{ $/.CURSOR.panic(...) }" to generate parse fail messages but it does not work with the Perl 6 code input it seems. | 06:22 | ||
according to S05, i'm supposed to use "$¢" instead but rakudo apparently dislikes it. | |||
S05 seems to talk about the automatic error messages generated by the lexer and the :dba() mechanism but I'm not sure how to fetch such error messages. are they going to "$!"? | 06:26 | ||
sorry if i've missed anything obvious :) | 06:27 | ||
moritz | yes, they are thrown as exceptions | 06:28 | |
agentzh | moritz: is it something already implemented in rakudo? | 06:30 | |
moritz | agentzh: :dba isn't, ~ throwing exceptions is | 06:31 | |
agentzh | i'm playing bad inputs to interpreters/RPN.pl in perl6-examples and get no error messages. | ||
(but the default "This is not an RPN expression") | 06:33 | ||
okay, so the automatic exceptions are only generated for the '~' operator? | 06:37 | ||
is it possible to do something like this? search.cpan.org/~dconway/Regexp-Gra...en_parsing | 06:38 | ||
06:40
rurban joined
06:42
bjz joined
06:47
bjz left
|
|||
PerlJam | agentzh: I'm not sure which specific part you mean by "this" but the answer is bound to be "yes" :) | 06:49 | |
agentzh | PerlJam: basically i'm wondering how to provide friendly error messages with position details when the user supplies something bad into my parser implemented in Perl 6. | 06:50 | |
ideally rakudo can generate automatic error messages similar to P::RD and P::G's <error> notation. | |||
06:51
kurahaupo1 left
|
|||
agentzh | PerlJam: failing that, i hope i can use my own subroutines to generate such messages with "$¢" | 06:51 | |
or something like that. | |||
because i need the current position where the parse fails. | |||
position in the input string. | 06:52 | ||
but it seems that Rakudo hates "$¢". | 06:53 | ||
using the latest git master of rakudo from github :) | |||
TimToady | because for a while the parser ran much slower with Unicode, I suspect | ||
06:53
kurahaupo joined
|
|||
TimToady | we could probably switch to $¢ one of these days | 06:54 | |
but $/.CURSOR is still the cursor that contains the positional information | |||
agentzh | TimToady: $/.CURSOR is the NQP only thing? | ||
s/the/an/ | 06:55 | ||
TimToady | m: grammar Foo { token TOP { ... { say $/.CURSOR.from } } }; Foo.parse("abc") | ||
camelia | rakudo-moar cd87c4: OUTPUT«0» | ||
TimToady | m: grammar Foo { token TOP { ... { say $/.CURSOR.to } } }; Foo.parse("abc") | ||
camelia | rakudo-moar cd87c4: OUTPUT«No such method 'to' for invocant of type 'Foo' in regex TOP at /tmp/_r9lkTS9uQ:1 in method parse at src/gen/m-CORE.setting:14583 in block <unit> at /tmp/_r9lkTS9uQ:1» | ||
TimToady | anyway, .CURSOR is available in user code too | 06:56 | |
at least in rakudo, for now | |||
agentzh | interesting | ||
thanks for your help :) | 06:57 | ||
TimToady | m: grammar Foo { token TOP { ... { say $/.from } } }; Foo.parse("abc") | ||
camelia | rakudo-moar cd87c4: OUTPUT«0» | ||
TimToady | m: grammar Foo { token TOP { ... { say $/.to } } }; Foo.parse("abc") | ||
camelia | rakudo-moar cd87c4: OUTPUT«3» | ||
TimToady | and positional info is in $/ as well | ||
m: grammar Foo { token TOP { ... { say $/.orig } } }; Foo.parse("abc") | |||
camelia | rakudo-moar cd87c4: OUTPUT«abc» | ||
agentzh | cool | 06:58 | |
06:58
Rounin joined
|
|||
agentzh | does "..." mean matching anything? | 07:00 | |
PerlJam | any 3 chars :) | 07:01 | |
agentzh | oops, silly me :) | ||
PerlJam: thanks for the hint :) | 07:02 | ||
thought it was some special operator as a whole. | |||
TimToady | in normal code it would indicate a stub | 07:06 | |
m: sub foo { ... }; foo; | 07:07 | ||
camelia | rakudo-moar cd87c4: OUTPUT«Unhandled exception: Stub code executed at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295) from src/gen/m-CORE.setting:14148 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.…» | ||
agentzh | yep, i was aware of the yada yada operator in that context :) | ||
that's why it caught my eyeballs :) | |||
TimToady | sorry I was so misleading :) | ||
agentzh | that's completely fine :) | ||
it's the fun to ponder various fun operators in perl :) | 07:08 | ||
i'm trying to construct some nontrivial compilers in perl 6 or NQP. | |||
NQP looks ugly though it seems much faster. | |||
TimToady | the gap should narrow as our optimizers get better | 07:09 | |
agentzh | great | ||
i've been away from the perl 6 world for several years already. need to reread the synopses :) | 07:10 | ||
TimToady | indeed, welcome back | ||
agentzh | thanks :) | ||
TimToady | we're fine with people coming and going as they please :) | 07:11 | |
agentzh | i've been deep into nginx and luajit in the last few years. | ||
TimToady | well, we're currently using luajit, or at least bits of it | ||
agentzh | but when coming to compiler construction, i really want to use perl and especially perl 6 :) | ||
oh really? which bits? | |||
TimToady | uh, you'd have to ask over on #moarvm to get a sensible answer :) | 07:12 | |
agentzh | okay, got it :) | ||
TimToady | though scanning #moarvm logs for luajit would probably be informative | ||
agentzh | i have had the dream to build a perl 6 compiler using similar approaches in luajit. | ||
but maybe just a core subset of it, like NQP. | |||
TimToady | it seems to work okay, though doesn't really produce optimal code yet | 07:13 | |
bit of an impedance mismatch between lua's worldview and Perl's... | |||
agentzh | yeah sure. | ||
luajit's vm is specific to lua's semantics. | |||
from ground up. | |||
my $work requires speed so i had to switch from perl to luajit for online logic. | 07:14 | ||
TimToady | anyway, brrt and jnthn are probably the people who know most about the jit, and timotimo | ||
agentzh | thanks for the info, thanks :) | ||
TimToady | (brrt++ did the jit last year for GSoC) | 07:15 | |
agentzh | TimToady: I directly listened to your talk at YAPC::NA 2013 for the first time btw :) | ||
TimToady | oh, well, that one was kinda pathetic :) | ||
agentzh | TimToady: i enjoyed it :) | 07:16 | |
TimToady | oh, wait, 2013 | ||
I was thinking of 201 | |||
2014 | |||
agentzh | i missed 2014 :) | ||
TimToady | I probably should've :) | ||
agentzh | but i'll try to find my way to 2015 :) | ||
TimToady | \o/ | ||
Salt Lake this year | 07:17 | ||
agentzh | yep | ||
not far from my place. | |||
TimToady | where are you? | ||
agentzh | i moved to the bay area in 2012 :) | ||
with my wife. | |||
TimToady | ah, well, I'm just down in Mountain View | ||
agentzh | got tired of Beijing :) | ||
wow, very near. | |||
TimToady | we finally got to Beijing last year | ||
agentzh | i live in Millbrae. | ||
oh really? | 07:18 | ||
TimToady | food was wonderful | ||
agentzh | heh | ||
yep i miss the food there too :) | |||
TimToady: just out of curiosity, are you still coding in C these days? ;) | 07:19 | ||
TimToady | occasionally, but not often | ||
agentzh | i see :) | ||
TimToady | worked on the NFA engine some lately | 07:20 | |
agentzh | wow | ||
i was working on an NFA-based regex engine two years ago: github.com/openresty/sregex | |||
the goal is to support streaming parsing like in an nginx output filter. | 07:21 | ||
but it is sloooow | |||
meant to optimize it at some point. | |||
TimToady | yeah, we'd like ours to run faster too... | ||
agentzh | :) | ||
TimToady | though it's really only about 10% of the parser overhead currently | 07:22 | |
agentzh | for rakudo? | ||
TimToady | nod | ||
agentzh | got it. | ||
for my use case, it can be 90% :) | |||
TimToady | 'course we're parsing a fairly complicated languge | ||
agentzh | indeed. | ||
TimToady | the regex are all integrated in p6, so it could well be 90% for some tasks | 07:23 | |
agentzh | i'm really glad to see rakudo is much faster than a few years ago :) | ||
yes, sure. | |||
TimToady | those are the ones it might be worthwhile to do a DFA for | ||
agentzh | yeah | ||
do you think it's possible to do submatch capturing with a DFA without going backward in the input stream? | 07:24 | ||
TimToady | for P6 lexing it probably only makes sense to cache the first set of NFA states, since the possibilities drop rapidly after the first char is recognized | ||
oh, yes, it's certainly possible | |||
agentzh | wow. | ||
TimToady | but there's a price, of course | ||
agentzh | the re2 author has to reverse the regex and match backward in the input string to get the *beginning* pos of each submatch captures AFAIK. | 07:25 | |
TimToady | if you look up "tagged dfa" you should find TRE | ||
which is a tagged dfa implementation | |||
agentzh | okay, so TRE is the way to go? | ||
TimToady | not exactly | ||
agentzh | cool, i'll have a closer look at it. | ||
i was just aware of its existence :) | 07:26 | ||
TimToady | when I tried it in the early days of prototyping STD, I found it allocated 17MB on the stack for every token | ||
agentzh | ouch! | ||
TimToady | which doesn't really work out | ||
so it's a bit of a toy in my mind | |||
agentzh | yes, i have some vague impression of that while reading the perl 6 meetup notes. | ||
TimToady | not really suited for very wide alternations | ||
and token recognition is nothing if not wide | |||
agentzh | indeed. | 07:27 | |
TimToady | regex always find some way to reach out and bite you :) | 07:28 | |
agentzh | for my use case, i just hope to support a good subset of perl 5 regexes and can make the regex engine yield at any point in the input stream and resume later without going back. | ||
so that we can filter out data by chunks. | 07:29 | ||
one chunk at a time and never buffer anything more than needed. | |||
TimToady: yes, i already got the pain while building sregex. | |||
TimToady | well, at least we support p5 regexen already in p6, for the most part | ||
agentzh | TimToady: yep. | 07:30 | |
TimToady: my toy was built for the nginx world :) | |||
TimToady | and we do concurrency now too, so one could run the parser in a different thread and not worry about continuations too much | ||
agentzh | TimToady: the state of art is to use ragel to generate nginx C modules to do the response body processing. | ||
TimToady: but ragel is much more painful than perl regexes :) | |||
TimToady: is the "thread" OS-like threads or just lightweight threads like coroutines? | 07:31 | ||
07:31
rindolf joined
|
|||
TimToady | yeah, I keep seeing references to nginx, but haven't had any direct exposure | 07:31 | |
it's more like Go's promises and channels, with green threads over a built-in scheduler that maps to worker threads | 07:32 | ||
kinda the best of both worlds | |||
agentzh | i see. so it's collaborative? | ||
TimToady | yes, but fairly transparently | 07:33 | |
agentzh | cool | ||
i built a coroutine scheduler for lua in the nginx event model :) | |||
it's still single threaded though. | 07:34 | ||
TimToady | there's also a whole reactive programming system, called 'supplies' | ||
agentzh | never want the pain dealing with multiple threads :) | ||
url? | 07:35 | ||
leedo | ls | ||
whoops | |||
TimToady | design.perl6.org/S17.html | ||
agentzh | cool thanks :) | 07:36 | |
having to do all the synopsis recap :) | |||
TimToady: nice to talk to you! gotta get some sleep. G'night! | 07:37 | ||
TimToady | night! | ||
07:38
vendethiel joined
07:42
FROGGS joined,
agentzh left
07:43
virtualsue joined
07:44
rindolf left
07:46
bjz joined,
fhelmberger joined,
kaare_ left
07:47
bjz left
07:49
kaare_ joined
07:54
abraxxa joined
07:55
bjz joined
07:56
xfix joined
|
|||
moritz | [Coke]++ # release | 07:59 | |
08:05
prime left
08:10
darutoko joined
|
|||
dalek | pan style="color: #395be5">perl6-examples: 05669d7 | (Yichun Zhang (agentzh))++ | interpreters/RPN.pl: improvements and fixes in RPN.pl * use .list to fix "for" iteration over an array reference. * properly handle the case when no input string argument is specified. * suppress the "Useless declaration of a has-scoped method" warnings from the latest rakudo. |
08:11 | |
pan style="color: #395be5">perl6-examples: 9cea16f | FROGGS++ | interpreters/RPN.pl: Merge pull request #17 from agentzh/RPN-fixes improvements and fixes in RPN.pl |
|||
08:12
jmark joined
08:14
prime joined
08:22
zakharyas joined,
vendethiel left
08:33
xinming left
08:34
xinming joined
08:45
fhelmberger_ joined,
mr-foobar left
08:46
vendethiel joined,
rurban1 joined
08:47
fhelmberger left
08:55
chenryn left
09:02
kaleem joined
09:08
vendethiel left
09:13
virtualsue_ joined
09:14
virtualsue left,
virtualsue_ is now known as virtualsue
09:20
vendethiel joined
09:21
xfix left
09:23
virtualsue_ joined,
virtualsue left,
virtualsue_ is now known as virtualsue
09:24
Kristien joined
09:29
molaf__ joined
09:30
fhelmberger_ left,
kjs__ joined
|
|||
jnthn | morning, #perl6 | 09:30 | |
Kristien | hola | ||
jnthn | [Coke]++ # 2015.01 release | ||
nwc10 | good *, jnthn | 09:31 | |
09:32
molaf_ left
09:34
pecastro joined,
Sir_Ragnarok joined
|
|||
lizmat | [Coke]++ # 2015.01 release and everything else! | 09:41 | |
09:42
vendethiel left
|
|||
Kristien | do Perl 6' text I/O APIs always assume UTF-8 by default? | 09:48 | |
09:48
vendethiel joined
|
|||
FROGGS | Kristien: aye | 09:49 | |
moritz | Kristien: the specs say that they should do some limited form of encoding autodetection that detects UTF-{16,32}, and falls back to UTF-8 | 09:50 | |
Kristien: rakudo doesn't do that, and always assumes UTF-8 | |||
Kristien | OK | ||
So it doesn't look at the system locale, which is good. | 09:51 | ||
09:55
denis_boyun_ joined
|
|||
Kristien | m: say (.codes, .chars) given "a\x030A" | 09:59 | |
camelia | rakudo-moar cd87c4: OUTPUT«2 2» | ||
Kristien | interesting | ||
I expected 2 1, since U+030A is a combining-character. | |||
moritz | grapheme level is not yet implemented | 10:00 | |
arnsholt | That's graphemes, not characters | ||
Kristien | oh ok | 10:01 | |
10:03
virtualsue left
|
|||
FROGGS | arnsholt: well, .chars will be about graphemes one day | 10:03 | |
10:03
fhelmberger joined
|
|||
arnsholt | Ah. I thought that was .graphs =) | 10:05 | |
10:07
fhelmberger left
10:08
fhelmberger joined
|
|||
Kristien | can arguments default to $_? | 10:10 | |
10:11
rindolf joined,
vendethiel left
|
|||
jnthn | Not easily; we don't really do "takes $_ by default" in Perl 6. Those situations tend to be handled by the .foo or .=foo syntax | 10:14 | |
lizmat | m: sub a($a = CALLER::<$_>) { say $a }; $_ = "foo"; a # doesn't work :-( | ||
camelia | rakudo-moar cd87c4: OUTPUT«Nil» | ||
FROGGS | m: sub foo ($a = OUTER::DYNAMIC::<$_>) { say $a; say OUTER::DYNAMIC::<$_> }; $_ = 42; foo() # wonders why | ||
camelia | rakudo-moar cd87c4: OUTPUT«Nil42» | ||
FROGGS | err | ||
m: sub foo ($a = CALLER::DYNAMIC::<$_>) { say $a; say CALLER::DYNAMIC::<$_> }; $_ = 42; foo() | 10:15 | ||
camelia | rakudo-moar cd87c4: OUTPUT«Nil42» | ||
jnthn | m: given [1..10] { .=grep * %% 2; .=map 'a' x *; .say } | ||
camelia | rakudo-moar cd87c4: OUTPUT«===SORRY!=== Error while compiling /tmp/R_MD_K6055Two terms in a rowat /tmp/R_MD_K6055:1------> given [1..10] { .=grep * %% ⏏2; .=map 'a' x *; .say } expecting any of: infix stopper …» | ||
jnthn | m: given [1..10] { .=grep: * %% 2; .=map: 'a' x *; .say } | ||
camelia | rakudo-moar cd87c4: OUTPUT«aa aaaa aaaaaa aaaaaaaa aaaaaaaaaa» | ||
Kristien | jnthn nic | ||
nice* | |||
10:15
rurban1 left
|
|||
FROGGS .oO( jnicethn? ) | 10:15 | ||
jnthn | lizmat: Probably 'cus the thunking of the default gets in the way. | 10:16 | |
lizmat | ah, more levels you mean ? | ||
jnthn | Yeah | ||
And here's a nice bug: | 10:17 | ||
lizmat | m: sub a($a = CALLER::CALLER::<$_>) { say $a }; $_ = "foo"; a # indeed | ||
camelia | rakudo-moar cd87c4: OUTPUT«foo» | ||
jnthn | m: sub foo($a = CALLER::CALLER::<$_>) { say $a }; given 42 { foo(1); foo() } | ||
camelia | rakudo-moar cd87c4: OUTPUT«1No such method 'dynamic' for invocant of type 'Int' in method at_key at src/gen/m-CORE.setting:11131 in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:3090 in sub foo at /tmp/MgALuGqWgZ:1 in block <unit> at /tmp/MgALuGqWgZ:1» | ||
lizmat | hehe | 10:18 | |
rakudobuggable ? | |||
jnthn | Yeah | ||
lizmat | done: #123660 | 10:22 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123660 | ||
jnthn | Thanks | 10:23 | |
dalek | kudo/nom: 2b2de11 | lizmat++ | docs/release_guide.pod: Claim February's release |
10:32 | |
kudo/nom: a05dc90 | lizmat++ | src/core/ (2 files): Make EnumMap a first class citizen, skids++ This reverts commit a8e384cfa1d1d5414d367416a7aca227a5729739. |
10:33 | ||
10:41
virtualsue joined
|
|||
jnthn | lizmat: If you've chance, you may also try a build/test run on OSX with MoarVM master; I bumped the default optimization level yesterday. | 10:46 | |
lizmat | will do | ||
jnthn | lizmat: Tested it with gcc and clang, though only on Linux. | ||
10:46
vendethiel joined
|
|||
jnthn | lizmat: Hopefully clang on OSX is equally fine | 10:46 | |
lizmat: I guess you build with defaults, so this might also get you a time saving on builds/spectests :) | |||
lizmat | yeah, let's see :-) | 10:47 | |
jnthn | Measuring the GCC build with callgrind showed 10% less instructions at Rakudo startup, for example. | ||
lizmat | building now | ||
10:48
andreoss joined
|
|||
andreoss | m: my $n = 2; $n = ( 2 * $n ) % 10_000_000_000 for 1 .. 7830456; say $n; | 10:49 | |
lizmat | jnthn: definitely not warning free | ||
camelia | rakudo-moar cd87c4: OUTPUT«(timeout)» | 10:50 | |
jnthn | lizmat: Oh? | ||
lizmat: What warnings? | |||
andreoss | with native int $n it's even slower | ||
why? | |||
lizmat | jnthn: a *lot* in unicode.c | ||
jnthn | wtf | 10:51 | |
It was just two about pthread_yield for me yesterday... | |||
lizmat | src/strings/unicode.c:41600:20: warning: initializing 'unsigned char *' with an | ||
expression of type 'char *' converts between pointers to integer types | |||
with different sign [-Wpointer-sign] | |||
unsigned char *bname = MVM_string_ascii_encode(tc, block, &size); | |||
jnthn | I fixed that? :/ | ||
lizmat | is it not a generated file ? | ||
the other one: | 10:52 | ||
src/6model/serialization.c:327:34: warning: '&' within '|' | |||
[-Wbitwise-op-parentheses] | |||
buffer[offset++] = value & 0x7F | 0x80; | |||
~~~~~~^~~~~~ ~ | |||
src/6model/serialization.c:327:34: note: place parentheses around the '&' | |||
expression to silence this warning | |||
jnthn | lizmat: Yeah, I thought I fixed the thing generating it too | ||
lizmat | I thought I did too, at one time :-( | ||
jnthn | m: say nqp::isbig_I(10_000_000_000) | ||
camelia | rakudo-moar cd87c4: OUTPUT«1» | ||
masak | good antenoon, #perl6 | 10:53 | |
jnthn | andreoss: 'cus it considers - maybe wrongly - that literal too big for a native int, so the % is being done with Int math instead, so the native is getting boxed all the time. | ||
andreoss | i guess it fits in int64 | 10:54 | |
jnthn | o/ masak | ||
andreoss: Yeah, it would, thus my "maybe wrongly" :) | |||
andreoss: Workaround is to assign that value into an int variable, I guess. | |||
10:56
xfix joined
|
|||
andreoss | jnthn: yep. this way it is faster | 10:56 | |
still not as fast as p5 (20 times faster) | 10:57 | ||
jnthn | What if you write it with a loop instead of a for? | 10:58 | |
andreoss | now it's 13 times slower | 11:01 | |
m: loop (my int $x; $x < 10; $x++) {} | |||
camelia | rakudo-moar cd87c4: OUTPUT«Cannot assign to an immutable value in sub postfix:<++> at src/gen/m-CORE.setting:5080 in block <unit> at /tmp/OXPvF1trKs:1» | ||
lizmat | andreoss: $x = $x + 1, natives don't handle ++ yet | ||
jnthn is working on that right now, afaik :-) | 11:02 | ||
jnthn | I get 3.03s with it written as a loop, vs 0.82s in Perl 5 | ||
xfix | Hm, interesting. Perl 5 just added /n modifier to regexes which makes parentheses not capture. Why not just add Perl 6 regexes? | ||
jnthn | m: say 3.03 / 0.82 | ||
camelia | rakudo-moar cd87c4: OUTPUT«3.695122» | ||
jnthn | So rather closer here. | ||
Still surprised we don't do better there, though. | |||
Ah, it's allocating somewhere, for some reason... | 11:03 | ||
Yeah, I think it's an optimizer bug | 11:04 | ||
'cus if I re-write it as | 11:05 | ||
my int $n = 2; my int $lim = 10_000_000_000; loop (my int $i = 0; $i <= 7830456; $i = $i + 1) { $n = 2 * $n; $n = $n % $lim }; say $n; | |||
Then I get the answer in 0.51, which is faster than Perl 5. | |||
Especially when 0.25s of that is startup. | 11:06 | ||
andreoss | i run this code ideone.com/AOapBS | ||
11:07
BenGoldberg joined
|
|||
andreoss | and it's still faster in perl5 and in perl6 with ints | 11:07 | |
*than in perl6 | |||
jnthn | Looks close enough to what I ran. | 11:08 | |
andreoss | % time perl6 prob097.pl | 11:09 | |
real0m9.281s | |||
user0m8.959s | |||
sys0m0.311s | |||
% time perl prob097.pl5 | |||
jnthn | Yeah but...which perl6? | ||
andreoss | real0m2.056s | ||
user0m2.052s | |||
sys0m0.003s | |||
rakudo | |||
jnthn | Yes, but which backend? | ||
andreoss | moar | ||
jnthn | OK, and on x64? | 11:10 | |
andreoss | yes | ||
jnthn | Hm, then you should have JIT | ||
11:11
BenGoldberg left
|
|||
andreoss | also without C-style for in perl5 it reduces to 1.35s | 11:11 | |
jnthn | Did you run exactly the code I pasted? | 11:13 | |
andreoss | I see | 11:16 | |
dalek | line-Perl5: 8fc9014 | (Stefan Seifert)++ | lib/Inline/Perl5.pm6: Pass on arguments to the P5 constructor |
11:17 | |
jnthn | If so, and it's still slower, I've little idea what's going on, though running with --profile may be informative. | ||
andreoss | jnthn: it's faster, thanks | ||
11:22
andreoss left
|
|||
lizmat | Files=936, Tests=34394, 177 wallclock secs ( 9.10 usr 3.15 sys + 1050.45 cusr 138.03 csys = 1200.73 CPU) # jnthn, wow! | 11:26 | |
Files=936, Tests=34394, 229 wallclock secs ( 9.33 usr 2.86 sys + 1228.85 cusr 139.25 csys = 1380.29 CPU) # before switch to master | 11:27 | ||
jnthn | Damn, that's quite a win. :) | 11:28 | |
lizmat | startup time for me went from ~ .29 to .23 | ||
that's about 20% better :-) | |||
jnthn | And no new test failures? | ||
lizmat | none, so I think a bump is in order | 11:29 | |
panda also bootstraps fine on it | |||
shall I bump ? | |||
jnthn | Go for it; will get it wider testing. | ||
lizmat | or wait for you to fix the unicode warnings ? | ||
jnthn | Can wait too | 11:30 | |
We've got a whole month :) | |||
lizmat | ok | 11:31 | |
dalek | p: a05ddba | lizmat++ | tools/build/MOAR_REVISION: Bump Moar revision to get better optimizations |
11:33 | |
nwc10 | sorry to be a bit laggy, but what particular bit of awesome was responsible for that? | ||
lizmat | default opt level of Moar, afaik | 11:34 | |
11:34
Kristien left
|
|||
dalek | p-js: 41e92e7 | (Pawel Murias)++ | src/vm/js/nqp-runtime/sixmodel.js: Set the correct invocant when calling $call on a method during method call. |
11:34 | |
p-js: fcf4d5f | (Pawel Murias)++ | t/nqp/18-associative.t: Add a test for nqp::hash(...) to 18-associative.t. |
|||
11:35
pmurias joined
|
|||
pmurias | people seem to really love benchmarking arithmetic | 11:36 | |
vendethiel | no idea why :-) | 11:37 | |
jnthn | nwc10: Bumped default opt level to O2, from O1 | ||
We used to get into problems with that | |||
Maybe the warnings fixes helped nail the issues, maybe it was other improvements (like being stricter about various things when doing the BE stuff) | 11:38 | ||
rurban | Released parrot-7.0.1 | 11:40 | |
lizmat | rurban++ | ||
dalek | kudo/nom: 3e97dc9 | lizmat++ | tools/build/NQP_REVISION: Bump NQP to get better optimized MoarVM |
11:43 | |
nine | What would be the correct syntax for something like my $handle_tag = sub($tag, $num, *@attrs) { ... }? | 11:55 | |
jnthn | m: my $handle_tag = sub($tag, $num, *@attrs) { ... } | 11:59 | |
camelia | rakudo-moar a05dc9: OUTPUT«===SORRY!=== Error while compiling /tmp/yv6tWcNIO9Variable '$tag' is not declaredat /tmp/yv6tWcNIO9:1------> my $handle_tag = sub($tag⏏, $num, *@attrs) { ... } expecting any of: postfix» | ||
jnthn | m: my $handle_tag = sub ($tag, $num, *@attrs) { ... } | ||
camelia | ( no output ) | ||
jnthn | Need the space there; foo(.... is always a function call. | ||
nine | Oh, thanks! | ||
12:05
anaeem1__ joined
12:07
anaeem1_ left
12:08
andreoss joined
12:12
zakharyas left
|
|||
lizmat | ok, so I just built rakudo on parrot with 7.0.1, and it build and spectested clean | 12:15 | |
so I guess a bump there is in order as well, right rurban? | |||
rurban | yes, please | 12:17 | |
there are two improvement branches for nqp and rakudo open, called parrot-rpa | 12:18 | ||
this is optional if you want better speed on parrot | 12:19 | ||
lizmat | one thing at a time :-) | ||
moritz | pmichaud didn't see too happy about removing qrpa | ||
dalek | p: 4589d81 | lizmat++ | tools/build/PARROT_REVISION: Bump Parrot to 7.0.1 |
12:21 | |
rurban | yes, what can I do. | 12:22 | |
I took his qrpa code and improved it | 12:23 | ||
12:24
frew left
12:26
tinyblak joined
12:28
abraxxa left
12:29
Kristien joined,
rurban1 joined
|
|||
lizmat | hmmm.... that last NQP bump did not work out for parrot: it doesn't build | 12:31 | |
with rakudo now | |||
rurban: could you verify that RELEASE_7_0_1 is the correct tag ? | 12:32 | ||
lizmat is a complete parrot noob | |||
moritz | lizmat: yes, that's correct | 12:36 | |
12:41
yeahnoob joined
|
|||
lizmat | ok, seems to build now | 12:46 | |
guess I did something wrong | |||
12:48
rindolf left
12:49
rindolf joined
|
|||
psch | hi #perl6 \o | 12:51 | |
raiph++ # jvm interop testing | |||
rurban1 | lizmat: yes, RELEASE_7_0_1 is good. | ||
psch | apparently the old marshalling (for longnames and not-overloaded methods) is still broken | ||
and it's annoying to fix, because i have to write bytecode that loops and unboxes... | 12:52 | ||
lizmat | rurban1: spectesting now | ||
rurban1 | I am working on an 10% faster parrot right now, with an improved StringBuilder. benchmark at github.com/parrot/parrot-bench#parrot-bench | ||
psch | .tell raiph i apparently missed fixing marshalling of List-y types for non-overloaded methods. that's the error you're seeing with "method/update/([B)V" | 12:53 | |
yoleaux | psch: I'll pass your message to raiph. | ||
12:57
skids left,
anaeem1__ left
|
|||
lizmat | Files=876, Tests=33426, 451 wallclock secs (10.51 usr 3.55 sys + 2916.91 cusr 410.29 csys = 3341.26 CPU) # before bump | 13:00 | |
13:00
Kristien left
|
|||
lizmat | Files=876, Tests=33426, 474 wallclock secs (10.78 usr 3.76 sys + 3023.09 cusr 424.04 csys = 3461.67 CPU) # after bump for parrot | 13:00 | |
could be noise, but the tendency seems towards being slower | |||
dalek | kudo/nom: 912a7fa | lizmat++ | tools/build/NQP_REVISION: Bump NQP for parrot 7.0.1 |
13:01 | |
13:05
tinyblak left,
tinyblak joined,
kaare_ left
13:09
tinyblak_ joined
13:12
tinyblak left
13:13
zakharyas joined
13:15
rindolf left
13:31
H2O1 joined
13:32
H2O1 left
|
|||
jmark | Hi, all! I'm skimming the official perl6 doc and wondering if "sized low-level types" (will) lead to any optimization comparable to cython? | 13:33 | |
moritz | jmark: low-level types generally are much faster | ||
jmark: though there aren't any optimizations for the sized ones in particular, I think | 13:34 | ||
jmark: so far they are mostly implemented to make it easier to interface with libraries written in C | |||
jmark | I would be satisfied when I do just some number crunching with ints and floats I could get near the speed of light. | 13:37 | |
moritz | we're working on it :-) | 13:38 | |
jmark | Without using C::Inline and such. | ||
nice! | |||
[Coke] | Util++ rurban++ # parrot releases | 13:42 | |
FROGGS | moritz: I was under the impression that operations with native types are jitted well | 13:44 | |
jnthn | Within the next month we should have natively typed arrays also, which will make the native types stuff a whole lot more useful. | ||
FROGGS | and we'll have write accessors on native attributes /o/ | 13:45 | |
nwc10 | and a pony? | 13:46 | |
jnthn | Well, if I catch another winter cold I might be a little horse again... | ||
nwc10 | if so, be careful, lest you end up in Tesco | 13:48 | |
13:49
andreoss left
|
|||
[Coke] | nwc10: the pony's dead, you know that. | 13:55 | |
nwc10 | yes, very true that. | ||
moritz notices that "the pony's dead" is a wonderful text for this tune: de.wikipedia.org/wiki/Der_Hahn_ist_...28Kanon%29 | 13:56 | ||
FROGGS | *g* | 13:57 | |
[Coke] | moritz: Den Hunn ass fräkt | 14:05 | |
jmark | Just read something about "PDL support". Is this what you mean by "natively typed arrays"? | 14:06 | |
14:07
Kristien joined
|
|||
moritz | jmark: it's a step in that direction | 14:08 | |
jmark: when people read "PDL", they expect to be able to multiple matrices, for example | |||
14:08
anaeem1_ joined
|
|||
moritz | jmark: that's not part of the core language; storing a matrix as compact as PDL does is, though | 14:08 | |
jmark | moritz: why not implementing some basic LinAlg, too? | 14:09 | |
One operator more or less wouldn't hurt perl6, right? ;) | 14:10 | ||
moritz | jmark: why not do it in a library? :-) | ||
14:11
anaeem1_ left
|
|||
Kristien | jmark: Noo! It would invalidate everyone's Period Table of the Operators posters! | 14:11 | |
moritz | jmark: doing linear algebra efficiently doens't quite require the same skill set as implementing a compiler | ||
jmark: so I'd leave it to other folks | |||
also, scope creep | |||
14:11
anaeem1_ joined
|
|||
Kristien | there are already fast linear algebra libraries, like Eigen. use them | 14:11 | |
jmark | Tooo sad: Just checked ... ** is still free yet, isn't it? | 14:12 | |
Kristien: But I want to do some LinAlg in perl6. Eigen is big and clumpsy. | |||
-p | 14:13 | ||
Kristien | I mean an Eigen binding for Perl 6 :P | ||
psch | m: say &infix:<**>.perl | ||
camelia | rakudo-moar 912a7f: OUTPUT«sub infix:<**> ($?, $?) { #`(Sub+{<anon>}+{Precedence}|51016560) ... }» | ||
masak | I agree. Perl 6 library + custom operators + fast bindings to something exist sounds just right. | ||
Kristien | or BLAS | ||
jmark | Alright, you convinced me. | 14:14 | |
moritz | uhm, Eigen is quite small in comparison to many other linear algebra libraries | ||
14:14
ptc_p6 joined
|
|||
Kristien | SciPy uses BLAS IIRC | 14:14 | |
moritz | it just doesn't compile very fast, because it does template magic | ||
14:14
ptc_p6 left
|
|||
moritz | (if we're talking about the same library here :-) | 14:14 | |
Kristien | yeah that one | 14:15 | |
jmark | moritz: You can bypass that by precompiling specializations. | ||
Kristien | it uses expression templates to simplify expressions at compile-time | ||
moritz | jmark: but then there's not too much point in using the library, no? | ||
Kristien | expression templates is one of its features, not the only one | ||
moritz | TBH I don't remember too much about it; just that it was less of a fuss to use as other libraries, and had an active and friendly community | 14:16 | |
jmark | jmark: hmm? But what when I just need to do some bigger float matrix multiplications but being still in the compile run cycle of my application. | ||
moritz hasn't done too much linalg lately | |||
14:19
anaeem1_ left
14:20
anaeem1 joined
|
|||
jmark | Could anyone recommend me an elaborate article/howto about "roles" besides the official doc and chromatics "The Why of Perl Roles"? | 14:21 | |
14:22
anaeem1 left
|
|||
masak | jmark: random ddg search: blogs.perl.org/users/ovid/2011/01/h...roles.html blogs.perl.org/users/ovid/2014/12/u...asses.html strangelyconsistent.org/blog/ovid-i...re-awesome | 14:22 | |
I think those might net you a nonzero understanding delta. | |||
er, a positive one, even ;) | |||
moritz | jmark: the academic research calls them "traits", might also help searching in that direction | 14:23 | |
masak | jmark: that reminds me: github.com/perl6/specs/issues/80 will be interesting reading to you, too. it has links to the two relevant papers. | 14:24 | |
14:27
ptc_p6 joined
|
|||
Kristien | doc.perl6.org/language/modules mentions only GitHub | 14:28 | |
does that mean you can't publish modules without putting them on GitHub? | |||
14:28
skids joined
|
|||
moritz | Kristien: currently our infrastructure is very github-centric | 14:29 | |
Kristien: contributions to diversify that are very welcome | 14:30 | ||
Kristien | OK. | ||
14:30
kaleem left
14:31
Kristien left
|
|||
jnthn | I guess any Git repo will actually do it? | 14:32 | |
moritz | jnthn: I'm afraid not | 14:33 | |
jnthn: there are some parts (like generating the module list) that check for github URLs | |||
jnthn | Oh | ||
moritz | jnthn: though I'm not entirely sure | ||
skids | Is there a standard way yet to tell panda "use this commit for vX.Y.Z"? | 14:42 | |
14:44
clkao left,
clkao joined
14:48
rurban left
14:50
Rounin left
14:55
booly-yam-6137__ left
|
|||
moritz | skids: have you tried to create a tag in git? | 14:55 | |
14:56
booly-yam-1010 joined
|
|||
PerlJam | Does panda have a way to checkout a tag/ | 14:57 | |
? | |||
moritz | dunno | ||
PerlJam doubts | |||
moritz | but skids' question sounded as if it has a way to checkout a commit | ||
and if it does, it'll probably support tags too | 14:58 | ||
15:06
PZt joined
|
|||
FROGGS | AFAIK panda does not support installing a certain commit/tag | 15:08 | |
but, one can `panda look Foo::Bar`, then do a git checkout to the desired comit/tag, and then do `panda install .` | 15:09 | ||
15:11
telex left
15:12
telex joined
15:13
tinyblak_ left
15:14
kurahaupo left
15:19
ptc_p6 left,
ptc_p6 joined
15:22
kaleem joined
|
|||
PerlJam | Here's a diff (untested) that will support adding @tag (or other committish things) to the end of the github URLs -- gist.github.com/perlpilot/d3001269e80f26915a27 | 15:22 | |
15:23
kaleem left
|
|||
PerlJam | \w probably needs to change though since that won't match . | 15:24 | |
15:27
Kristien joined
15:29
kurahaupo joined
15:30
adu left
|
|||
PerlJam | updated with a better committish matcher | 15:32 | |
15:33
rurban1 left
|
|||
hoelzro | I was playing around with type coercion (ex. MyType('')), and I noticed that if I implement postcircumfix:<( )> for MyType, that method receives a Capture as its single argument, rather than the value being coerced. Is there a reason for this? | 15:41 | |
moritz | \S+ as a first approximation? | ||
hoelzro: something bootstrappy, iirc | 15:42 | ||
hoelzro | hmm | ||
moritz: thanks for the input | |||
jnthn | The bootstrappy reason is gone-ish these days, though. | 15:43 | |
hoelzro | I'm going to try building/spectesting with passing the value itself, rather than a capture | 15:44 | |
for experimental purposes | |||
jnthn | I'm a bit bothered about coercion stuff overall, fwiw. | ||
We have a parsing problem or even ambiguity on coercion type syntax vs. actually performing a coercion. | 15:45 | ||
I guess we can say that Int(Str) is a coercion type specification because the inner thing and outer thingy are both types. | 15:46 | ||
And Int($foo) is a coercion, not a function call, because we don't see a type on the inside of it. | 15:47 | ||
But then we try and overload invocation on the type object to mean coercion, except if that's not defined we fall back to calling a .TypeName method | 15:48 | ||
Except if you have a multi that only accepts calls on instances then you get a dispatch error and not falback to the method call | 15:49 | ||
15:53
Kristien left,
adu joined
|
|||
lizmat | www.google.com/safebrowsing/diagnos...=perl6.org # *phew* :-) | 16:02 | |
hoelzro | jnthn: I'm not a fan of it either | 16:03 | |
16:04
booly-yam-1010 left
|
|||
skids | jnthn: Wasn't Type() (with no args) on the road to deprecation, though? | 16:04 | |
jnthn | .oO( The road to deprecation is paved with melting features ) |
16:07 | |
I thought Type() was kinda short for Type(Mu) or maybe Type(Any) | |||
16:08
booly-yam-9299 joined
16:09
regreg joined
|
|||
skids | Oh now I think I understand. So really it is just a matter of when people define their own coercers, ensuring they provide a path to the fallback? | 16:10 | |
16:11
rindolf joined
16:14
pecastro left
|
|||
lizmat | m: class A { method Int { say "foo" } }; Int(A) # just about | 16:15 | |
camelia | rakudo-moar 912a7f: OUTPUT«foo» | ||
16:16
gfldex joined
|
|||
skids | So is this just a case of "This hurts doctor"/"So don't do that" which could be "patched" through enculturation? | 16:17 | |
16:17
pecastro joined
|
|||
skids | I guess it would not be possible to warn like "Defining Int coercer without a :D ill advised" because the type named the same as the coercer might not yet exst... and at runtime that would be a long search to track them all down. | 16:19 | |
hoelzro | ok, doing that experiment broke a few tests | 16:21 | |
7, to be exact | |||
so not bad | |||
16:22
kjs__ left
|
|||
hoelzro | it's not spec'd how to override MyType(Str), is it? | 16:22 | |
just that MyType(Str) looks like a function call, and it's a coercion? | |||
lizmat | m: class A { method Int { say "foo" } }; A(Int) # the other way around | ||
camelia | rakudo-moar 912a7f: OUTPUT«Cannot find method 'A' in block <unit> at /tmp/iDu7MxkyRo:1» | ||
lizmat | that goes looking for a method A in Int | 16:23 | |
16:23
rurban joined
|
|||
lizmat | m: class A { multi method A(Int:U:) { say "foo" } }; A(Int) # does this work? | 16:24 | |
camelia | rakudo-moar 912a7f: OUTPUT«Cannot find method 'A' in block <unit> at /tmp/0cn73E9U5z:1» | ||
hoelzro | lizmat: I tried implementing postcircumfix:<( )> on MyType, that *works*, in that the function is called | ||
but a Capture is passed, rather than the value itself | 16:25 | ||
which is fine, except it's not spec'd (iirc), and I think that would throw a new user of Perl 6 | |||
lizmat | yeah, but that approach feels wrong to me | ||
hoelzro | I would honestly just like a multi method coerce($src-type, $dest-type) | ||
skids | m: class A { method Int { say "foo" } }; Int.(A) # that is worse, appearence-wise. | ||
camelia | rakudo-moar 912a7f: OUTPUT«foo» | ||
PerlJam | hoelzro: maybe spelled COERCE because it's something that Perl will call on your behalf? | 16:26 | |
hoelzro | so if I want to tell Perl 6 how to coerce Strs into MyTypes, I need only implement multi coerce(Str $value, MyType) { ... } | ||
PerlJam: oh, good call | |||
(no pun intended) | |||
jnthn | hoelzro: Aside from the fact it will have an epic number of candidates, a multi COERCE ain't so bad. | ||
hoelzro | jnthn: epic indeed | 16:27 | |
we could also have a fallback multi COERCE(Any $value, Any:U $type) { my $name = $type.^name; $value."$name"() } | 16:28 | ||
so that .Str and friends still works | |||
I think it should be easy, when defining a new type, to control how values of other types may be converted into my new type, whether or not I control those other types | 16:29 | ||
(I suppose, given the nature of Perl 6, "control" is a murky term =/) | |||
PerlJam | Most of the "control" seems like it would be the compiler carping about "I don't know how to convert TypeA into TypeB, perhaps you should write a multi COERCE(A,B) routine" | 16:33 | |
hoelzro | right, in this case, the control would be black magic-free | 16:34 | |
instead of, for example, having to monkey patch TypeA | 16:35 | ||
skids | Don't I remember reading something about if the source type doesn't have an opinion on the matter, then go see if the destination type does? | 16:36 | |
16:37
kaleem joined
|
|||
jnthn | skids: That's the basic idea of the current policy, yes, but having an opinion is currently a bit all-or-nothing | 16:37 | |
hoelzro | I think it's actually the other way around; I think the destination type is checked first, then the source type is consulted | 16:38 | |
16:38
denis_boyun_ left
|
|||
jnthn | Oh? | 16:38 | |
Quite possibly. :) | |||
hoelzro | I *think* so | ||
my Rakudo fu is quite weak =) | |||
skids | Not according to lizmat++s example above. | ||
jnthn | Ah, yeah, destination is the invoke-y one | ||
16:39
panchiniak joined
|
|||
hoelzro | github.com/rakudo/rakudo/blob/nom/....nqp#L2644 | 16:39 | |
16:39
FROGGS left
|
|||
hoelzro | if you can invoke the type, try it; otherwise, try $value."$typename" | 16:39 | |
lizmat | fwiw, a COERCE method feels in line with things like ACCEPTS | 16:40 | |
hoelzro | jnthn, you mentioned that the dispatch table for such a multi would be huge; how bad are the implications of that? | 16:41 | |
skids | Is there a way to split a proposed COERCE up to reduce the candidates? | ||
jnthn | hoelzro: With the present way things work, it depends how many of them you hit in the time a program is running. | 16:42 | |
hoelzro: If we totally fill up the multi-dispatch cache then dispatches not in it get slow and spesh can't do much 'cus it looks at the cache. | 16:43 | ||
We could of course make the cache growable. | |||
hoelzro | ah ha | ||
jnthn | Or re-focus the caching around the callsite, not the callee | 16:44 | |
skids | That might be an interesting generic thing to do once a high water mark gets hit. | 16:45 | |
japhb | jnthn: This reminds me, how will spesh react to a class Foo { has $.bar handles * }, when $.bar changes every so often (say, every 1000 method calls to a Foo instance)? | ||
Well, not just spesh, but all method-call optimizations, really | 16:46 | ||
jnthn | japhb: Changes *object* or changes type of object? | ||
japhb | Changes the object instance, but $.bar always has the same type. | ||
jnthn | Spesh cares about types | 16:47 | |
So if it does something there it'll likely have a guard on the type $.bar gives back | |||
japhb | So if the type were allowed to vary, then what? | ||
jnthn | Probably if you're stable for a while it'll specialize assuming it'll always be that type | ||
And then when it changes, you'll hit the deopt path every time. | 16:48 | ||
japhb | Forever more? Or will it notice a "new stable" and try again? | ||
jnthn | In the long run, we'll keep stats on deopt rates and retire specializations that work out badly. | ||
Forevermore. It's kinda the generational hypothesis for optimization: either things vary in type a lot, or keep the same type, and things in the middle are rarer | 16:49 | ||
japhb wonders if "punctuated equilibrium" is pessimal for r-m right now | |||
nodnod | |||
jnthn | Yes, we likely handle that less well at the moment. | ||
16:49
rurban_ joined,
jluis_ joined
|
|||
jnthn | Though if you have just a couple of places in your program like that, it's not the end of the world. | 16:50 | |
japhb | How is 'handles *' actually implemented? Does Foo's method cache just fill up with entries from $.bar over time? | ||
true | |||
jnthn | No, I doubt it's actually very optimal at all at the moment. | ||
PerlJam | Could there be an op exposed to Rakudo that could trigger a "respecialization"? (so that you could manually control it for the puntuated equilibrium that japhb mentioned) | 16:51 | |
jnthn | PerlJam: I think better to let the VM keep stats and learn, tbh. | ||
TimToady wonders how long the world stayed optimized for dinosaurs after the asteroid... | 16:53 | ||
or rather, deoptimized for everyone... | |||
japhb | ISTR reading something that the world was already beginning to deopt for existing species before the asteroid hit, and that just put the cap on it. | 16:54 | |
TimToady | too many megamorphs running around | ||
skids | COERCEASAURUS | ||
japhb | Yeah, here it is: arstechnica.com/science/2014/12/mas...rs-demise/ | 16:55 | |
skids | That was just the earth breaking into a sweat because it knew it was about to be beaned on the forehead :-) | 16:56 | |
adu | metamorph? | ||
japhb | heh | ||
16:56
Otterpocket joined
16:57
Otterpocket left
|
|||
adu | Kyodai Ka? | 16:57 | |
dalek | rl6-roast-data: 30fa912 | coke++ | / (5 files): today (automated commit) |
16:58 | |
TimToady | 強大も。 | ||
16:59
zakharyas left,
kjs__ joined
|
|||
adu | ⿰弓⿱口虫 | 17:01 | |
17:01
rurban left
|
|||
adu | 巨大化 | 17:01 | |
Megawandler | 17:02 | ||
pmurias | jnthn: Can setinvokespec be called multiple times on the same type? | 17:03 | |
jnthn | pmurias: Um...not sure we refuse it, but the behavior isn't very defined. :) | 17:05 | |
In practice, it doesn't happen anywhere I can think of. | |||
17:05
yeahnoob left,
Otterpocket joined
17:11
vendethiel left
17:13
vendethiel joined
17:16
Kristien joined
|
|||
Kristien | hola | 17:19 | |
17:19
LLamaRider joined
|
|||
TimToady | halo | 17:20 | |
[Coke] | m: sub Int() { say "3" } ; say Int(); say Int(10); | 17:24 | |
camelia | rakudo-moar 912a7f: OUTPUT«010» | ||
[Coke] | Should the sub declaration there complain ? | ||
japhb | If type coercion will always win, then yes. | 17:26 | |
17:27
Otterpocket left
|
|||
japhb | (There's an argument to be made that an our sub might actually be usable, but at the very least this should be a warning.) | 17:27 | |
17:29
kaleem left
|
|||
jnthn | One does start to wonder if we might be hanging things off the wrong peg somehow with coercion... | 17:31 | |
TimToady | where have I heard that metaphor before... :) | 17:32 | |
TimToady thinks of type names as new reserved words, basically | 17:33 | ||
[Coke] | m: say Int("three"); say Complex("Sausage") | ||
camelia | rakudo-moar 912a7f: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏three' (indicated by ⏏) in method Int at src/gen/m-CORE.setting:14137 in method Int at src/gen/m-CORE.setting:6340 in block <unit> at /tmp/Ca0NYzo2Jd:1…» | ||
[Coke] | m: say Complex("Sausage") | ||
camelia | rakudo-moar 912a7f: OUTPUT«Cannot find method 'Complex' in block <unit> at /tmp/ukzPHD4Vbs:1» | ||
[Coke] | the Int error makes sense. the Complex one does not. (also, should I be testing this on master?) | 17:34 | |
er, nom? | |||
17:34
vendethiel left
|
|||
TimToady | were you thinking of that as a coercive type? | 17:34 | |
I don't think 6pe is merged quite yet, though I still have some backlog... | 17:35 | ||
17:35
tgt joined
|
|||
[Coke] | Yes. I was expecting I could pick arbitrary core classes and try to coerce to them. | 17:35 | |
ah, ok. I'll wait until post merge before poking more, I guess. or switch to that branch and poke. | 17:36 | ||
jnthn | At the moment, 6pe would give you all the same answers to the things you tried. | 17:37 | |
It only parses a coercion type when typename is hit, which for now is only in explicit calls toit. | |||
TimToady | we need to teach the parser that Int() and Int(SomeType) are coercive types | ||
jnthn | *to it | ||
*nod* | |||
TimToady | or is that there already? | ||
17:38
vendethiel joined
|
|||
jnthn | No, I didn't do that | 17:38 | |
I guess that goes in term:identifier | |||
But that now has 3 cases | |||
1) Coercion type | |||
2) Coercion operation | |||
3) Function call | |||
TimToady | basically we stole two syntaxes from ... what you said | ||
jnthn | If we hang it there. | ||
TimToady | doesn't matter so much where a type is already expected | 17:39 | |
moritz | let's find another use for the colon | ||
TimToady | but as an rvalue... | ||
moritz | Int:(Any) # as coercion type | ||
moritz only 20% serious | |||
jnthn | Yeah, it was no problem in typename, it's the rvalue case... | ||
TimToady | but I don't think it's semantically ambiguous | ||
which is why I picked that in the first place | |||
Int(Any) is really a kinda generic for Int($any) | 17:40 | ||
jnthn | I think we can differentiate it without WATs... | ||
TimToady | and the arg has to be literally a type or () | ||
jnthn | Right. | ||
What a coercion operation compiles into is really the one I'm not comfortable with at the moment. | |||
TimToady | you mean Int($foo)? | 17:41 | |
jnthn | Yeah | ||
At the moment it's a call to an internal function that does a bunch of introspection. | 17:42 | ||
Which is, uh, LTP. | |||
TimToady | ...parsimonious? | ||
jnthn | Performant is what I had in mind... | ||
TimToady | ...peggy? | ||
...puresmelling | 17:43 | ||
17:43
FROGGS joined,
rmgk_ joined,
rmgk left,
rmgk_ is now known as rmgk
|
|||
TimToady | it really is sort of an instantiation of the generic coercion type | 17:43 | |
moritz | ...probabilistic | ||
jnthn | TimToady: That's pretty much how it's been implemented :) | 17:44 | |
17:44
kjs__ left
17:46
booly-yam-9299 left
|
|||
jercos | japhb: haha, yes, that was what I was looking for. Thanks :) | 17:46 | |
m: say "whatever".WHAT | 17:47 | ||
camelia | rakudo-moar 912a7f: OUTPUT«(Str)» | ||
jercos | m: say "whatever".methods.grep({$_.gist ~~ /^fl/}) | ||
camelia | rakudo-moar 912a7f: OUTPUT«No such method 'methods' for invocant of type 'Str' in block <unit> at /tmp/RYnbpgIk9L:1» | ||
jercos | erm | ||
m: say "whatever".^methods.grep({$_.gist ~~ /^fl/}) | |||
camelia | rakudo-moar 912a7f: OUTPUT«» | ||
17:47
booly-yam-9299_ joined
|
|||
jercos | Oh, it's on Cool, haha, got it. | 17:48 | |
jnthn | .^methods(:all) | ||
moritz | m: say 'whatever'.^methods(:all).grep({.name ~~ /^fl/}) | 17:49 | |
camelia | rakudo-moar 912a7f: OUTPUT«floor flip flat flatmap» | ||
17:49
denis_boyun joined
|
|||
jercos | Well yes, that totally works, but doesn't tell me where it's actually from. | 17:50 | |
And gives a rather huge list to look through on a Str, if I didn't already know what I was looking for | |||
jnthn | m: say 'whatever'.^methods(:all).grep({.name ~~ /^fl/})>>.package.say | 17:51 | |
camelia | rakudo-moar 912a7f: OUTPUT«(Cool) (Cool) (Any) (Any)True» | ||
moritz | jercos: doc.perl6.org/type/Str nicely tells you where which method comes from | ||
jnthn | m: say 'whatever'.^methods(:all).grep({.name ~~ /^fl/}).map({ "{.name} in {.package.^name}" }) | 17:52 | |
camelia | rakudo-moar 912a7f: OUTPUT«floor in Cool flip in Cool flat in Any flatmap in Any» | ||
17:52
pmurias left
|
|||
jnthn | .oO( That's flipin cool! ) |
17:52 | |
jercos | bril :D | ||
I'm still sorta on the fence about Cool in general though :p | 17:53 | ||
jnthn | So...you're a bit cool about it? | ||
jercos | Most of the methods it bears seem to act like either self.Numeric.something or self.Str.something | ||
jnthn | Yes | ||
TimToady | that's what it's for :) | 17:54 | |
jnthn | It's a strongly typed implementation of weak typing... | ||
jercos | But without any indication from the method itself which is which | ||
tony-o_ | hoelzro: i think i have a fix for the bug you discovered in html-parser-xml | ||
moritz | doc.perl6.org/type/Cool has the table of which method coerces to which | ||
moritz feels a small mental reward each time he can point to a point of doc.perl6.org to answer a question that folks actually ask | 17:55 | ||
jercos | Indeed it does. And most of them are pretty obvious. | ||
I don't think anyone would expect .cos() to be anything but Numeric :p | 17:56 | ||
jnthn | moritz: Yes, doc.perl6.org increasingly seems to have the answers to things :) | ||
moritz | jercos: except when they expect cos play :-) | ||
jercos | And of course the return type is programmatically accessible as well, I suppose. | ||
moritz | doc.perl6.org/type/Signature#method_returns | 17:57 | |
:-) | |||
m: say Cool.^find_method('cos').signature.returns.^name | 17:58 | ||
camelia | rakudo-moar 912a7f: OUTPUT«Mu» | ||
moritz | but it seems to be not declared :( | ||
17:58
virtualsue left
|
|||
moritz | m: say Cool.^find_method($_).signature.returns.^name for <chop abs floor> | 17:58 | |
camelia | rakudo-moar 912a7f: OUTPUT«MuMuMu» | ||
moritz | :( | ||
TimToady | m: say Num.^find_method('cos').signature.returns.^name | 17:59 | |
camelia | rakudo-moar 912a7f: OUTPUT«Mu» | ||
TimToady | that one really oughta say Num anyway | ||
moritz | the methods in Cool don't seem to declare return types right now | ||
17:59
Rounin joined
|
|||
moritz | TimToady: I think the sentiment so far has been to declare return types where they give a performance boost, which is just for subs so far | 18:01 | |
m: say IO::Handle.^find_method('tell').signature.returns.^name | |||
camelia | rakudo-moar 912a7f: OUTPUT«Mu» | ||
[Coke] | moritz: should they need to if they have a single return point and that item declares a return? (I'm assuming yes because that level of introspection is hard) | ||
moritz | [Coke]: you are correct | 18:02 | |
TimToady | m: say Cool.^find_method('ord').signature.returns.^name | ||
camelia | rakudo-moar 912a7f: OUTPUT«Int» | ||
moritz | $ git grep 'method \w.*returns'|wc -l | ||
9 | |||
TimToady | m: say ord(42) | 18:03 | |
camelia | rakudo-moar 912a7f: OUTPUT«52» | ||
moritz | m: say chr 52 | ||
camelia | rakudo-moar 912a7f: OUTPUT«4» | ||
18:04
denis_boyun left
|
|||
TimToady | some kinds of optimiztions depend on knowing the return type, so I think we should work towards getting return types declared and performant | 18:05 | |
I realize that's more of an AOT concern than a spesh concern | |||
but we really don't want to penalize folks for declaring their return types | |||
jnthn | I don't think there's much penalty at all | 18:06 | |
TimToady | maybe there was at some point in the past? | ||
jnthn | Yes | ||
But today should really not be | |||
Spesh probably strips a bunch of those checks out when it can prove they're not needed also | |||
TimToady | goodgood | ||
I assume spesh can also deal with the optimization of Foo(Any) coercions when we start combining multis that currently are there only to provide Any,Any parameters that map to Foo,Foo? | 18:10 | ||
lizmat recently removed a return type because it could also return a Failure | 18:11 | ||
jnthn | At the moment, Foo(Any) $x is deconstructed in the signature into the same thing that Any $a as Foo has turned into | 18:12 | |
lizmat | and that broke | ||
TimToady | lizmat: yes, that's also a concern | ||
jnthn | Which is a nice fast, cachable, nominal type match on Any, and then there's an istype guard against Foo | ||
If spesh sees it already is a Foo, then it turns the branch into a goto and the coercion becomes dead code and vanishes. | 18:13 | ||
TimToady | but that's on the callee end, whereas the multies might get duomorphically cached on the caller end? | 18:14 | |
so maybe not equiv | |||
I don't imagine we do per-caller speshing like that | 18:15 | ||
well, unless you've inlined first... | |||
jnthn | Well, it's done at the callee | ||
Uh | |||
Specializations are per-callee | |||
But the caller might be specialized to call a particular specialization. | |||
That's a pre-req for inlining, in fact. | 18:16 | ||
TimToady | so we don't lose that information? | ||
jnthn | Inlining is "just" going one step further when you've decided you know exactly where the call is going. | ||
No, if when specializing the caller we find the callee has a specialization that fits, we just emit an invoke op that points directly to the specialization. | 18:17 | ||
TimToady | suppose you have 10 call sites that are monomorphic on the call, but collectively are megamorphic. do we deopt? | ||
18:17
Hor|zon left
|
|||
jnthn looks confusedly at the question :) | 18:18 | ||
TimToady | I can well imagine a generic having that behavior when instantiated 10 different ways | ||
jnthn | We only deopt locally if we fail a guard, or globally if we have a mixin or some other such action-at-a-distance change. | 18:19 | |
TimToady | locally meaning in the caller? | ||
jnthn | So far as 6model parametric stuff and spesh interact so far, each parameterization can have its own specialization. | ||
Locally meaning the frame we're in when the guard fails | 18:20 | ||
Note that if we are optimizing a call and there's no specialization of the callee that type-matches what we have, then we just leave the slower-path call in place. | |||
Though we may cache the code object if it's a lexical that isn't going to change. | 18:21 | ||
The thing is structured to specialize on frame *exit*, not entry, so your callees of lesser or similar size will always have been specialized before you. | |||
TimToady | nod | 18:23 | |
18:23
vendethiel left
|
|||
TimToady | I love the response 'nod' because it conveys anything from "I hear you" to "I agree completely", and in general conveys greater intelligence than is felt. :) | 18:24 | |
jnthn | nod | 18:25 | |
18:27
tgt left
|
|||
TimToady | :D | 18:27 | |
[Coke] | returns Int:F # normally an Int, but potentially a Failure. | 18:32 | |
perhaps? | |||
Kristien | F# :o | 18:33 | |
18:33
FROGGS_ joined
|
|||
TimToady | Int() would coerce failure to Int :) | 18:34 | |
18:36
Sqirrel left,
FROGGS left
|
|||
ab5tract | jnthn: here's a smaller example which seems to trigger segfaults and unhandled exceptions gist.github.com/ab5tract/34408eaa7b5c64dc84a7 | 18:38 | |
i think it is the same behavior i saw previously when playing around with raw thread locking in perl 6 | 18:39 | ||
18:42
Hor|zon joined
|
|||
japhb | [Coke]: Perhaps 'Int?' instead of 'Int:F'? I don't think we use 'Type?' syntax yet .... | 18:44 | |
jnthn | ab5tract: Yes, I've got a collection of issues like that to look into... | 18:45 | |
dinner & | |||
ab5tract | enjoy! (the dinner) | ||
18:48
Kristien left
18:51
vendethiel joined
|
|||
dalek | c: 9d785d6 | moritz++ | lib/Type/ (2 files): Document run, shell, Proc::Status |
18:52 | |
c: 5efa369 | moritz++ | lib/Type/Metamodel/MROBasedMethodDispatch.pod: Document .^find_method_qualified |
|||
c: 64385e5 | (Geoffrey Broadwell)++ | htmlify.p6: Improve preamble boilerplate for type graph SVG image |
18:53 | ||
c: e87e534 | (Geoffrey Broadwell)++ | lib/Type/ (3 files): Merge branch 'master' of github.com/perl6/doc |
|||
[Coke] | japhb: I would expect Int? to mean it could return Nil, I think. | 18:56 | |
hoelzro | tony-o_: hooray! | ||
[Coke] | m: sub bar() returns Int { Nil }; my Int foo = bar(); say "y" | 18:57 | |
camelia | rakudo-moar 912a7f: OUTPUT«===SORRY!=== Error while compiling /tmp/FS5VUU6Yx3Malformed my (did you mean to declare a sigilless \foo or $foo?)at /tmp/FS5VUU6Yx3:1------> ub bar() returns Int { Nil }; my Int foo⏏ = bar(); say "y"» | ||
hoelzro | I was going to start just using the XML module =) | ||
[Coke] | m: sub bar() returns Int { Nil }; my Int $foo = bar(); say "y" | ||
camelia | rakudo-moar 912a7f: OUTPUT«Type check failed for return value; expected 'Int' but got 'Any' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in block <unit> at /tmp/4FnwFk8TnL:1» | ||
TimToady | Int? would be a Maybe type, not an Error type, to put it into Haskellian terms | ||
japhb | Yeah, fair enough. | 18:58 | |
TimToady | it's also ambiguous currently with optional params | ||
japhb | Oh, for when you don't even specify a sigil? | ||
TimToady | m: sub foo (Int?) { say "here" }; foo() | ||
camelia | rakudo-moar 912a7f: OUTPUT«===SORRY!=== Error while compiling /tmp/qG1V2W0UIqMissing blockat /tmp/qG1V2W0UIq:1------> sub foo (Int⏏?) { say "here" }; foo()» | ||
TimToady | o_O | ||
japhb | I guess it's not ambigious in Rakudo ... ;-) | 18:59 | |
[Coke] | m: sub foo (Int $?) { say "here" }; foo() | ||
camelia | rakudo-moar 912a7f: OUTPUT«here» | ||
19:00
Sqirrel joined
|
|||
TimToady | regarding coercion priority, it's neither of the things suggested at irclog.perlgeek.de/perl6/2015-01-23#i_9992611 | 19:01 | |
see S13:198 | |||
synopsebot | Link: perlcabal.org/syn/S13.html#line_198 | ||
19:02
ashleydev left,
ashleydev joined
|
|||
TimToady | you just want to avoid the situation where the functional and method forms are both deferring to each other | 19:02 | |
maybe the right way to do that is to have both forms write a multi COERCE that is the fallback, with poisoning if both ends try to define it | 19:04 | ||
19:08
Hor|zon left,
virtualsue joined
19:09
rindolf left
19:14
vendethiel left
|
|||
dalek | kudo/nom: 25da7a9 | moritz++ | src/core/Cool.pm: Declare a few more return types |
19:14 | |
19:15
LLamaRider left
19:17
fhelmberger left,
Kristien joined
|
|||
japhb | moritz: How often is doc.perl6.org regenerated? | 19:19 | |
19:20
vendethiel joined
|
|||
Kristien | I just noticed the 6 in the wing of Camelia Ö | 19:20 | |
moritz | japhb: 17,47 * * * * ./update-and-sync > update.log 2>&1 | 19:21 | |
hobbs | Kristien: how about the P? :) | 19:24 | |
Kristien | :O | ||
Arguably the P is a rotated 6. | 19:25 | ||
japhb | It would have to be reflected as well, since 9 is a rotated 6. | ||
moritz: thx | |||
Kristien | Rotated on the Y axis. :P | 19:26 | |
japhb | s/on/about/, but yes, I get your point. :-) | ||
japhb is happy that the type graph at doc.perl6.org/type/Cool is actually quite informative -- though better at 200% zoom on my monitor | 19:29 | ||
Kristien | I found a nice use-case for Perl 6: my compiler I originally intended to write in Haskell. :D | 19:32 | |
hoelzro | tony-o_: thanks for the fix; I'll try it out later | 19:35 | |
raydiak | good morning #perl6 | 19:36 | |
19:36
booly-yam-9299_ left
|
|||
raydiak | m: multi foo (num) { say "num" }; multi foo (Any) { say "Any" }; foo num # ? | 19:36 | |
camelia | rakudo-moar 912a7f: OUTPUT«Any» | ||
moritz | japhb: it would be even nicer if a click on the SVG would zoom it to fill the whole page | 19:38 | |
\o raydiak | |||
raydiak: native type constraint always constrain to instances | |||
19:39
bjz left
|
|||
raydiak | o/ moritz | 19:39 | |
m: multi foo (num.new(1)) { say "num" }; multi foo (Any) { say "Any" }; foo num.new(1) | |||
camelia | rakudo-moar 912a7f: OUTPUT«===SORRY!=== Error while compiling /tmp/dgjCf1_OCVMissing blockat /tmp/dgjCf1_OCV:1------> multi foo (num⏏.new(1)) { say "num" }; multi foo (Any) » | ||
raydiak | m: multi foo (num $x) { say "num" }; multi foo (Any) { say "Any" }; foo num.new(1) | 19:40 | |
camelia | rakudo-moar 912a7f: OUTPUT«Any» | ||
raydiak | moritz: I'm somewhat unclear what that means, but trying to decypher it :) | ||
moritz | m: say num.^name | 19:41 | |
camelia | rakudo-moar 912a7f: OUTPUT«num» | ||
raydiak | m: multi foo ($x where num) { say "num" }; multi foo ($x) { say "other" }; foo num.new(1) | 19:42 | |
camelia | rakudo-moar 912a7f: OUTPUT«num» | ||
moritz | raydiak: think of sub foo(num $x) { } as a very low-level thing. It doesn't accept the num type object, only "real" doubles (pun intended) | ||
japhb | moritz: as a popover, or a new tab, or replacing the current page? | ||
moritz | japhb: popover or new tab, IMHO. But I'm open to suggestions :-) | 19:43 | |
19:43
vendethiel left,
jluis_ left
|
|||
japhb | New tab is probably easiest, popover *might* be better UX, not sure. | 19:44 | |
19:44
vendethiel joined,
avalenn_ left
|
|||
raydiak | imo a lightbox would help, but getting those typegraphs to come out at less extreme aspect ratios would be even better | 19:44 | |
moritz | well, replacing the current tab would just be an ordinary link | ||
raydiak: the type graphs are pretty well optimized already, as far as dot output goes | 19:45 | ||
japhb | raydiak: Unfortunately, our type heirarchies tend to be wide but shallow. Most aren't quite as extreme as Cool, but Any and Exception are so bad I had to special case them to rotate 90 degrees. | ||
I spent a lot of time tuning the layout heuristics (which is why the current method *usually* looks OK, if not always). | 19:46 | ||
raydiak | oh that's why a few look different :) | ||
moritz finds it quite fortunate that our type hierarchies tend to be not too deep :-) | |||
japhb | moritz: Fortunate for programming, unfortunate for pictures. ;-) | 19:47 | |
tony-o_ | hoelzro: when you get around to trying it out, can you let me know how it goes and i'll close out the github issue | ||
hoelzro | tony-o_: I will let you know! | ||
japhb | raydiak, if you'd like to experiment with a lightbox, be my guest. I'm supposed to be reviewing design docs at $dayjob anyhow .... | 19:48 | |
raydiak | japhb: probably not today, but I'll do it some time soon if nobody else does, b/c you're right that some are kinda a nuissance as is | 19:50 | |
19:50
Hor|zon joined
|
|||
raydiak is waiting for that oh-so-elusive thing called "inspiration" to strike for the syn redesign | 19:51 | ||
yesterday's work was decidedly uninspired and basically just a waste of time :P | |||
japhb | Sometimes it just takes learning lessons from a lot of | 19:52 | |
"uninspired" days to have one truly inspired one. | |||
moritz | start by removing everything that's ugly? | ||
.oO( color: white; background-color: white ) |
|||
japhb | .oO( Cut off his head! ) |
||
moritz: Or just convert the entire page to encoded whitespace as per Acme::Bleach .... | 19:53 | ||
19:54
wilx joined
|
|||
TimToady likes flat org charts... | 19:54 | ||
19:56
Jefffrey joined
|
|||
Jefffrey | Hello | 19:56 | |
Kristien | Hello Jefffrey | ||
raydiak | Helllo o/ | ||
19:57
spider-mario joined,
lucas joined
|
|||
Jefffrey | So... | 19:58 | |
Let's talk about Perl 5. | |||
hoelzro | when we were talking about COERCE earlier today, there seemed to be a fair amount of support in favor. How does one get such a change into the language? | ||
should I file a PR against perl6/spec? | |||
PerlJam | hoelzro: works for me. | 19:59 | |
moritz | hoelzro: the strongest case you can make for it is implement it in rakudo, and push your changes to perl6/specs | 20:00 | |
(and tests, and docs, if you're really good :-) | |||
hoelzro | =) | ||
PerlJam | yeah, that's even better | ||
lucas | m: my Nil $x; my True $y; my NaN $z; say 'alive' | ||
camelia | rakudo-moar 912a7f: OUTPUT«alive» | ||
lucas | ^^^ It seems like I can initialize a variable with some odd values. Is this ok? I would expect only typeobjects to be allowed in that position. | ||
hoelzro | ok, I will endeavor to do that! | ||
PerlJam | hoelzro: but even TimToady often just specs stuff with no implementation ;) | 20:01 | |
TimToady | hoelzro: so what do you do if both endpoints define contradictory functions? | ||
hoelzro | I was thinking "spec first" so that people could discuss in case the idea was not well recieved widely | ||
TimToady: for example? | |||
moritz | m: my NaN $z; say $Z | ||
camelia | rakudo-moar 912a7f: OUTPUT«===SORRY!=== Error while compiling /tmp/T0JPa1nWb0Variable '$Z' is not declaredat /tmp/T0JPa1nWb0:1------> my NaN $z; say $Z⏏<EOL> expecting any of: postfix» | ||
moritz | m: my NaN $z; say $z | ||
camelia | rakudo-moar 912a7f: OUTPUT«NaN» | ||
TimToady | well, did you look at S13:198 like I pointed to earlier? | 20:02 | |
synopsebot | Link: perlcabal.org/syn/S13.html#line_198 | ||
TimToady | that's current spec on it | ||
hoelzro | I did not! | ||
hoelzro looks | |||
TimToady | and it allows both ends to specify how they think the coercion should go | ||
and it allows the user to pick one or the other in the case that they conflict | |||
moritz | lucas: yes, we allow values in some situations that are usually reserved for types | ||
TimToady | I suggested we earlier we might do COERCE as the mutual fallback though | 20:03 | |
moritz | m: multi f(0) { 1 }; multi f(Int $x) { $x * f($x - 1) }; say f 4 # for lucas++ | ||
camelia | rakudo-moar 912a7f: OUTPUT«24» | ||
TimToady | that would be one way to avoid infinite regress | ||
20:03
denis_boyun joined
|
|||
Kristien | m: my ($s, $t) = (Supply.new, Supply.new); my ($p, $q) = ($s.Promise, $t.Promise); $t.emit(1); $s.emit($q); say ($p.result, $p.result.result); | 20:04 | |
camelia | rakudo-moar 912a7f: OUTPUT«Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable), status => PromiseStatus::Kept) 1» | ||
Kristien | No assimilation, good. | ||
TimToady | lunch & | ||
hoelzro | interesting | ||
one thing that bothers me about $value."$typename"() is what about types like X::MyException (/me has no idea if : is legal in method name) | 20:05 | ||
20:06
Jefffrey left
|
|||
psch | m: class Foo { }; Foo.^add_method("it's a silly::test", method (Foo:U:) { say "dunno?" }); Foo."it's a silly::test"() | 20:06 | |
camelia | rakudo-moar 912a7f: OUTPUT«dunno?» | ||
lucas | m: constant Foo = 42; my Foo $x; say $x | 20:07 | |
camelia | rakudo-moar 912a7f: OUTPUT«42» | ||
hoelzro | but also, let's say I have two types with the same base name (ex. module Trangressions { class Sin { ... } } module Trig { class Sin { ... } }), and I define .Sin on some other class. Which one am I coercing to? | ||
lucas | It seems like if I have any bareword, I can use it as a typename | 20:08 | |
PerlJam | hoelzro: whichever one is in scope | ||
lucas | moritz: Thanks for the example! | ||
moritz | PerlJam: in scope where the coercion method is defined? or where it's called? | ||
hoelzro | PerlJam: what if I import the other class into another module, and call .Sin, having imported neither Transgressions nor Trig? | ||
moritz | jnthn: is there anything holding off the 6pe merge? | 20:09 | |
PerlJam | moritz: if you're not typing your return values, then either :) | 20:10 | |
lizmat | hoelzro: then that Sin will be visible in that scope | ||
or the import will fail if there is already a Sin there | |||
skids | m: class A { method y { "yes".say } }; class B is A { }; B.new.A::y() # hoelzro, methods syntactically can have ns colons and such is often used like this. | 20:11 | |
camelia | rakudo-moar 912a7f: OUTPUT«yes» | ||
hoelzro | let's say I have class MyType { method Sin { #`( ...magic...) } } | ||
jnthn | moritz: Various things :) | ||
hoelzro | and I import MyType into Foo.pm, and that's all I import. Then I call MyType.new.Sin. Which Sin should it try coercing to? | ||
moritz | hoelzro: I'm well aware of the the problem, what's missing is a solution | 20:12 | |
PerlJam | hoelzro: also, that's one of the things I liked about COERCE, that you have to declare the types of both sides | ||
hoelzro | granted, that's up to the person writing the method in MyType, but then can you create a coercion from MyType to the other Sin class? | ||
jnthn | moritz: For one, it'd bust the Parrot build until I port it there. And there are some spectest regressions, and so on. | ||
hoelzro | moritz: right, I'm pointing out what bothers me about the current state of affairs | 20:13 | |
moritz | jnthn: oh | ||
hoelzro | skids: thanks for the demo | ||
20:13
denis_boyun left
|
|||
moritz | the problem with COERCE(source-type, dest-type) is that it type-checks the wrong | 20:13 | |
(co vs. contra variant) | |||
dalek | ast: 8fc7d02 | usev6++ | S32-str/sprintf.t: Add test for RT #122907 |
||
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122907 | ||
moritz | uhm, no, ignore me | 20:14 | |
moritz has his head all knotted up | |||
20:14
agentzh joined
|
|||
japhb wonders what it means for a relatively compact, mostly convex structure to be knotted | 20:15 | ||
hoelzro | I don't mind implementing COERCE for people to try it out, but I don't want to spend time implementing something unless I have a fair amount of confidence that it would eventually be used | ||
hoelzro backlogs to see what TimToady said before hoelzro asked again | 20:16 | ||
PerlJam | hoelzro: such is the implementor's risk. (How else do we get implementations to vet the ideas of the spec?) | ||
hoelzro | PerlJam: point taken =) | ||
jnthn gets back to work on 6pe stuffs | 20:17 | ||
20:17
lucas left
20:18
darutoko left
|
|||
hoelzro | I just saw lizmat's comment on removing a returns trait because that routine could return a Failure, which intrigues me | 20:22 | |
the spec allows for definite return values (ex. sub mysub() returns 3 { ... }), so that mysub always returns 3... | |||
...expect (iirc) the spec *also* allows mysub to return a Failure! | |||
er, except | |||
hoelzro needs coffee | |||
lizmat | m: sub a(-->Int) { fail }; a | ||
camelia | rakudo-moar 912a7f: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in sub a at /tmp/abIECMht3v:1 in block <unit> at /tmp/abIECMht3v:1» | ||
hoelzro | I find it interesting that the spec allows Failures to sneak past the returns type in the case of definite return specifications, but not definite ones | 20:23 | |
moritz | hoelzro: does it, still? I thought that was removed | 20:24 | |
lizmat | m: sub a(-->Int:D) { fail }; a | ||
camelia | rakudo-moar 912a7f: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in sub a at /tmp/95UbbofjMN:1 in block <unit> at /tmp/95UbbofjMN:1» | ||
hoelzro | moritz: the part about definite return specifications? | ||
I see what TimToady was saying now | 20:25 | ||
it's kind of orthogonal to whether or not COERCE exists | 20:26 | ||
moritz | hoelzro: the part about allowing failure to sneak past return type declarations | ||
hoelzro | S06:672 | 20:27 | |
synopsebot | Link: perlcabal.org/syn/S06.html#line_672 | ||
hoelzro | neat, it worked =) | ||
20:27
vendethiel left
|
|||
hoelzro | end of the first paragraph | 20:27 | |
actually, that sentence implies that sneaking should happen for indefinite return specs as well | |||
moritz | and it stil points to perlcabal.org :( | 20:28 | |
tadzik: didn't I fix synopsebot? :( | |||
hoelzro | I'm guessing if any routine may return a Failure, that could muck with optimization =/ | ||
20:29
bjz joined
|
|||
hoelzro | unless we check for "fail" while compiling a sub, and annotate the code object with that information | 20:29 | |
moritz | that's why rakudo doesn't implement it | ||
hoelzro | moritz: sorry, doesn't implement which? | ||
PerlJam | hoelzro: the sneaking | ||
moritz | hoelzro: allowing failures to sneak past | ||
hoelzro | ah | 20:30 | |
just checking =) | |||
20:30
vendethiel joined
|
|||
PerlJam | See lizmat's offering to rakudo-m a few minutes ago | 20:30 | |
hoelzro | yeah, I was just questioning whether or not the spec made sense, and then after I re-read that paragraph, whether or not getting Rakudo to conform with the spec there would impact optimization | 20:31 | |
lizmat | jnthn has stated the other day, that that would be almost impossible to not have that impact performance significantly | 20:33 | |
moritz | perl6/doc htmlify.p6 doesn't work with current rakudo + current Pod::To::HTML :( | 20:34 | |
raydiak | ouch | 20:35 | |
FROGGS_ | hmmm, my code has not suffered... | ||
moritz: what's wrong? | |||
moritz | perlpunks.de/paste/show/54c2b083.700a.2b6 | ||
FROGGS_ | moritz: hmmm | ||
github.com/perl6/Pod-To-HTML/blob/...ML.pm#L161 | 20:36 | ||
looks like a rakudobug if you ask me | |||
m: my @a; say @a[*-1] | 20:37 | ||
camelia | rakudo-moar 25da7a: OUTPUT«Index out of range. Is: -1, should be in 0..Inf in method at_pos at src/gen/m-CORE.setting:9827 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2837 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2937 in block <unit> at /tmp/iskh…» | ||
FROGGS_ | star-m: my @a; say @a[*-1] | ||
camelia | star-m 2014.12: OUTPUT«Calculated index (-1) is negative, but Array allows only 0-based indexing in method gist at src/gen/m-CORE.setting:13837 in sub say at src/gen/m-CORE.setting:16595 in block <unit> at /tmp/bgxDUS6alV:1» | ||
FROGGS_ | star-m: my @a = 1; say @a[*-1] | ||
camelia | star-m 2014.12: OUTPUT«1» | ||
FROGGS_ | m: my @a = 1; say @a[*-1] | ||
camelia | rakudo-moar 25da7a: OUTPUT«1» | ||
FROGGS_ | hmmm | ||
ohh | |||
tony-o_ | does p6 build for 32b os/jvm? .. i'm getting "main" java.lang.NoClassDefFoundError on 32b but it builds fine for 64b same version | 20:38 | |
moritz | star-mm: my @a; say @a[*-1] // 0 | ||
raydiak | maybe like this one: irclog.perlgeek.de/perl6/2015-01-10#i_9916445 | ||
(the infinte array bug, that was for) | |||
moritz | star-m: my @a; say @a[*-1] // 0 | ||
camelia | star-m 2014.12: OUTPUT«0» | ||
FROGGS_ | moritz: that's it! | ||
m: my @a; say @a[*-1] // 42 | |||
camelia | rakudo-moar 25da7a: OUTPUT«Index out of range. Is: -1, should be in 0..Inf in method at_pos at src/gen/m-CORE.setting:9827 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2837 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2937 in block <unit> at /tmp/ap_2…» | ||
FROGGS_ | m: my @a; say @a[*-1].WHAT | ||
camelia | rakudo-moar 25da7a: OUTPUT«Index out of range. Is: -1, should be in 0..Inf in method at_pos at src/gen/m-CORE.setting:9827 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2837 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2937 in block <unit> at /tmp/xPuB…» | ||
FROGGS_ | star-m: my @a; say @a[*-1].WHAT | ||
camelia | star-m 2014.12: OUTPUT«(Failure)» | ||
FROGGS_ | lizmat: ^^ | ||
20:40
denis_boyun_ joined
|
|||
lizmat | FROGGS_: yes, did that behaviour change? seems ok to me | 20:40 | |
ah, you mean it throws rather than just fail ? | |||
ah, yuck | 20:41 | ||
yes | |||
argh | |||
FROGGS_ | yeah, it explodes too early | ||
lizmat | argh, why doesn't the spectest catch that :-( | 20:42 | |
this is probably something we need to do a hotfix for, I would say :-( | |||
FROGGS_ | my thought... seems we're missing a test here | ||
lizmat investigates | |||
FROGGS_ | I dunno if there is much fallout | ||
I don't think this is a too common idom | 20:43 | ||
idiom | |||
tony-o_ | does p6 build for 32b os/jvm? .. i'm getting "main" java.lang.NoClassDefFoundError on 32b but it builds fine for 64b same version | 20:44 | |
FROGGS_ | tony-o_: I have no knowledge that somebody tried it in a 32bit jvm | 20:45 | |
on* | |||
jnthn | It's the first time I've heard of a 32-bit issue | ||
bartolin | lizmat: isn't that the same thing as with the test fudged here: github.com/perl6/roast/commit/22ef35ba3f | ||
jnthn | I'm sure in the early days I built it on a 32-bit JVM | ||
tony-o_: Which OS, ooc? | |||
tony-o_ | do you want a gist? | ||
debian 7 | 20:46 | ||
jnthn | Hm, nothing unusual | ||
And no errors along the way? | |||
lizmat | bartolin: yeah, but that test is weird | ||
jnthn | Yeah, feel free to gist the build output | ||
tony-o_ | outside of that, i didn't see any fly by on my screen - it's a fresh copy of rakudo | ||
jnthn | Did the build fail with that, or it just fails to run after building? | ||
tony-o_ | the build fails with that | 20:47 | |
lizmat | FROGGS_: testing a fix | ||
ab5tract | tony-o_: i'm running a build right now | ||
20:47
denis_boyun_ left
|
|||
jnthn | tony-o_: OK, gist me the last bit of the build output. | 20:48 | |
ab5tract hadn't realized just how waysided i686 has become in gnu/linux | |||
tony-o_ | okay, i'll give you whats in the buffer and full gist when the build finishes | 20:49 | |
FROGGS_ | lizmat++ | ||
hoelzro | lizmat: what about the idea about "can fail" annotations on the code objects? would that be good enough | ||
? | |||
tony-o_ | jnthn: not much in my scrollback bufer - gist.github.com/tony-o/ca71572bc9fe0e25f28d | ||
hoelzro | oh, wait | 20:50 | |
lizmat | jnthn: what I understand of the typechecking logic, is that that would not help much | ||
hoelzro | you *could* do return $obj.could-fail() from a routine, and then you don't know | ||
jnthn | It's fine if we have some way to indicate "can't fail" and "can fail" in the returns. | 20:54 | |
It's just that anything marked as "can fail" isn't going to allow the static optimizer to trust what comes back | |||
tony-o_: What on earth... | 20:55 | ||
psch suspects badly set up jre | |||
20:55
beastd joined
|
|||
psch | tony-o_: how are you running the 32bit build? on a seperate 32bit debian? | 20:56 | |
raydiak | do we allow junctions as return type declarations? e.g. --> Int|Failure | ||
jnthn | No | 20:57 | |
raydiak | darn | ||
jnthn | That's a worse kettle of fish :) | ||
tony-o_ | psch: yea | 20:58 | |
moritz | well, at least it'd only make it worth for those routines marked as Int|Failure | ||
not for all of them | |||
psch | tony-o_: but «java -version» works? | ||
tony-o_ | psch: i have a fresh debian 7 (32b) with open jdk installed | ||
and the build fails, i'm comparing it to the same version 64b jdk installed on a different 64b installation of debian | 20:59 | ||
lizmat | is github having problems? | ||
raydiak | well all I was thinking is that I hate it when stuff like failures leak/"sneak" through by default...would rather it gets thrown before/at the return if I specified a return type which doesn't allow it | 21:00 | |
so if not junctions maybe an "is failable" pragma or something? | |||
dalek | kudo/nom: f120204 | lizmat++ | src/core/ (6 files): < 0 exceptions should fail rather than throw Spotted by FROGGS++ . Not sure of the ecosystem fallout of this: could warrant a hot fix update of the compiler release before R* ? |
||
lizmat | FROGGS_ ^^^ | 21:01 | |
moritz | lizmat++ | ||
hoelzro | raydiak: but the whole point of failures is that you can handle it at the callee, and if you don't, it croaks, right? | 21:02 | |
moritz | well, if a routine throws an exception, it avoids violating the return type contract | 21:03 | |
TimToady thinks we should replace the caller/callee terms because they're too confusing | |||
moritz | simply by not returning | ||
dalek | p/6pe: a28b48e | jnthn++ | src/vm/parrot/QAST/Operations.nqp: Map nqp:: ops for 6model parametrics on Parrot. Note they're not implemented yet. |
21:04 | |
p/6pe: 70fcb2c | jnthn++ | src/vm/parrot/ops/nqp.ops: Stub in ops. t/nqp/87-parametric-6model.t now compiles now, though of course fails. |
|||
moritz wonders if it's worth parallelizing htmlify | 21:07 | ||
writing the type documents at least should be quite easy to do | 21:08 | ||
tony-o_ | jnthn: here is the full log gist.github.com/tony-o/2b5e1f4d71311cc8756b | ||
agentzh | sorry if it's something obvious, but is it possible to precompile perl6 scripts to bytecode (or something like that) to save parsing the source? | 21:09 | |
tony-o_ | stackoverflowerror..think that might be too little memory (it has 1.5G) | ||
raydiak | hoelzro: if I'm reading things right, there are a number of ways that user code (the caller) might inadvertantly receive such an object and dumbly shove it through the pipeline, no? | ||
moritz | agentzh: no, just modules | ||
agentzh | moritz: thanks for the reply. | ||
jnthn | agentzh: Modules, yes. Scripts, no (well, more "not yet", it's on the wish list) | ||
raydiak | hoelzro: like checking the return value for definedness, or it being received in lazy list context? | 21:10 | |
agentzh | jnthn: no problem, i'll try to make my boilerplate script minimal :) | ||
jnthn | tony-o_: Well, it tends to mean specifically too little stack memory | ||
raydiak admits he has not much first-hand practice with our Failures and how they work, is just reading as he goes | 21:11 | ||
jnthn | tony-o_: That is configurable, though... | ||
hoelzro | raydiak: yeah, I think you might end up with a little bit of the "nil problem" (I call it that, because Lua uses nils for error conditions) | 21:12 | |
tony-o_ | option on the jvm or in the Configure script? | ||
dalek | c: 24ea783 | moritz++ | htmlify.p6: htmlify: fix traits. Closes #41 |
21:13 | |
21:13
vendethiel left
|
|||
moritz | tony-o_: you might need to patch tools/build/create-jvm-runner.pl and tools/build/Makefile-JVM.in | 21:13 | |
tony-o_: search for -Xss or -Xmx | 21:14 | ||
21:14
booly-yam-4652 joined
|
|||
tony-o_ | for create-jvm-runner.pl i'm only seeing it for the 'install "perl6-eval-server", "java" line - i'll check the makefile | 21:15 | |
raydiak | hoelzro: yeah precisely...what I'm hoping to avoid is that nasty feeling I get from stuff like javascript where mistakes end up making NaNs that go through and cause weird, totally unrelated errors later on and force you to bisect your pipeline to find it | ||
which admittedly is slightly different, but similar enough for my analogy (I think) | 21:16 | ||
hoelzro | do Failures describe where they come from? | ||
that would at least help | |||
moritz | jnthn: that doc commit should fix the routine-trait 404 link on doc.perl6.org you reported yesterday(-ish) | ||
raydiak | yes | ||
moritz | hoelzro: they have a backtrace | ||
raydiak | well, they wrap an exception which does | ||
hoelzro | ok, that's something =) | ||
skids | r: my $f = fail("foo"); $f; | 21:17 | |
camelia | rakudo-parrot 25da7a: OUTPUT«foocurrent instr.: 'throw' pc 501346 (src/gen/p-CORE.setting.pir:206811) (gen/parrot/CORE.setting:12506)called from Sub 'sink' pc 544716 (src/gen/p-CORE.setting.pir:222609) (gen/parrot/CORE.setting:14089)called from Sub 'MAIN' pc 396 (src/gen/pe…» | ||
..rakudo-moar 25da7a: OUTPUT«Unhandled exception: foo at <unknown>:1 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295) from src/gen/m-CORE.setting:14149 (/home/camelia/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:sink:29)…» | |||
raydiak | so the damage is mitigated, but if I already said "--> Int" somewhere earlier and still ended up with this failure thing getting out, I'd be kinda...unhappy if it was one of my first P6 experiences | ||
moritz | jnthn: erm, nope, it doesn't :( | ||
dalek | c: 0b7b112 | moritz++ | htmlify.p6: Hide link that is a 404 now |
21:18 | |
jnthn | tony-o_: On JVM, and yeah, I think the Makefile is the place to look | ||
tony-o_ | jnthn: i changed Xss from 1m to 500m , i didn't touch Xmx because the JVM doesn't get even close to that number | 21:21 | |
stil the same error | |||
moritz | tony-o_: did you reconfigure? | ||
tony-o_ | the box has over a gig of memory left when make pukes | ||
21:21
kaare_ joined
|
|||
tony-o_ | moritz: i do the configure and then change the make file | 21:21 | |
jnthn | tony-o_: Xss is the one I think, but 500m is crazy...try more like 2m or 5m | 21:22 | |
hoelzro | raydiak: I can understand that | ||
tony-o_ | jnthn: i tried 5m first with same error so i went nuts with it | ||
jnthn | tony-o_: ohh, but now I notice | ||
/home/perl6/bash-perl6-burner/wa/p6/../sixes/2014.12/bin/nqp-j | |||
It's that shell script that means an -Xss I guess | 21:23 | ||
agentzh | could anyone help with this little NQP program? gist.github.com/agentzh/dc53d8f415ac0c6a0260 I keep getting the "cannot stringify this" error. | 21:24 | |
but the equivalent works in rakudo. | |||
seems like $match<Expr><Item> is a "null object" somehow. | 21:25 | ||
moritz | agentzh: string do you pass on the command line? | ||
agentzh | i passed. | ||
tony-o_ | jnthn: same error still with 1G allocated to the nqp jvm and -Xss set to 5m | ||
moritz | agentzh: token Expr { [<Item> <ws>]+ } | 21:26 | |
agentzh: the + means that the <Item> capture is a list/array | |||
agentzh: try say($match<Expr><Item>[0]) | |||
jnthn | tony-o_: OK, then...I'm confused. :( | 21:27 | |
tony-o_ | :( | ||
moritz | agentzh: in rakudo, lists know how to coerce themselves in string context | ||
agentzh: nqp isn't that forgiving | |||
21:27
booly-yam-4652 left
|
|||
agentzh | moritz: i see, thanks! | 21:27 | |
dalek | p/6pe: 98c0b61 | jnthn++ | src/vm/parrot/ (2 files): Add parametricity bits to STable. |
||
agentzh | really like NQP's speed :) | 21:28 | |
moritz too | 21:29 | ||
though rakudo-m is also not bad | |||
agentzh | yeah, but it still has a startup hit of 200ms on my laptop :) | ||
while nqp-m is just 30ms :) | 21:30 | ||
moritz | aye | ||
tony-o_ | jnthn: we'll see if it happens on BSD 32b later too | 21:31 | |
agentzh | will try to port some of my slooow Rarse::RecDescent compilers over to nqp and rakudo. | ||
and see how it goes. | |||
moritz | lizmat: re rakudo bugfix release, that might make sense. At least Pod::To::HTML is badly broken with 2015.01. | ||
TTFN | |||
lizmat | moritz: does my fix just now, solve the problem? | 21:32 | |
moritz | lizmat: yes | ||
lizmat | then I'm afraid we'll need a hotfix release, right ? | 21:33 | |
what's the procedure for that? | |||
21:33
vendethiel joined
|
|||
moritz | lizmat: there's not much of a procedure for it | 21:33 | |
TimToady | minimally, put a new tag, and reference it | 21:34 | |
moritz | lizmat: I'd start a new branch based on the 2015.01 tag | ||
21:34
kurahaupo left
|
|||
timotimo | hello everybody | 21:34 | |
what did i miss? :) | |||
TimToady | everything! | ||
lizmat messing up a release | |||
moritz | (git checkout -b hotfix-2015.01 2015.01) | ||
cherry-pick the commit(s) you want to include | |||
lizmat | only one, fortunately | 21:35 | |
moritz | do the usual ',ale release' | ||
with 2015.01.1 as the version | |||
*'make release' | |||
and when that one works, upload the tarball, add a tag, push the tag | |||
TimToady | you're not supposed to release ale, you're supposed to consume it | ||
moritz isn't supposed to be typing, he should be sleeping | 21:36 | ||
TimToady | moritz++ for typing anyway | ||
21:36
rurban joined
|
|||
Kristien | What if it was a bot? | 21:36 | |
lizmat | will need someone else to do the upload | ||
Kristien | Or speach-to-text? | ||
Would we be doomed? | |||
agentzh | how should i check the type of an expression in NQP? | 21:37 | |
there's no WHAT() nor .WHAT in NQP it seems. | |||
tony-o_ | that's what you get with your other 170ms :-) | ||
agentzh | hehe | ||
so it's "no"? | 21:38 | ||
jnthn | There's a .WHAT, but no .gist/.Str distinction | ||
say($foo.HOW.name($foo)) # gets you the typename | 21:39 | ||
agentzh is trying. | |||
jnthn | But if you're try trying to do a type check then smartmatch should work, or nqp::istype($obj, TheType) | ||
agentzh | got it. | 21:40 | |
thanks | |||
jnthn | np | ||
21:40
xfix left
|
|||
lizmat | moritz: building on parrot and running spectest now | 21:40 | |
Kristien | I want to become a professional Perl programmer. | 21:42 | |
but I'm stuck with Python and PHP projects 3: | |||
dalek | p/6pe: 2c3db63 | jnthn++ | src/vm/parrot/ops/nqp.ops: Start porting 6pe ops to Parrot; passes 6 tests. |
||
jnthn | agentzh: ooc, what Rakudo startup hit would be low enough for it to not be annoying for you? | 21:43 | |
21:43
PZt left,
Rounin left
|
|||
PerlJam | Kristien: you have 2 options: 1) find some you can convince to pay to you code in Perl 2) start a business of your own where you use perl to solve real-world problems and people pay you for that. | 21:44 | |
:-) | |||
agentzh | jnthn: under 100ms :) | ||
jnthn | agentzh: OK :) | ||
Kristien | :v | ||
I couldn't install Parrot because I have no ICU. Does Moar depend on ICU? | 21:46 | ||
TimToady | agentzh: get a machine that's twice as fast? :P | ||
Kristien | I'll try to install Moar so I can implement my monitoring tool. | 21:48 | |
jnthn | Kristien: No, Moar doesn't depend on that. | ||
Kristien: You should also find Moar to be faster :) | 21:49 | ||
Kristien | Parrot doesn't have Proc::Async so I cannot use it anyway :P | ||
lizmat | so tagging should be something like: git tag -a -m"tag release #84" 2015.01.01 | 21:50 | |
moritz: ^^ ? | |||
moritz | lizmat: I wouldn't include #84 there | 21:51 | |
lizmat | just nn? | ||
moritz | lizmat: rather 'tag bugfix release 1 for 2015.01' or so | ||
rurban | parrot —without-icu | ||
this is even autodetected | |||
Kristien | it failed installing | 21:52 | |
because ICU was not on my machine | |||
psch | rakudo fails, not parrot | ||
Kristien | the obvious fix is installing ICU, ol | ||
rurban | I thought I had all the necessary workarounds already | ||
21:52
anaeem1_ joined
|
|||
rurban | but yes, moar has aio already, parrot not | 21:53 | |
dalek | p/6pe: 5feb90a | jnthn++ | src/vm/parrot/ops/nqp.ops: Port 3 more 6pe ops; 11/14 tests passing. |
||
rurban | jnthn++ parrot work | 21:55 | |
21:55
denis_boyun_ joined,
vendethiel left
|
|||
dalek | ast: 3a2be84 | raydiak++ | S02-lists/indexing.t: Add test for out of range index failures Tests pre-hotfix 2015.01 bug fixed by lizmat++ @ f120204aca0276564163c3bc157c0639870d5227 |
21:56 | |
lizmat | moritz: *sigh* tar building fails because of missing files in t/spec | 21:58 | |
21:59
skids left
|
|||
lizmat | moritz: is it supposed to include t/spec in the tar file ? | 21:59 | |
moritz | lizmat: yes | 22:00 | |
lizmat: rm -rf t/spec; make testable | |||
lizmat: iirc the release process replaces t/spec/ with a non-git directory, or something weird | 22:01 | ||
lizmat | $ make testable | ||
make: *** No rule to make target `testable'. Stop. | |||
:-( | |||
moritz | make t/spec | 22:02 | |
lizmat: sorry, my bulid-fu is rusty | |||
lizmat | I just reconfigured and am rebuilding | ||
ab5tract | tony-o_: rakudo compiled fine for me on i686 archlinux | 22:03 | |
dalek | p/6pe: 44e9eb2 | jnthn++ | src/vm/parrot/ops/nqp.ops: Implement interning, to pass 6pe tests. |
22:05 | |
lizmat | moritz: after make t/spec, make release still fails because of missing files | 22:09 | |
like S32-list/uniq.t | |||
22:12
denis_boyun_ left
|
|||
jnthn | lizmat: You already nuked your t/spec and got a fresh checkout of it? | 22:14 | |
22:14
vendethiel joined
|
|||
lizmat | yes | 22:14 | |
but is also complaining about missing files in src/core | |||
jnthn | o.O | 22:15 | |
22:16
denis_boyun_ joined,
jmark left
|
|||
lizmat | a stub file for the newio branch | 22:16 | |
that I removed about 2 weeks ago? | |||
src/core/IO/Locally | |||
jnthn | And it's not on disk? | 22:18 | |
lizmat | nope | ||
feels like it is somehow still at 2014.12 | 22:19 | ||
jnthn wonders where on earth it gets it from | |||
lizmat | well, the file used to exist at some point in the past | ||
ls | 22:24 | ||
I touched the missing files and got a tar now | 22:25 | ||
22:25
telex left
|
|||
lizmat | testing that tar | 22:25 | |
22:26
telex joined
22:29
mvuets joined
|
|||
Kristien | m: Duration.new(1).Real | 22:29 | |
camelia | ( no output ) | ||
Kristien | m: say Duration.new(1).Real.WHAT | 22:30 | |
camelia | rakudo-moar f12020: OUTPUT«(Duration)» | ||
Kristien | Shouldn't that be Real? | ||
lizmat | yes | ||
Kristien | Oh. Duration <: Real | ||
jnthn | m: say Duration ~~ Real | ||
camelia | rakudo-moar f12020: OUTPUT«True» | ||
Kristien | oops :P | 22:31 | |
lizmat | jnthn: but the fact that it does the role Real, should make it of that type, no? | ||
method Real(Real:D:) { self } # in Real.pm | 22:32 | ||
masak | ooh, we have literal syntax for object hashes now? | ||
squee! | |||
lizmat notices that masak does not read the p6w :-) | |||
.oO( or much later :-) |
|||
masak | I really should do that. | 22:33 | |
this was from just catching up on p6l. | |||
lizmat | jnthn: I think Duration needs it's own "method Real(Duration:D:) { self.Num } ? | 22:34 | |
*its | 22:35 | ||
jnthn | lizmat: No, it already *is* a Real | ||
lizmat: And .Real on a Real should be identity | |||
lizmat | eh. but it *does* a Real | 22:36 | |
Kristien | Cool, Promise#then doesn't autocollapse. | ||
m: my ($s, $t) = Supply.new, Supply.new; my ($p, $q) = $s.Promise, $t.Promise; my $x = $p.then({ $q; }); $t.emit(3.14); $s.emit(42); say ($x.result.WHAT, $x.result.result.WHAT) | |||
jnthn | m: say 42.Real.WHAT | ||
camelia | rakudo-moar f12020: OUTPUT«(Promise) (Rat)» | ||
rakudo-moar f12020: OUTPUT«(Int)» | |||
22:37
denis_boyun_ left
|
|||
lizmat | jnthn: ah, ok | 22:37 | |
Kristien | JS promises typically do, making it impossible to write generic code. | ||
lizmat | I guess there's more cases like that :-) | ||
jnthn | Kristien: That'd be a bit...magical...for my liking :) | ||
lizmat | Kristien: not much of a promise then :-) | ||
jnthn: ok, so Duration.Real -> Duration | |||
jnthn | lizmat: Yes | 22:38 | |
lizmat | gotcha | ||
jnthn | Dammit. r-p does a SEGV in the 6pe-mop branch :( | ||
dalek | p/6pe: 91f6f52 | jnthn++ | src/vm/parrot/6model/serialization.c: Port basic 6pe serialization to Parrot. |
22:39 | |
lizmat | ok, tar file built ok, spectested ok (complaned a bit about missing test files, but there you go) | 22:40 | |
22:42
rurban left
|
|||
jnthn gets a busted stack in the debugger also. wtf. | 22:48 | ||
22:49
ajr joined
22:50
ajr is now known as Guest18017,
Guest18017 is now known as ajr_
|
|||
Kristien | RxP6 would be fun to see. | 22:51 | |
jnthn | Kristien: That's basically what Supply is :) | ||
Note the *whole* Rx, but the observer bit and a bunch of the combinators. | 22:52 | ||
FROGGS_ | Not* | ||
jnthn | uh, yes | ||
FROGGS_ | :o) | ||
Kristien | Yeah. | ||
22:52
adu left
|
|||
dalek | kudo/6pe-mop: 432c65a | jnthn++ | tools/build/Makefile-Parrot.in: Add CoercionHOW into the r-p Makefile. |
22:53 | |
Kristien | ok let's use Supply instead of Channel for the ping monitor | ||
Whooo it works shiny | 22:54 | ||
ab5tract | Kristien: can i see? :D | 22:57 | |
dalek | kudo/hotfix-2015.01: f0b3a47 | lizmat++ | src/core/ (6 files): < 0 exceptions should fail rather than throw Spotted by FROGGS++ . Not sure of the ecosystem fallout of this: could warrant a hot fix update of the compiler release before R* ? |
||
Kristien | ab5tract: gimme a sec, fixing one more thing | ||
FROGGS_ | also spotted by moritz++ | 22:58 | |
lizmat | Hotfix release is now on rakudo.org: rakudo.org/downloads/rakudo/ | ||
FROGGS_++ for helping out | 22:59 | ||
23:01
doobi-sham-25434 joined
|
|||
dalek | Heuristic branch merge: pushed 16 commits to rakudo/newio by lizmat | 23:01 | |
lizmat | and on that note, I'm going to call it a night | ||
raydiak | good night lizmat++ | 23:02 | |
FROGGS_ | gnight lizmat | 23:03 | |
I really love precomp... the libxml tests take 5s precomp'd instead of 28s :o) | 23:05 | ||
23:07
FROGGS_ left,
ptc_p6 left
|
|||
jnthn | 'night, lizmat | 23:08 | |
Hm, think I'll consider myself done for the day also :) | 23:09 | ||
japhb | o/ | 23:10 | |
23:11
anaeem1_ left
|
|||
TimToady | but the night is yet young! | 23:11 | |
japhb | The night is not yet night! | ||
jnthn | Not in this timezone :P | 23:13 | |
geekosaur | it's pretty night here... | 23:15 | |
23:17
japhb left
|
|||
dalek | Heuristic branch merge: pushed 17 commits to nqp by jnthn | 23:18 | |
jnthn merged 6pe in nqp | |||
All backends pass the new test file there now, so no longer a need to keep it out of master. :) | |||
TimToady | \o/ | ||
jnthn | 6pe-mop in Rakudo could be a while longer; we'll see. | 23:19 | |
TimToady | If it's turtles all the way down, we'll hope it's hares all the way up. | ||
jnthn | :) | 23:20 | |
23:21
ajr_ left
23:23
spollei joined
23:24
japhb joined,
beastd left
|
|||
Kristien | Is there a pastebin with Perl 6 syntax highlighting? | 23:26 | |
23:26
doobi-sham-25434 left
|
|||
Kristien | Ah, pastebin.com | 23:26 | |
ab5tract: pastebin.com/udu7qCiK | 23:27 | ||
23:27
rurban_ left
|
|||
japhb | What are they using for Perl 6 highlighting? | 23:29 | |
psch | m: say "1241.12512" ~~ / \d ** 2 % '.'/ | ||
camelia | rakudo-moar f12020: OUTPUT«「1.1」» | ||
psch | m: say "1241.12512" ~~ / [\d+] ** 2 % '.'/ | 23:30 | |
camelia | rakudo-moar f12020: OUTPUT«「1241.12512」» | ||
psch | m: say "1241.12512" ~~ / \d+ ** 2 % '.'/ | ||
camelia | rakudo-moar f12020: OUTPUT«===SORRY!===Quantifier quantifies nothingat /tmp/nojLF2Ee6_:1------> say "1241.12512" ~~ / \d+ ** 2⏏ % '.'/Missing quantifier on the left argument of %at /tmp/nojLF2Ee6_:1------> say "1241.12512…» | ||
japhb | m: say "1241.12512" ~~ / \d+**2%'.'/ | ||
camelia | rakudo-moar f12020: OUTPUT«===SORRY!===Quantifier quantifies nothingat /tmp/0a7ESU76WQ:1------> say "1241.12512" ~~ / \d+**2⏏%'.'/Missing quantifier on the left argument of %at /tmp/0a7ESU76WQ:1------> say "1241.12512" ~~…» | ||
TimToady | gotta use brackets there | 23:31 | |
japhb | OOC, why? | ||
TimToady | the **2 doesn't really know the % is coming :) | 23:32 | |
23:32
panchiniak left
|
|||
TimToady | maybe it could be taught | 23:32 | |
but it's not clear that it would be clearer | 23:33 | ||
for the rest of regex, one atom and one quantifier is a pretty strong self-clocking feature | 23:34 | ||
japhb | Fair enough | ||
Kristien | m: class A { has Proc::Async $.proc; }; say A.new.proc.WHAT; | 23:38 | |
camelia | rakudo-moar f12020: OUTPUT«Proc::Async is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting:1 in method gist at src/RESTRICTED.setting:33 in sub say at src/gen/m-CORE.setting:16915 in block <unit> at /tmp/iMGvfWdSua:1» | ||
Kristien | m: class A { has Supply $.proc; }; say A.new.proc.WHAT; | ||
camelia | rakudo-moar f12020: OUTPUT«(Supply)» | 23:39 | |
Kristien | Hmm, interesting. | ||
jnthn | TimToady: Not sure the **2 not knowing the % is coming is the issue, it's more than the + was the quantifier, and the **2 then has nothing to quantify. | 23:41 | |
('cus we're onto the next atom by then) | |||
masak | er. | ||
std: /a+ +/ | |||
camelia | std f9b7f55: OUTPUT«===SORRY!===Quantifier quantifies nothing at /tmp/kwR60Sa920 line 1:------> /a+ +⏏/Check failedFAILED 00:00 135m» | ||
masak | ok, that seems to be the way it actually works. | 23:42 | |
fancy that. | |||
jnthn has spent some time in the grammar that parses it :P | |||
masak | :) | ||
I bet I used to know that. I once re-implemented PGE. | |||
jnthn | Well, but PGE didn't use a Perl 6 grammar to parse its regexes, iirc? | ||
masak | no, it used an expression parser with parameterized ops. | 23:43 | |
23:48
muraiki_ joined,
adu joined
23:49
spider-mario left
|
|||
jnthn | 'night, #perl6 | 23:52 | |
masak | 'night, jnthn | 23:53 |