»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by sorear on 25 June 2013. |
|||
lizmat | hoelzro, will do a spectest | 00:00 | |
ah, roast :-) | 00:01 | ||
hoelzro | lizmat: let me know if you find any failures | ||
if you're running with the master roast, you should only see a few under S26-documentation, but that's to be expected | 00:02 | ||
lizmat | I see none, only one flapper | 00:06 | |
dalek | kudo/nom: ce0c258 | TimToady++ | src/core/ListIter.pm: Reify lists with correct count. The ListIter reify called p6arrfindtypes with $max (which is 100000), but should be using $count, how many we really want. Fixes RT #122604. |
00:07 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122604 | ||
TimToady | PerlJam: ^^ | 00:08 | |
TimToady doesn't remember his RT login—if he ever had one—so someone else can close or test-needed it. | 00:17 | ||
00:18
BenGoldberg joined
00:20
danaj joined
|
|||
danaj | TimToady: I don't have a bug ref, I should test again and file if still there with latest github. | 00:22 | |
TimToady | have a small test case I can try? | ||
danaj | TimToady: The issue was: take an example like rosettacode.org/wiki/Count_in_factors#Perl_6 and when run from a file, everything was fine. When running perl6 then typing at the prompt, the first line hangs. | 00:23 | |
I had this happen on multiple machines, with Ubuntu perl6 or self-built, with all 3 back ends. | |||
TimToady | that is probably because the REPL is trying to evaluate it to print out the value. | ||
and because the ... * is embedded in parens, it doesn't realize it's infinite | 00:24 | ||
danaj | Sounds like a feature request rather than bug then. | ||
TimToady | well, we really ought to have a version of eager evalution that "gets tired" quickly :) | 00:25 | |
lizmat | t/spec/S02-types/array.t fails | ||
TimToady | so yeah, it's really kind of a feature request | ||
hoelzro | lizmat: should I go ahead and merge, then? | ||
TimToady | lizmat: so it does, hmm, could be my fault | ||
lizmat | it's the only commit between working and not working :-) | 00:26 | |
m: my @a = 1..*; @a[Inf] = "dog" | 00:27 | ||
camelia | rakudo-moar ef54ae: OUTPUT«Cannot index Array with Inf in method assign_pos at src/gen/m-CORE.setting:8996 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2511 in block <unit> at /tmp/njESZ2fALS:1» | ||
danaj | I hate how I get all excited at conferences and have a big list of things I'm eager to work on, then get home and .... blah. | ||
lizmat | TimToady: it tickles something in Test.pm, throws_like | 00:29 | |
TimToady | that's the error I get locally too | ||
dunno why Test gets a different error | |||
BenGoldberg | Here's an evalbot feature request: Filter the errors, so that src/gen/m-CORE.setting gets changed to some http:// thing, so I can click on it and go from IRC to whatever :) | 00:30 | |
TimToady | but of the two errors, I suspect the one I just fixed is more important :) | 00:31 | |
BenGoldberg | danaj, to renew your excitement, maybe you should drink more caffiene? | ||
TimToady | danaj++ for good intentions anyway :) | ||
lizmat | TimToady: the test is checking specific values in the exception object | ||
if I take the extra check out, it passes | |||
TimToady wonders if a count of Inf is coming in rather than Whatever | 00:32 | ||
BenGoldberg | danaj, To make that rosettacode example work from the REPL, try adding a 1; to the end of the first line, right after the *); | ||
lizmat | seems like the check on aggregate => 1..* is causing the problem | 00:33 | |
TimToady | maybe need a specific test for Inf in there somewhere | 00:35 | |
00:36
aborazmeh left
|
|||
TimToady | I really think we oughta teach .gist to give up after a while on long lists--that's why it's called "gist", after all | 00:36 | |
BenGoldberg | m: (1..*).gist.say | 00:37 | |
camelia | rakudo-moar ce0c25: OUTPUT«1..Inf» | ||
TimToady | m: constant @primes = grep &is-prime, 2, (3, 5, 7 ... *); say @primes | ||
camelia | rakudo-moar ce0c25: OUTPUT«(timeout)» | ||
BenGoldberg | m: constant @primes = grep &is-prime, 2, (3, 5, 7 ... *); say @primes.gist | 00:38 | |
m: constant @primes = grep &is-prime, 2, (3, 5, 7 ... *); say @primes.gist | |||
TimToady | say already does .gist | ||
BenGoldberg | Oh, nmind. | ||
TimToady | but gist isn't really giving you the gist of it... | ||
camelia | rakudo-moar ce0c25: OUTPUT«(timeout)» | ||
btyler | .tell colomon I added added 'dump directly into P6 data structures' and made that behavior the default for 'from-json'. I'm debating tossing the heap of code for letting jansson objects kinda-sorta behave like P6 ones (that is, aside from what's needed to convert) | ||
yoleaux | btyler: I'll pass your message to colomon. | ||
TimToady | except for the "this is really long" part of the information :) | ||
lizmat | maybe we should limit gists to 140 characters :-) | 00:40 | |
dalek | ast: ad7a578 | (Elizabeth Mattijsen)++ | S02-types/array.t: Fix fragile test |
00:46 | |
flussence | a .gist(:$length) would make some sense, doesn't have to be exact either (.gist itself isn't exact after all) - just make it elide stuff more aggressively after that many characters pass. | 00:47 | |
00:48
xenoterracide joined
|
|||
lizmat | flussence: "=item length | 00:48 | |
This word is banned in Perl 6. You must specify units. | |||
flussence | okay, you got me there :) | 00:49 | |
awwaiid | slots | ||
flussence | .oO( $elasticity? ) |
||
lizmat | :chars probably | 00:50 | |
:tweet maybe ? | |||
:-) | |||
00:58
kurahaupo joined
|
|||
btyler | .tell colomon ok, I suppose the debate about whether to keep the emulation code was premature: on -really- big JSON blobs (~180M) keeping the data in jansson-land is radically faster (14 second parse time vs long enough that I gave up, around the 10 minute mark) | 01:02 | |
yoleaux | btyler: I'll pass your message to colomon. | ||
btyler | but this is a great opportunity to take the profiler for a spin :) | 01:03 | |
hoelzro | has anyone run the spectest on the JVM recently? | 01:05 | |
oh, nvm | |||
I thought it was hanging | |||
is there a way for a role to require a consuming class to provide certain methods? | 01:13 | ||
as a sort of way to document what interface consumers of that role will provide? | |||
01:15
raiph joined
|
|||
lizmat | in the role: method required-method-name { ... } ? | 01:17 | |
01:17
dayangkun joined
01:18
FROGGS_ joined
01:19
Sqirrel left
|
|||
hoelzro | that's kind of what I figured | 01:20 | |
01:20
Sqirrel joined
01:21
FROGGS left
01:31
aborazmeh joined
|
|||
lizmat | shutting down, decommute in 30 mins& | 01:34 | |
01:34
lizmat left
01:35
kurahaupo left
01:37
aborazmeh left
01:51
ardeshir joined
01:57
mberends left
02:07
chenryn joined
02:09
colomon joined
02:20
kurahaupo joined
02:34
jack_rabbit joined
02:36
BenGoldberg left
02:39
noganex_ joined
02:42
noganex left
02:43
grondilu left
02:51
bjz left
03:08
jack_rabbit left
|
|||
colomon | btyler++ | 03:14 | |
yoleaux | 00:38Z <btyler> colomon: I added added 'dump directly into P6 data structures' and made that behavior the default for 'from-json'. I'm debating tossing the heap of code for letting jansson objects kinda-sorta behave like P6 ones (that is, aside from what's needed to convert) | ||
01:02Z <btyler> colomon: ok, I suppose the debate about whether to keep the emulation code was premature: on -really- big JSON blobs (~180M) keeping the data in jansson-land is radically faster (14 second parse time vs long enough that I gave up, around the 10 minute mark) | |||
colomon | btyler: Today I wandered back to working on the JSON::Tiny version of my code. Given your changes today, though, I'll probably take another stab at jansson very soon. | 03:16 | |
btyler: (Basically I'm trying to balance changes to my $work testing scheme (which relies on p6 and JSON) with actually making forward progress in the non-testing areas of $work. :) ) | 03:17 | ||
03:23
kurahaupo left
03:27
kaare_ joined
03:46
ingy left,
ingy joined
|
|||
dalek | ecs: 84550b3 | (Rob Hoelz)++ | S26-documentation.pod: Document how S26 behaves regarding roles |
03:47 | |
ecs: 404f1ea | (Rob Hoelz)++ | S26-documentation.pod: Clarify leading block declarative comments |
|||
03:59
[Sno] left
04:03
hagiri joined
04:05
rindolf joined
04:14
raiph left
04:17
kaare_ left
04:20
xinming left
04:21
xinming joined
04:29
beastd left
04:30
anaeem1 joined
04:32
anaeem1 left,
xenoterracide left
04:38
ardeshir left
04:42
mr-foobar left,
chenryn left
04:48
kaare_ joined
04:59
chenryn joined
05:05
anaeem1 joined
05:14
ecocode joined
05:16
hagiri left
05:19
kuroseki is now known as Salai
05:22
chenryn left
05:26
chenryn joined
05:32
gfldex joined
05:47
ecocode_ joined
05:48
ecocode left
05:52
[Sno] joined,
kaleem joined
05:58
gfldex left
06:01
SamuraiJack joined
|
|||
TimToady | added a more performant version of rosettacode.org/wiki/Iterated_digit...ing#Perl_6 | 06:02 | |
takes good advantage of the jit, except that div doesn't seem to jit fully yet | 06:03 | ||
anyway, does the first million in about 5 seconds, and 100 million to 586 seconds (slight slowdown due to heat throttling, probably) | 06:05 | ||
which is respectable, if not quite in the same ballpark as D yet | 06:06 | ||
TimToady used the profiler heavily to get it this fast :) | |||
moritz wonders if the profiler can be (ab)used for test coverage reporting | 06:08 | ||
TimToady | this problem would parallelize to multiple cores pretty easily | ||
well, maybe some of the same apparatus would be useful in that regard | 06:09 | ||
but probably only for the bits written in Perl 6 or nqp; it wouldn't really tell you much about the C code's coverage underneath | 06:10 | ||
06:10
anaeem1 left
|
|||
moritz | nor would I be very interested in that | 06:10 | |
TimToady | and test coverage is only going to tell you about code that is written, not code that should've been written but wasn't :) | 06:11 | |
06:11
anaeem1 joined
|
|||
TimToady | so it won't get you spec coverage | 06:11 | |
at one point we were referencing tests back to the specs, but that has bitrotted | 06:12 | ||
moritz | I was more thinking about evaluating test coverage of modules | ||
TimToady | though I guess there are a lot of valid backlinks from the tests into the specs that show up online | 06:14 | |
yes, that might be a good sort of tool to have | |||
though it only gets you so far there too, since they might run code but test the wrong thing, like we were arguably doing before dies_ok turned into throws_like | 06:17 | ||
have to test both the happy paths and the sad paths, and there's a lot of overlap | 06:18 | ||
dalek | c: bf04937 | moritz++ | lib/Language/traps.pod: [traps] add a SUBTITLE |
06:26 | |
c: d444665 | moritz++ | lib/Type/IO/Path.pod: fix pod error |
|||
06:39
kurahaupo_ left
|
|||
dalek | c: ce7613f | moritz++ | htmlify.p6: [htmlify] only process .pod files in particular, do not process .Foo.pod.swp files, which are not valid UTF-8 |
06:41 | |
c: e83e69e | moritz++ | lib/Type/IO/Path.pod: [IO::Path] remove TODO comment it was intefering with pod parsing; probably because I messed it up. |
|||
TimToady | you know, even without support for native pointers, it wouldn't be all that hard to get the compiler to notice $native op EXPR and get it to desugar to $native = $native op EXPR for us | 06:46 | |
$native op= expression, I meant to say | 06:47 | ||
where that's presumably declared 'my int $native;' or so | 06:48 | ||
and once you've done that, it's not so hard to desugar ++$native into the same thing | |||
that's probably a nice NQLHF for someone to tackle | 06:49 | ||
anyway, that would make a lot of our native code a lot prettier | 06:53 | ||
TimToady -> zzz however... & | |||
moritz tries to profile htmlify in perl6/doc | |||
runtime without profilinging: 6m16s | |||
ecocode_ | since we can call perl5 code from perl6 (seen on yapceu talk) ... does it mean we can parallelize perl5 code ? | 06:54 | |
moritz | ecocode_: do you mean call out to a perl5 interpreter, or the p5 reimplmentation in rakudo? | 06:56 | |
TimToady | the lightning talk was about embedding a real P5 | 06:57 | |
and then embedding a real Python inside that... | |||
moritz | and it worked? (ish) | ||
TimToady | yes | ||
moritz | wow | ||
how did that? | |||
*who | 06:58 | ||
and how did they do it? | |||
TimToady | nativecall to p5 embedding interface | ||
and Inline::Python for the other, iirc | |||
ecocode_ | yep, as in the lightning talk, but I would see more interesting stuff if we could parallelize p5 in p6 ;) | ||
moritz | ecocode_: then it probably comes with all the usual gotchas you get when you embed p5 in a multi-threaded app | 06:59 | |
ecocode_ | I'm especially thinking about (easy) parallelizing of website scraping | ||
TimToady | you could, potentially, start up separate Perl interpreters, one per P6 thread, which was diakopter's plan | ||
but if P5 can call into P6, then you get all of P6's concurrency, as long as it gets marshalled back to a single P5 | |||
moritz | TimToady: re =op with natives, one thing that makes this non-trivial is that method infixish does not actually see its LHS arg | 07:01 | |
TimToady: so it must be done either in the level above, or in a tree transformation afterwards | |||
TimToady | has to be done at the reduction | ||
07:01
darutoko joined
|
|||
moritz | TimToady: so method EXPR? | 07:02 | |
TimToady | STD had ways to hook things to that reduction in EXPR, dunno if rakudo does | ||
07:03
zakharyas joined
|
|||
ecocode_ wishes HTML::TreeBuilder and HTML::TableExtract get ported to p6 | 07:03 | ||
TimToady | could be done in a later pass as well | ||
TimToady isn't zzz'ing very well here... :) | |||
moritz noticed | |||
TimToady | is okay, only have to get up to make coffee for the in-laws and bid them adieu, then I could sleep more tomorrow :) | 07:04 | |
moritz | profiling htmlify.p6 OOMed after 12m25s | 07:06 | |
(presumably during profiling report generation; it completed the processing successfully) | |||
07:06
avuserow left
|
|||
TimToady | ah, it was _reducecheck | 07:09 | |
used by ??!! and by .= | |||
it would appear that rakudo also supports a reducecheck | 07:10 | ||
moritz | the special cases //=, infix does etc. are all in method EXPR | 07:12 | |
07:13
djanatyn1 is now known as djanatyn
|
|||
TimToady | not sure that's the right place to do such transformations, if we want to support an AST that is closer to the original language, as masak++ wants | 07:13 | |
07:15
avuserow joined
|
|||
TimToady | though I suppose he might decide he wants a certain amount of desugaring before his AST sees it | 07:15 | |
masak: ^^ talking about where to desugar op= wrt your AST notions | |||
as a higher-order function, op= has to know about both lvalues and rvalues, but we don't have native lvalues (yet) so we're wondering where the right place to do the rewrite is, assuming we want to work around the absence of lvalue natives | 07:19 | ||
if it's going to be handled later longterm, I'm a bit suspicious of handling it before your AST | 07:20 | ||
though I suppose it merely degenerates to the ordinary op= handling in that event | 07:21 | ||
but we could have people depending on native-ish macros that assume the transformation has been done for them | 07:22 | ||
and then we'd be breaking htat | |||
*th | |||
rindolf | TimToady: hi, are you feeling better? | 07:26 | |
07:30
kurahaupo joined
|
|||
nine_ | Should I use p5_ or perl5_ as prefix for the helper C functions in Inline::Perl5? | 07:33 | |
moritz has no idea, but can point nine_ to doc.perl6.org/type/IO%3A%3APath (in a totally unrelated matter) | 07:35 | ||
nine_ | moritz++ cool! | 07:36 | |
nwc10 | has the #perl6 hive mind yet identified why rel2abs is such a big number in the profile for startup | ||
moritz | nine_: not complete yet, but should be enough to get you started | 07:37 | |
nine_ | moritz: a great start in any case! | 07:39 | |
07:41
_thou left
|
|||
moritz decides that the native =op rewriting rabbit hole is too deep for him atm | 07:42 | ||
nine_ | Btw. the type graphs could be included directly in the page source instead of converted to PNG. One would only use IE < 9 and Android browser < 4 but gain working links and improved rendering. | 07:43 | |
s/would only use/would only lose/ | |||
sergot | o/ | 07:45 | |
moritz | nine_: you mean as embedded SVG? | ||
if yes, there are two problems with that: 1) I never got it to work relibably and 2) it only works in XHTML, but doc.perl6.org is html5 | 07:46 | ||
nwc10 | all spectests pass | 07:49 | |
\o/ | |||
ship it! | |||
nine_ | moritz: SVG is actually part of HTML5: www.w3.org/TR/html5/embedded-content-0.html#svg | 07:52 | |
moritz | nine_: wow, things have progress in the last few years :-) | ||
07:53
kurahaupo left
|
|||
nine_ | moritz: at $work we are currently replacing rendered pie and bar charts with inline SVG to gain animatability and styleability. It is really a good time to be in web business right now :) | 07:54 | |
moritz | now I just have to figure out how to get raw HTML through Pod::To::HTML | 07:59 | |
08:00
donaldh joined
|
|||
dalek | kudo/nom: cdf80c7 | moritz++ | src/core/Pod.pm: Add Pod::Raw type it is not hooked up to the parser, but can be used to communicate raw HTML to Pod::To::HTML |
08:14 | |
08:24
mathw left
08:53
chenryn left
08:57
fhelmberger joined
08:59
chenryn joined
09:02
kjs_ joined
09:14
aindilis joined
|
|||
nine_ | How do I write a destructor in Perl 6? | 09:14 | |
moritz | you don't :( | 09:15 | |
09:16
_thou joined
|
|||
nine_ | moritz: not planned or not yet implemented? | 09:16 | |
moritz | nine_: not yet implemented | 09:17 | |
nwc10 | nine_: but also, destructors happen at $whenever in the future, but I assume that you knew that | ||
("proper" GC, not refcounting) | |||
nine_ | nwc10: yep. As long as it would run some time before exit it would be fine. | 09:20 | |
09:20
_thou left
09:22
kaleem left
|
|||
mrf is asuming that after release of 6.0.0 perl6 will be installable via apt? | 09:23 | ||
nwc10 | why wait that long? | 09:24 | |
This is perl6 version 2013.12 built on parrot 5.9.0 revision 0 | |||
That's what current Ubuntu ships | |||
mrf | nwc10: is there a private repo that has perl6 on moarvm? | ||
nwc10 | that however is about 8 months out of date | ||
mrf: I'm not aware of one, and I'd love someone (else) to make it. | |||
(That isn't a "well volunteered", unless you'd enjoy doing it) | 09:25 | ||
mrf | can't say I have ever looked into making a dist repo sorry | ||
moritz consider taking the bait | |||
nwc10 | yay! | ||
09:25
kaleem joined
|
|||
mrf | having a bleed-repo and a "stable-ish" repo would make things easier for early adopters (vs download tar && make && make install etc) | 09:26 | |
nwc10 | totally agree. I don't have time to help make this happen. | 09:27 | |
09:28
mathw joined
|
|||
mrf | thats cool more a suggestion that a demand | 09:28 | |
09:37
darutoko left,
darutoko joined
|
|||
nine_ | I just realized that when I read Perl 6 documentation, I read it with jnthns voice in my head. | 09:38 | |
mrf | is anyone able to give me a very top level reason why running perl6 -e 'say "foo"' is noticably slower than perl -E 'say "foo"' | 09:39 | |
I assume this is due to VM startup time | |||
moritz | mrf: it is also due to perl 6 loading a full object system | ||
nwc10 | mrf: compare with perl -MMoose -E 'say "foo"' and it's closer | ||
it's not so much VM startup time, as VM loading all the built in stuff | 09:40 | ||
(strictly) | |||
but, as an end user, "VM startup" vs "default stuff" isn't a useful distinction | |||
it's like "I don't care that it's TalkTalk's fault. A&A, please make my ADSL work again" | |||
also, making the time smaller is being worked on. | |||
mrf | nwc10: that is a fantastically American metaphore :D | 09:41 | |
cool. Despite language speed dick waving being rather pointless, comparisons to other language load times do seem to be important to business people | 09:42 | ||
I see perl6 likely to be competing in the same market as things like Go | 09:43 | ||
moritz | you mean, concurrent network stuff? | 09:46 | |
I tend to see Perl 6 more as a general-purpose language, with some focus on text processing (think grammars), and the tools to make big applications possible | 09:47 | ||
mrf | indeed. Go is being suggested to replace the use of Python as well as C++ for both networking and general purpose scripting | 09:49 | |
09:50
spider-mario joined,
anon joined
09:51
spider-mario left,
woolfy joined
09:55
spider-mario joined
10:02
ggoebel11111119 joined
10:06
ggoebel11111118 left
|
|||
nwc10 | mrf: startup time is a very easy thing to measure, and to think is important. So it's useful to at least "not be the slowest" | 10:09 | |
mrf | nwc10: I think its probably more important for any language a user expects to run on the command line. | 10:12 | |
nwc10 | yes. and there's quite a lot of Perl used on command lines | 10:13 | |
mrf | indeed | 10:15 | |
to be fair its not a huge slowness but it is definately noticable in very short -e examples | 10:16 | ||
10:17
Ven joined
|
|||
anon | java is much slower, if you talk about startup time | 10:17 | |
mrf | but you almost never run java as a command line tool. So it gets hidden in the "This compiled app is slow to start" | 10:18 | |
nine_ | Well it's about 90 times slower than perl 5 so it's probably not gonna replace perl5 in tight shell script loops... But other than that it's quite ok. | ||
anon | aye | 10:19 | |
10:20
telex left
10:22
telex joined
|
|||
masak | oh hai #perl6 | 10:30 | |
Ven | o/ | 10:36 | |
10:46
spider-mario left
10:50
SamuraiJack left,
SamuraiJack_ joined
|
|||
timotimo | o/ | 10:57 | |
10:58
BizarreCake joined
10:59
FROGGS_ is now known as FROGGS
|
|||
FROGGS | o/ | 10:59 | |
nwc10 | aren't we getting a bit unbalanced here? | 11:00 | |
timotimo | someone's trying to rock the boat | ||
11:00
spider-mario joined
|
|||
moritz | \\\o | 11:01 | |
FROGGS | \ohh n\oes! | ||
damn | |||
we cannot escape! | |||
11:04
_thou joined
11:07
Ven left
11:09
_thou left
|
|||
sergot | .tell hoelzro How do you imagine UA as a middleware? :) | 11:11 | |
yoleaux | sergot: I'll pass your message to hoelzro. | ||
sergot | .seen hoelzro | ||
yoleaux | I saw hoelzro 01:20Z in #perl6: <hoelzro> that's kind of what I figured | ||
dalek | c: f2d8873 | moritz++ | htmlify.p6: embed typegraph SVG directly into the HTML because we can. nine++ |
11:12 | |
moritz | so much yak shave, so little time. | ||
.tell Mouq FYI, perl6/doc htmlify.p6 now needs latest rakudo + latest Pod::To::HTML | 11:13 | ||
yoleaux | moritz: I'll pass your message to Mouq. | ||
mrf | does perl6 do compile time type checking if types are used? | 11:14 | |
11:14
akaseki joined
|
|||
moritz | mrf: where it can, yes | 11:14 | |
mrf: and where it's implemented, that is | 11:15 | ||
m: say 'alive'; sub f(Str $x) { }; f 42 | |||
camelia | rakudo-moar cdf80c: OUTPUT«===SORRY!=== Error while compiling /tmp/jfPuVLG298Calling 'f' will never work with argument types (int) Expected: :(Str $x)at /tmp/jfPuVLG298:1------> say 'alive'; sub f(Str $x) { }; ⏏f 42» | ||
moritz | that's a compile-time error, the "say 'alive'" is never executed | ||
OTOH: | |||
m: say 'alive'; my Str $x = 42; # only caught at run time | 11:16 | ||
camelia | rakudo-moar cdf80c: OUTPUT«aliveType check failed in assignment to '$x'; expected 'Str' but got 'Int' in block <unit> at /tmp/ldqoA6bRHC:1» | ||
moritz | that one would be possible to catch at compile time too | ||
11:16
Salai left
|
|||
mrf | i have method foo (Str $bar){} method bar {$.foo(1)} which doesn't seem to have compile time checks | 11:17 | |
moritz | mrf: method calls are polymorphic, so it's much harder to check statically | ||
mrf: after all, self could be an instance of a subclass, where foo has a more permissible signature | 11:18 | ||
mrf | moritz: How is that handled in a strictly types language? | ||
moritz | mrf: they throw an error anyway | 11:19 | |
mrf | ahh | ||
moritz | mrf: because they check the nominal type, not the runtime (actual) type | ||
sergot | ==> Testing OpenSSL | 11:20 | |
t/01-basic.t .. 1/9 Internal error: invalid thread ID in GC work pass | |||
ohoh, what is this? | |||
mrf | moritz: cheers. That makes sense | 11:21 | |
11:22
Ven joined
|
|||
sergot | this was like: i.imgur.com/kzRmuyw.gif | 11:23 | |
hoelzro | sergot: this is kind of what I had in mind: gist.github.com/hoelzro/671912c49b0efcc8d2aa | 11:33 | |
yoleaux | 11:11Z <sergot> hoelzro: How do you imagine UA as a middleware? :) | ||
11:33
xinming left
11:34
xinming joined
|
|||
sergot | hoelzro++ | 11:35 | |
it looks nice! | |||
11:38
Alula_ left
|
|||
timotimo stealthily published a p6weekly | 11:50 | ||
11:51
chenryn left
11:52
Alula_ joined
|
|||
hoelzro | sergot: thanks =) | 11:52 | |
11:53
Ven left
11:54
anon_ joined,
BizarreCake left
11:56
anon left,
anon_ is now known as anon
|
|||
sergot | m: say ::; | 12:04 | |
camelia | rakudo-moar cdf80c: OUTPUT«PseudoStash.new("\$!", Nil, "\$/", Nil, "\$_", Nil, "GLOBALish", GLOBAL, "EXPORT", EXPORT, "\$?PACKAGE", GLOBAL, "::?PACKAGE", GLOBAL, "\$=pod", Array.new(), "!UNIT_MARKER", !UNIT_MARKER, )» | ||
12:07
darutoko- joined
12:08
Alina-malina left
12:10
darutoko left
|
|||
anon | timotimo: the link about "Perl 6 in Context" is wrong? | 12:11 | |
12:11
Sqirrel left
|
|||
timotimo | it is? | 12:12 | |
one sec | |||
indeed | 12:13 | ||
updated | |||
anon | great | 12:14 | |
sergot | how to check if one has included a module using use/require? I want to perform an action on whether one wrote 'use MODULE;' or not. | 12:16 | |
m: ::IO::Socket::INET | 12:17 | ||
camelia | ( no output ) | ||
timotimo | sergot: you can have an our sub EXPORT | ||
sergot | m: use Pod::To::HTML; ::Pod::To::HTML | 12:18 | |
camelia | rakudo-moar cdf80c: OUTPUT«===SORRY!===Could not find Pod::To::HTML in any of: /home/p6eval/rakudo-inst-2/languages/perl6/lib, /home/p6eval/rakudo-inst-2/languages/perl6» | ||
timotimo | but it's hard to have a "export was not called" thing going on | ||
as the mainline will be executed before the EXPORT sub ... | |||
sergot | timotimo: I want to make IO::Socket::SSL as an optional dependency in HTTP::UserAgent, so it should print "hey, write 'use IO::Socket::SSL' to turn on SSL connections" or something. | 12:19 | |
timotimo | ah, so only if the user writes "use IO::Socket::SSL; use HTTP::UserAgent" should it even try to load IO::Socket::SSL? | 12:20 | |
sergot | or, make HTTP::UserAgent include IO::Socket::SSL if it is installed. | ||
timotimo: yes | |||
timotimo | "if it is installed" is much easier | ||
sergot | And even better in this case I think :) | ||
timotimo | m: my $res = try require IO::Socket::SSL <IO::Socket::SSL::TheClass>; say IO::Socket::SSL; say $res; | ||
camelia | rakudo-moar cdf80c: OUTPUT«Could not find symbol '&SSL' in method <anon> at src/gen/m-CORE.setting:13173 in any find_method_fallback at src/gen/m-Metamodel.nqp:2625 in any find_method at src/gen/m-Metamodel.nqp:944 in block <unit> at /tmp/W_AYIH8ZhG:1» | 12:21 | |
timotimo | m: my $res = try require IO::Socket::SSL <IO::Socket::SSL::TheClass>; say $res; | ||
camelia | rakudo-moar cdf80c: OUTPUT«(Any)» | ||
12:21
spider-mario left
|
|||
sergot | TheClass? what is this? | 12:22 | |
m: use IO::Socket::INET; | 12:23 | ||
camelia | rakudo-moar cdf80c: OUTPUT«===SORRY!===Could not find IO::Socket::INET in any of: /home/p6eval/rakudo-inst-2/languages/perl6/lib, /home/p6eval/rakudo-inst-2/languages/perl6» | ||
sergot | timotimo: it doesn't seem to work. | 12:25 | |
12:25
Alina-malina joined
|
|||
timotimo | well, "require" will run-time-load a module (that's why you have to give it a list of things that it'll import; rakudo absolutely has to know the lexical symbols you have available at *compile* time.) | 12:26 | |
if it fails, it'll raise a run-time exception, which you can catch | |||
m: say 1 cmp 6 | 12:28 | ||
camelia | rakudo-moar cdf80c: OUTPUT«Less» | ||
timotimo | it's harder to react to the user's code having use'd a "IO::Socket::SSL" before it use'd your module | 12:29 | |
not sure how to do it without going into rakudo internals or looking up the source code (if it exists) and grepping for use IO::Socket::SSL | 12:30 | ||
but you can ask the user to use HTTP::UserAgent <SSL>; or something | |||
sergot | Does camelia have access to some p6 modules? | 12:31 | |
12:31
kaare_ left
|
|||
sergot | to try it live | 12:31 | |
timotimo | if you use "star:" instead of "m:" | 12:32 | |
but the latest rakudo star is kinda old by now | 12:33 | ||
star: say $*PERL | |||
camelia | star-m 2014.04: OUTPUT«{"compiler" => {"release-number" => "", "build-date" => "2014-05-06T17:09:26Z", "ver" => "2014.04", "name" => "rakudo", "codename" => ""}, "name" => "rakudo"}» | ||
..star-p 2014.04: OUTPUT«{"compiler" => {"codename" => "", "ver" => "2014.04", "build-date" => "2014-05-06T17:16:05Z", "name" => "rakudo", "release-number" => ""}, "name" => "rakudo"}» | |||
sergot | oh, right, it is | ||
anyway | |||
timotimo++ | |||
thanks :) | |||
timotimo | YW :) | ||
12:34
Sterver joined
|
|||
Sterver | Hi... Where can I find file on github with perl6 example code for learning? Some time ago anybody sent me it, but I lost that link :-P :D | 12:36 | |
timotimo | it could be either github.com/perl6/perl6-examples (just example code) or learnxinyminutes.com/docs/perl6/ (much more explanation) | ||
you can find more example code on rosettacode.org - each of the pages in that wiki will have the same task solved in a whole bunch of different languages, many of them include Perl 6 examples, too | 12:37 | ||
Sterver | hm, it was like learnxinyminutes.com/docs/perl6/ but it was file on github, and it was more recent | ||
timotimo | github.com/Nami-Doc/learnxinyminut...l.markdown - could be this | 12:38 | |
sergot: you have passed GSoC with flying colours, right? | 12:39 | ||
sergot | timotimo: I always get (Any) in $res. :( | ||
timotimo: yes :) | 12:40 | ||
timotimo | could be that require doesn't have a return value | ||
in that case you can inspect $! i believe? | |||
you just have to make sure you don't put { } around the require statement | |||
otherwise the symbols will only be visible in there; i made that mistake before :) | |||
Sterver | timotimo, yeah, it is :) thanks | ||
sergot | timotimo: $! contains error, thanks | 12:42 | |
I thoght I can use :: somehow. | 12:43 | ||
thought | |||
timotimo | you mean to access the "caller's" pseudostash? | 12:44 | |
sergot | yes | ||
timotimo | that's what i was unsure about :\ | 12:45 | |
12:45
xfix left,
xfix joined,
xfix left,
xfix joined
|
|||
nine_ | Inline::Perl5 now supports calling Perl 5 functions with multiple Int/Str parameters and multiple Int/Str return values :) We also now have a proper test suite. | 12:47 | |
sergot | timotimo: I can use $! | 12:48 | |
timotimo: you asked about GSoC | |||
nine_ | tadzik: you may want to join soon ;) | 12:50 | |
12:51
Sterver left
12:52
chenryn joined
|
|||
PerlJam | greetings | 12:52 | |
12:52
_thou joined
|
|||
rurban | nine_: Impressive lightning talk about inline::perl5! | 12:56 | |
12:56
chenryn left
|
|||
rurban | blitzkost #3 | 12:56 | |
12:57
_thou left
13:00
anaeem1 left
13:01
xenoterracide joined
|
|||
jnthn | oh my, how much backlog... | 13:06 | |
moritz | jnthn: could you please test if the makefile-line-length rakudo branch builds on windows? | ||
jnthn: if yes, please merge into nom; it fixes a mac os X build issue ("write error") | |||
nwc10 | much backlog, and still no-one seems to have actually used the profiler for great evil, er profit, yet | 13:07 | |
moritz | nwc10: I disagree | ||
13:07
brrt joined
|
|||
nwc10 | oops sorry. I failed to spot something? | 13:07 | |
moritz | nwc10: TimToady++ mentioned an optimized version of an RC entry, made with the help of the profiler | ||
nwc10 | oh. oops. | 13:08 | |
moritz | irclog.perlgeek.de/perl6/2014-08-26#i_9243290 | ||
13:08
anon_ joined
|
|||
jnthn | moritz: Sure, lemme see how git pull works out... | 13:08 | |
anon_ uses profiler to test jnthn++'s gtk exmaple and found it doesn't works well here and 90%+ cost is at 111 lines of NativeCall.pm6 | |||
brrt | moritz: that is so totally cool and awesome | 13:09 | |
TimToady++ | |||
jnthn | anon_: What, specifically, doesn't work well? :) | ||
colomon | nwc10: I dunno about good or evil, but I used the profiler to get a substantial in one of my $work scripts. | ||
13:10
mr-foobar joined,
anon left,
anon_ is now known as anon,
raiph joined
|
|||
anon | jnthn: only "Characters: " text works | 13:10 | |
nwc10 | colomon: cool | ||
colomon | nwc10: it's hard to say how substantial, alas, as the profiler seems to return significantly different overall times on different runs. | 13:11 | |
but it seemingly involved hacking about 30% off the overall running time. | 13:12 | ||
jnthn | moritz: Tryig it. | ||
13:12
spider-mario joined
|
|||
jnthn | *Trying | 13:12 | |
13:12
spider-mario left
|
|||
anon also add --profile-compile to CORE setting compiling and it is killed (maybe due to memory) | 13:13 | ||
nwc10 | how much memory do you have? | ||
jnthn | Well, I have a 16GB box and that wasn't enough o.O | 13:14 | |
nwc10 was assuming to wait a bit to see what gets fixed as a result of smaller things, before trying that | |||
anon | 4G | ||
jnthn | I need to do something about that... | ||
13:14
spider-mario joined
|
|||
jnthn | The profiler as it stands is "what I had time to do in spare bits of time in the week or so before YAPC::EU". So don't expect it to be perfect. :P | 13:14 | |
nwc10 | I think the largest thing that I have access to has 96G of RAM | 13:15 | |
apart from the main work DB server, which has more, but that is the main work DB server... | |||
jnthn | moritz: It seems good to me. | ||
moritz: Manages to build and make test just fine. | |||
13:16
chenryn joined
|
|||
jnthn | nwc10: Yes, maybe don't use that. | 13:16 | |
anon | there is 128G of RAM server here, but it's a online db server | 13:17 | |
nwc10 | exactly. I'm waiting for the stuff related to startup of -e0 to be done, and other more basic compiling | ||
arnsholt | My research group's compute server has 256 gig, but I'm not sure if my boss would appreciate me seeing how much I can hog at once =) | ||
13:17
chenryn left
|
|||
brrt | 96G :-o | 13:17 | |
how even | |||
13:18
xenoterracide left
13:20
guru joined
13:21
guru is now known as Guest65827,
Guest65827 is now known as ajr_
|
|||
dalek | kudo/nom: dea7adf | moritz++ | / (5 files): Read bootstrap sources from file because make on Mac OS X has a line length limit in commands (symptom: "write error") |
13:22 | |
kudo/nom: c693d75 | moritz++ | / (3 files): Do not pass M_CORE_SOURCES on the command line it is too long for Mac OS X make |
|||
kudo/nom: 3e55a0d | moritz++ | src/core/IO.pm: [IO::Path] be more consistent with IO::Path:D markers for the invocant |
|||
kudo/nom: ba9d01d | moritz++ | / (6 files): Merge branch 'makefile-line-length' into nom |
|||
moritz | that should fix the "write error" bug on mac os x for MoarVM builds | ||
s/fix/work around/ | |||
colomon | moritz++ | ||
jnthn | oh hurrah! | 13:23 | |
moritz++ indeed | |||
moritz | tgt++ golfed it down | ||
maybe I should do the same for the JVM build | |||
jnthn | Wow | ||
moritz | (the problem being that in certain constellations, make doesn't like command lines > 1024 chars on mac os X) | 13:24 | |
13:24
jnap joined
|
|||
masak | moritz` | 13:24 | |
er, moritz++ | |||
13:25
anon is now known as JimmyZ
|
|||
nine_ | Yes, this now works: perl6 -Ilib -e 'use Inline::Perl5; my $i = p5_init_perl(); $i.run("use DBI; 1;"); my @dbh = $i.call("DBI::connect", "DBI", "dbi:Pg:database=timemngt"); my $dbh = @dbh[0]; say $i.call("DBI::db::selectrow_array", $dbh, "select count(*) from products"); $i.DESTROY; | 13:25 | |
nwc10 | curious. worked on my machine. | ||
clearly different OS X is different | 13:26 | ||
nine_ | I can now use Perl 5's DBI in Perl 6 :) | ||
JimmyZ | nine_++ # that's fast! | ||
moritz | woah | ||
nine_ | Everything available on github.com/niner/Inline-Perl5 | 13:27 | |
And the weird my $dbh = @dbh[0]; is just because I really suck at Perl 6... | 13:29 | ||
13:29
bjz joined
|
|||
colomon | nine_: would be good to add that to the p6 module ecosystem.... | 13:32 | |
nine_ | colomon: yes, would be awesome if someone who actually knew how to write a proper Perl 6 module could have a look at it. These are literally my first steps in Perl 6. | 13:33 | |
colomon | nine_: if someone else hasn't done it by this evening (US time) I'll take a stab at it. Right now I should be $working. :) | 13:35 | |
nine_ | colomon: great! :) | ||
colomon is dismayed that searching for info on creating p6 modules turns up a bunch of obsolete information... | 13:36 | ||
13:36
JimmyZ_ joined
13:37
JimmyZ__ joined
13:39
JimmyZ left,
JimmyZ__ is now known as JimmyZ
13:40
agen4 joined
|
|||
agen4 | /msg camelia | 13:40 | |
13:41
JimmyZ_ left
|
|||
hoelzro | hmm...S26 doesn't seem to work on jakudo or pakudo | 13:42 | |
13:42
kaare_ joined,
agen4 left
|
|||
betterworld | m: "" ~ Buf.new | 13:43 | |
camelia | rakudo-moar cdf80c: OUTPUT«(signal )» | ||
betterworld | this hangs rakudo. In an older version, it printed error messages in an endless loop | ||
masak | cute graphs: github.com/Dobiasd/programming-lan.../README.md | 13:46 | |
FROGGS | betterworld: there is already an RT ticket... | ||
betterworld | oh, I did not check that, sorry | 13:47 | |
13:48
JimmyZ left
13:51
potatogim_ joined
13:52
potatogim_ left,
SamuraiJack_ left,
SamuraiJack joined
13:54
potatogim_ joined
13:55
potatogim_ is now known as PotatoGim^Home
13:56
PotatoGim^Home is now known as PotatoGim_Mobile
13:57
PotatoGim_Mobile is now known as PotatoGim-Tab
|
|||
nine_ | How can I avoid an "Illegally post-declared type" error? Class A has a method that calls B.new() and B has an attribute of type A. | 13:57 | |
13:58
grondilu joined
|
|||
jnthn | Pre-declare one of them | 13:58 | |
class B { ... } | |||
13:58
PotatoGim-Tab is now known as PotatoGim_Tab
13:59
PotatoGim_Tab is now known as PotatoGim_Home
|
|||
nine_ | jnthn: ah with "...". Thanks! | 13:59 | |
14:00
_thou joined
14:01
PotatoGim_Home is now known as PotatoGim^Home
14:02
mberends joined
|
|||
mrf | in perl5 I often use the construct sub init {$self = $self->new unless ref $self} to initialize objects in class methods. Is there a similar construct in perl6? | 14:05 | |
jnthn | I guess you could write it as method init() { self // self.new } | 14:12 | |
If I remember what the p5 code does correctly, anyway. ;) | 14:13 | ||
nine_ | Now simplified to: use Inline::Perl5; my $i = p5_init_perl(); $i.run("use DBI; 1;"); my $dbh = $i.call("connect", "DBI", "dbi:Pg:database=timemngt"); say $dbh.call("selectrow_array", "select count(*) from products"); $i.DESTROY; | 14:14 | |
Now I only need to find out how to overload call and it will be $dbh.selectrow_array("select count(*) from products); :) | 14:15 | ||
mrf | jnthn: the idea being to swap a class str for an object ref | 14:16 | |
jnthn | String?! | ||
nine_ | s/overload call/do something like AUTOLOAD/ | 14:17 | |
jnthn thinks he'll leave this one to somebody who knows Perl 5 :) | |||
We almost never think of types by their string name in Pelr 6. | |||
*Perl | |||
nine_ | mrf: I'd guess that in Perl 6 classes are full blown objects instead of just names. | ||
geekosaur | perl5's oo is an out and out hack. yes, strings. | 14:18 | |
there's a reason they adopted an old prototype of p6's mop as a real OO interface :) | 14:19 | ||
jnthn chuckles | |||
my SomeClassName $x .= new; # is a common Perl 6 idiom | |||
Not sure if it applies in this case | |||
Please could somebody on non-Windows do a perl6-m --profile-compile -e "say 1" and upload the result for me somewhere? | 14:22 | ||
nwc10 | optimised build? | ||
jnthn | Preferably. | 14:23 | |
nwc10 | JIT or not? | ||
jnthn | Since that's what I've got on Windows. | ||
JIT. | |||
I've just compared rel2abs on Windows and posix and the Windows one is probably rather more costly. | |||
nwc10 | I hadn't said (here) that I tried it on OS X yesterday (or maybe Sunday) with the debugging build from Sunday or Saturday, and it was 16% | 14:24 | |
but I have no idea how representative that is of optimised builds | |||
mrf | nine_: I seem to get issues if I call an accessor method on an unititialised object in the sub init. e.g sub init {$.foo} which is why I ask | 14:26 | |
PerlJam | mrf: care to show your whole code? | 14:27 | |
nine_ | How would a CANDO method declaration really look like? If I do it like shown in S10, I only get an "Invalid typename 'Item'" | ||
nwc10 | OK, 6 minutes later, spectest pass | 14:28 | |
mrf | PerlJam: Any specific pastebin? | ||
PerlJam | mrf: any is fine with me. | ||
nwc10 | pypy - can you beat that? :-) | ||
rubinius - how low can you go? | 14:29 | ||
PerlJam | nwc10: none of those have spectests though ;) | ||
nwc10 | good point | ||
nine_ | Is CANDO even implemented? acking rakudo's source yields nothing at all | 14:31 | |
PerlJam | nine_: I doubt it. | ||
nwc10 | jnthn: ccl4.org/~nick/profile-1409063326.04419.html | ||
nine_ | PerlJam: damn...so no way to make progress on that front for now. | ||
nwc10 | "my" machine is x86_64 CentOS, and has loadsaRAM | 14:32 | |
rel2abs at 13.46% | |||
about to go to www.meetup.com/Vienna-Perl-Mongers/...201277862/ so won't be around to re-run stuff this evening | |||
jnthn | nwc10: Thanks! | 14:33 | |
nwc10 | no problem | ||
jnthn waits for it to download :) | |||
14:33
PotatoGim^Laptop joined
|
|||
nwc10 | did you want it compressed? | 14:34 | |
jnthn | It's fine; this wifi ain't the fastest | ||
Though I just noticed there seems to be a network cable on the desk here too | 14:35 | ||
14:35
PotatoGim^Home left
|
|||
dalek | kudo/nom: cfdf260 | jonathan++ | src/core/IO.pm: Don't try to rel2abs open '-'. Seems this isn't the source of the costly rel2abs calls, however, so only a minor win from this. |
14:35 | |
kudo/nom: 8af523b | jonathan++ | src/core/Supply.pm: Don't derive grammar in CORE.setting. Fixes an issue reported by donaldh++ where we were declaring a new op inside of the setting. This caused a new grammar to be derived, which in turn ended up including fresh NFAs and an entire copy of the source to end up the file too! Fixing this shaves ~6MB off CORE.setting size, about 14MB off base memory, and decreases startup time too. |
|||
14:36
PotatoGim^Laptop is now known as PotatoGim^Home
|
|||
mrf | PerlJam: pastebin.com/XEsxLfVG | 14:37 | |
japhb | Whee, may other wins be as easy as that one! | ||
14:37
PotatoGim^Home left
|
|||
mrf | PerlJam: That code snippet should show what I am attempting to do | 14:37 | |
14:37
PotatoGim^Home joined
14:39
PotatoGim^Home left,
PotatoGim^Home joined
|
|||
masak | nine_: try 'git grep' instead of 'ack'. it's faster, and it plays really well with git repositories. | 14:40 | |
colomon ponders writing a grammar to parse the output of git log --stat | 14:43 | ||
nwc10 | jnthn: new profile at profile-1409064143.23213.html | ||
er | |||
ccl4.org/~nick/profile-1409064143.23213.html | |||
but you might want ccl4.org/~nick/profile-1409064143.23213.html.gz if your bandwidth is bad | |||
203K rather than 4.1M | 14:44 | ||
colomon | nwc10: when I go to ccl4.org/~nick/profile-1409064143.23213.html… oh! It just takes a while to load! | ||
nwc10 | Oh yes. | 14:45 | |
sadly that friend's toybox is no longer in the office of an ISP | |||
colomon didn't post a profile that way the other day because he thought it wasn't working. | |||
nwc10 | using all their unsold fibre | ||
which was fun | |||
Casey was downloading a Perl 5 RC | |||
the bottleneck was in the wifi in starbucks | |||
14:45
anaeem1_ joined
|
|||
nwc10 | on the other side of the pond. | 14:45 | |
14:46
rindolf left
|
|||
TimToady | too much pond scum, maybe | 14:46 | |
nwc10 | no, the transatlantic link was fine | ||
it was faster than the starbucks wifi | |||
and I don't think that the starbucks wifi was particularly slow. | |||
jnthn | nwc10: urgh, yes, it's bad enough the gz is taking a while o.O | 14:47 | |
TimToady | we still multiple terahertz of dark fiber running within a block or two of our house and across the Pacific | ||
*accidentally | 14:48 | ||
colomon | jnthn: suggestion: could we include the full command line used in the profiler output? | ||
colomon finds it too easy to get confused about what he was actually profiling. | 14:49 | ||
nine_ | Is there any way at all to have a class fake the existence of methods at runtime? | ||
TimToady too | |||
[Coke] | (RT #122604) added "testneeded" | 14:50 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122604 | ||
Timbus | mrf, if you want to check if self is defined in your method | ||
dalek | kudo-star-daily: b21121a | coke++ | log/ (14 files): today (automated commit) |
||
Timbus | .. do exactly that | ||
if self { } | 14:51 | ||
14:52
molaf joined
|
|||
TimToady | there's a specced FALLBACK method, not yet implemented | 14:54 | |
mrf | Timbus: if I call Foo::Bar.init whould self be defined? | ||
TimToady | it would presumably call the existing .^add_fallback metamethod to install itself | ||
14:54
akaseki left
|
|||
TimToady | nine_: ^^ | 14:54 | |
nine_ | TimToady: ah too bad. So I guess I won't finish Perl 5 Perl 6 interop in a week after all. | 14:55 | |
Timbus | mrf: no | ||
mrf | Timbus: I am more attempting to accertain if self is a class or object ref which was a fairly common check in perl5 | ||
14:56
xinming left
|
|||
Timbus | when undefined, i believe self is a type object | 14:56 | |
14:56
spider-mario left
|
|||
jnthn | Time for some sleep... & | 14:57 | |
mrf | which would explain the error I get when calling $.args when self is undefined | 14:58 | |
jnthn | nwc10: Got the .gz; will study it tomorrow. :) | ||
mrf | Timbus: can I do self .= new ? to allow $.args later in that sub. | 14:59 | |
Timbus | .. woa that seems like a bad idea | 15:00 | |
15:00
spider-mario joined
|
|||
mrf maybe trying to force bad perl6 paradigms on perl6 | 15:00 | ||
15:00
anaeem1_ left
|
|||
Timbus | if you just want a class variable that isn't tied to an instance of the class, use 'my' instead of 'has' | 15:01 | |
mrf | Timbus: I want a method where the invocant could be either a class name or an object ref. init and run are good examples of this. These usually handle the duality by normalising to having an instantiated object | 15:03 | |
nine_ | mrf: how about using a multi method for that? | 15:04 | |
Timbus | ^ beat me to it | ||
mrf | Multi method? | ||
nine_ | mrf: class Foo { multi method init (Str) { self.new().init() } multi method init (Foo) { ... } } or something like that | ||
Timbus | well. id probably use the :D check on the invocant, probably | 15:05 | |
nine_ is still an absolute Perl 6 beginner | |||
mrf | nine_: you seem to be doing better than me :D | ||
Timbus | m: class Wot { multi method init(Wot:U: $args) { say 'type class' }; multi method init(Wot:D: $args) { say 'actual instance' } }; Wot.init(1); Wot.new.init(1); | 15:08 | |
camelia | rakudo-moar ba9d01: OUTPUT«type classactual instance» | ||
15:09
akaseki joined
15:10
xinming joined
|
|||
psch | m: class Foo { has @.args is rw; method init(Foo $self is rw: @args) { $self //= Foo.new; $self.args = @args } }; my $f = Foo; $f.init([1,2,3]).say; $g = Foo.new; $g.init([4,5,6]).say | 15:10 | |
camelia | rakudo-moar ba9d01: OUTPUT«===SORRY!=== Error while compiling /tmp/YFIE4kpOACVariable '$g' is not declaredat /tmp/YFIE4kpOAC:1------> }; my $f = Foo; $f.init([1,2,3]).say; $g⏏ = Foo.new; $g.init([4,5,6]).say expecting any of: …» | ||
psch | my my | 15:11 | |
m: class Foo { has @.args is rw; method init(Foo $self is rw: @args) { $self //= Foo.new; $self.args = @args } }; my $f = Foo; $f.init([1,2,3]).say; my $g = Foo.new; $g.init([4,5,6]).say | |||
camelia | rakudo-moar ba9d01: OUTPUT«1 2 34 5 6» | ||
psch | that's slightly horrible though, in my opinion | ||
Timbus | i think i did that in some code somewhere and i hate it | ||
15:13
MilkmanDan left,
MilkmanDan joined
15:14
chenryn joined
15:15
akaseki is now known as Salai,
mrf left
|
|||
btyler | colomon: ok, no worries if JSON::Tiny's a better fit. I'd love to get your changes/added tests as a pullreq if you ever have a moment, though | 15:17 | |
colomon | oh, absolutely! … when I get a second. | ||
btyler | ultimately healthier for the ecosystem if JSON::Tiny is sufficient for most needs, I think | ||
colomon | dunno if JSON::Tiny's a better fit, it's just something I've got working NOW. :) | 15:18 | |
15:18
treehug88 joined
|
|||
colomon | btyler: doing a crazy balancing act here, if you know what I mean. | 15:19 | |
btyler | colomon: totally hear you on the value of 'it works right now' :) | 15:20 | |
15:20
ajr_ left
|
|||
colomon needs to improve his code, his tests, his testing infrastructure, and the speed of all three things, all at the same time. | 15:21 | ||
15:21
mrf joined
15:22
guru joined
15:23
guru is now known as Guest86251,
Guest86251 is now known as ajr_
|
|||
colomon ponders the difference between v and n | 15:23 | ||
TimToady | well, something is usually better than nothing, if only as a bad example :) | 15:24 | |
15:26
mrf left,
chenryn left,
Alina-malina left
15:30
chenryn joined
|
|||
colomon | panda install Grammar::Debugger | 15:31 | |
===SORRY!=== | |||
Could not find Shell::Command | |||
:\ | |||
15:31
mrf joined
15:32
brrt left
|
|||
TimToady | colomon: I suspect the only difference is that \n will match CRLF | 15:33 | |
colomon | ah, as one thing? | ||
15:35
chenryn left,
Alina-malina joined
15:36
chenryn joined
15:37
JimmyZ joined
15:38
zakharyas left
15:41
chenryn left
|
|||
TimToady | m: say so "\xd\xa" ~~ /^ \n $/ | 15:41 | |
camelia | rakudo-moar ba9d01: OUTPUT«True» | ||
TimToady | m: say so "\xd\xa" ~~ /^ \v $/ | ||
camelia | rakudo-moar ba9d01: OUTPUT«False» | ||
15:43
chenryn joined
15:53
firefish5000 joined
|
|||
JimmyZ | jnthn++ # CORE.setting.moarvm size is 6M smaller | 15:53 | |
15:54
xinming_ joined
15:55
xinming left,
raiph left
15:58
MilkmanDan left,
MilkmanDan joined
|
|||
firefish5000 | Good day. How do you ignore-case for a token?I have tried <token tkn :i {...}> and <token :i tkn {...}>. | 15:59 | |
TimToady | try putting the :i inside the brackets | 16:00 | |
firefish5000 | Ahh. much better. Thanks TimToaday! | ||
PerlJam | firefish5000: What kind of grammar are you writing? | 16:01 | |
16:03
chenryn left
|
|||
firefish5000 | PerlJam: Im just playing around right now. This one parses time strings like '3d1h4s' | 16:04 | |
PerlJam | neat. | ||
play on! :) | |||
16:05
chenryn joined
16:07
dayangkun left
16:08
MilkmanDan left
16:09
kaleem left,
MilkmanDan joined
16:13
jack_rabbit joined,
JimmyZ left
16:16
[Sno] left
|
|||
colomon just made his grammar explode | 16:17 | ||
16:21
Rotwang joined
16:22
donaldh left
|
|||
nine_ | What's the closest thing to Perl 5's undef there is in Perl 6? | 16:28 | |
moritz | nine_: Any | ||
nine_: are you marshalling things between p5 and p6? | 16:29 | ||
nine_ | moritz: yes | ||
moritz | nine_: in the p5 -> p6 direction, I'd translate undef to Any | ||
nine_: and in the other direction, any value that's not .defined to undef | 16:30 | ||
firefish5000 | Can we add to the result of rules? such as <token { (\S+) \s+ (\S+) {return "$0 And $1"} }> without exiting the grammar? (bad practice?) | 16:32 | |
nine_ | moritz: thanks! Now this works: say $dbh.call("selectrow_hashref", "select * from products").perl; | 16:35 | |
moritz | m: '23 + 42' ~~ /(\d+) \D+ (\d+) { make $1 + $2 }/; say $/.ast # for firefish5000 | ||
camelia | rakudo-moar 8af523: OUTPUT«use of uninitialized value of type Any in numeric context in block <unit> at /tmp/loqK19mpvH:142» | ||
moritz | m: '23 + 42' ~~ /(\d+) \D+ (\d+) { make $0 + $1 }/; say $/.ast # for firefish5000 | 16:36 | |
camelia | rakudo-moar 8af523: OUTPUT«65» | ||
moritz | firefish5000: the idiomatic thing is to use make(), which stores the result in $/.ast | ||
m: '23 + 42' ~~ /(\d+) \D+ (\d+) { make $0 + $1 }/; say $/.made | |||
camelia | rakudo-moar 8af523: OUTPUT«65» | ||
16:36
Util left
|
|||
moritz | in .made; I think .ast is old/deprecated | 16:36 | |
firefish5000 | moritz: Thanks, that did it! | 16:39 | |
TimToady | in some respects undef is more like Nil | ||
but Nil is still misbehaving in list contexts | |||
(I think) | |||
m: my @a = 1, Nil, 3; say @a.elems | 16:40 | ||
camelia | rakudo-moar 8af523: OUTPUT«2» | ||
TimToady | yeah | ||
we need to figure out where we're currently depending on the () semantics | 16:41 | ||
and use () instead | |||
16:44
Util joined
|
|||
nine_ | Now workign: say $dbh.call("selectall_arrayref", "select * from products where id < ?", Any, 10).perl; | 16:44 | |
In other words: only passing arrays and hashes from Perl 6 to Perl 5 missing for full DBI access :) | |||
xfix | r: say [+] grep * %% 2, (1, 1, *+* ...^ * > 4_000_000); | ||
nine_ | Have to leave now though...more on this tomorrow | ||
camelia | rakudo-jvm 8af523: OUTPUT«(timeout)» | 16:45 | |
..rakudo-{parrot,moar} 8af523: OUTPUT«4613732» | |||
16:47
jnap left
16:48
PerlJam left,
tadzik left
|
|||
colomon | jnthn: if the Grammar trace ends with * MATCH, doesn't that mean the entire rule matched? | 16:48 | |
16:48
PerlJam joined
16:51
jnap joined
|
|||
colomon | oh, does parse actually fail if the entire string is not parsed now? | 16:51 | |
TimToady | yes, use subparse if you want to stop in the middle | 16:52 | |
xfix | r: say [+] grep *%%2,(1,1,*+*...^*>4e6) | 16:53 | |
camelia | rakudo-{parrot,jvm,moar} 8af523: OUTPUT«4613732» | ||
colomon | TimToady: I didn't want to stop in the middle, just the optional last section was failing the match. :) | ||
16:53
ajr_ left
|
|||
colomon | failing to match, I should say. | 16:53 | |
16:54
guru joined,
guru is now known as ajr_
16:56
akaseki joined,
Util left
|
|||
colomon | whomever-fixed-parse++ | 16:56 | |
16:57
tadzik joined
16:58
Salai left
17:02
tadzik left
17:03
tadzik joined
17:04
Util joined,
telex left
17:06
telex joined
|
|||
colomon | jnthn++ # Grammar::Tracer still rocks | 17:07 | |
17:08
jack_rabbit left
17:09
akaseki left,
Util left,
Util joined
17:11
akaseki joined
17:12
ecocode_ left
17:14
tadzik left
17:15
PerlJam left,
tadzik joined
17:17
PerlJam joined,
fhelmberger left
17:18
chenryn left
17:21
kaleem joined,
ajr_ left
17:22
guru joined,
guru is now known as Guest88584,
Guest88584 is now known as ajr_
17:23
tgt joined
|
|||
timotimo | o/ | 17:24 | |
moritz | \o | 17:28 | |
colomon | |o| | 17:33 | |
TimToady | .oO(touchdown?) |
||
colomon | .oO(TIE fighter) |
17:34 | |
17:34
firefish5000 left
|
|||
moritz | in Perl 6, that would be PROXY fighter, no? :-) | 17:35 | |
colomon | what's the p6 equivalent of "read files from the command line or standard in, or whatever"? $*IN appears to just be stdin | ||
tadzik | is it just me or feather is having problems? | ||
moritz | colomon: lines() | ||
colomon: the handle is called $*ARGFILES or so | |||
colomon | moritz: what if you want to read everything into a single string? | ||
17:36
ajr_ left
|
|||
moritz | m: say $*ARGFILES.slurp.chars | 17:36 | |
camelia | rakudo-moar 8af523: OUTPUT«1134» | ||
colomon | moritz++ # $*ARGFILES is exactly it | ||
moritz | m: say slurp().chars | ||
camelia | rakudo-moar 8af523: OUTPUT«1134» | ||
moritz | colomon: slurp() should have the same default | ||
colomon | oh! | ||
colomon feels like an idiot now | |||
timotimo | .o( DWIM: Dude! What Incredible Magic! ) | 17:37 | |
FROGGS | colomon: ask me... I was chasing a problem for two or three days just because I am stupid | ||
colomon | FROGGS: we should form a club | ||
17:37
jnap left
|
|||
FROGGS | and I mean >10 hours a day | 17:38 | |
yeah :/ | |||
colomon | BTW, being able to add { say $<commit-name> } in the middle of the grammar is pretty darned awesome | 17:39 | |
FROGGS | my default is to add things like: <?{ say "$?FILE:$?LINE &?ROUTINE.name()" }> | 17:41 | |
like in v5's grammar | |||
because grammar tracer can't help me there | |||
17:45
BizarreCake joined
|
|||
colomon | FROGGS: I'm using it as a progress track, how far it's gotten in the file, and where it stops. | 17:45 | |
FROGGS | I've currently a problem that v5 hangs somewhere in the grammar after parsing a statement | 17:46 | |
17:47
rindolf joined
|
|||
colomon | BTW, my grammar parses a 2.8M git log --stat file with 5734 commits in 11.3 seconds on my MacBook Pro. (Before any profiling, mind you.) | 17:51 | |
seems like that's much better performance than I've seen in the past... | |||
17:51
Ven joined
|
|||
FROGGS | 11.3s sounds not too bad, aye | 17:51 | |
17:53
[Sno] joined
|
|||
colomon | I thought it was going to be too slow to parse the entire log like that, but 12 seconds is fine for my purposes. | 17:54 | |
17:58
fling left
18:00
kaleem left
|
|||
Ven | timotimo: the learnxinyminutes file is not on my github account, it's on the original one :) | 18:03 | |
(wrt irclog.perlgeek.de/perl6/2014-08-26#i_9244515 ) | |||
dalek | ecs: 96719fa | (Stéphane Payrard)++ | S99-glossary.pod: fix formatting errors |
||
18:04
fling joined
|
|||
dalek | rl6-roast-data: 1fef0fa | coke++ | / (6 files): today (automated commit) |
18:07 | |
18:08
molaf_ joined
|
|||
timotimo | Ven: sorry :| | 18:09 | |
sterver isn't around any more, though :( | |||
Ven | yes, which is why I answered to you :) | 18:10 | |
Well, I already manually merged learnperl6iny PR manually, I could do it again anyway | |||
18:11
molaf left
|
|||
Ven disagrees a bit with litchkind++'s slides on the brain part :) | 18:12 | ||
(emotions are in front, graphics is behind) | 18:13 | ||
TimToady | well, emotions are kind of in the middle :) | ||
[Coke] | disk access on feather seems really slow. | ||
Ven | TimToady: the frontal lobe is responsible for reasoning and emotions | 18:14 | |
TimToady | mostly for controlling emotions :) | ||
Ven | well, it's the most developed part | ||
TimToady | [Coke]: maybe feather is having negative emotions deep down inside :) | 18:17 | |
[Coke] | htop wasn't reporting anything big on cpu or memory, but launching any new command is verrry slow. | 18:18 | |
r: say "what?" | |||
camelia | rakudo-{parrot,jvm,moar} 8af523: OUTPUT«what?» | ||
[Coke] | huh: load average: 18.42, 13.12, 9.23 | ||
Ven | that's a big word. | 18:19 | |
[Coke] | (that's with 5% of cpu) | ||
TimToady | how many processes in D state? | ||
18:19
kjs_ left,
ecocode_ joined
|
|||
[Coke] | 6 | 18:20 | |
TimToady | could well be disk then | 18:21 | |
tadzik | what's up with feather :( | ||
[Coke] | kjournald, flush-254:0, syslogd, sshguard, ./run ... now 5. root & syslog | ||
weechat-curses from tjs was in there for a bit | 18:22 | ||
TimToady | disk might be overloaded or failing | ||
18:22
ardeshir joined
|
|||
[Coke] | urk. now like 20, including a ton of apache2 processes. | 18:22 | |
TimToady | does it have a log of failures/resets somewhere | ||
[Coke] | .seen juerd? | ||
yoleaux | I haven't seen juerd? around. | ||
[Coke] | .seen juerd | ||
yoleaux | I saw Juerd 16 Aug 2014 14:35Z in #perl6: <Juerd> Wrong way around perhaps, but with an output mechanism that doesn't do partial lines, it may make sense | ||
tadzik | me weechat has been causing trouble before, I hope it's not at it again | ||
TimToady | might just be robots banging on it | ||
or it might just have been promoted to its level of incompetence | 18:24 | ||
[Coke] | moritz++ os x fixed. | 18:26 | |
18:26
Ven left,
Ven joined
|
|||
FROGGS | [Coke]: what is fixed? | 18:27 | |
[Coke] | pinged Randal to let him know. | ||
the make write error. | |||
FROGGS | ohh! | ||
moritz++ # \o/ | |||
colomon just did $match<date><year month day>.join("-"), which he thinks is quite elegant. | 18:30 | ||
tadzik | < | 18:31 | |
<3 | |||
18:32
Akagi201 left
18:33
Akagi201 joined
|
|||
[Coke] | install rakudo-moar. install panda. install rakudo-moar. sadface. | 18:34 | |
should I have to reinstall everything after updating rakudo? | 18:35 | ||
timotimo | yes, sadly | 18:36 | |
all the precompiled modules will have references and dependencies on specific compunits and serialization IDs | |||
making a "migration strategy" for that is probably a very Hard Problem. | 18:37 | ||
PerlJam | rakudobrew++ | ||
18:37
Akagi201 left
|
|||
colomon | [Coke]: panda rebootstrap | 18:38 | |
FROGGS | [Coke]: just chdir panda && perl6 rebootstrap.pl && coffee | ||
(or coke) | |||
colomon | but yeah, rakudobrew++ | ||
18:41
SamuraiJack left
|
|||
colomon | in which case a full update is normally just rakudobrew build moar | 18:42 | |
and panda rebootstrap happens automatically. | |||
timotimo | cool | ||
colomon | tadzik++ | ||
tadzik | :) | 18:43 | |
18:44
Ven left
18:45
kjs_ joined
|
|||
colomon | m: say <a b c>.first-index('b') + 1 | 18:47 | |
camelia | rakudo-moar 8af523: OUTPUT«2» | ||
colomon | m: say <a b c>.first-index(* eq 'b') + 1 | 18:48 | |
camelia | rakudo-moar 8af523: OUTPUT«2» | ||
TimToady | the nqp version of rosettacode.org/wiki/Iterated_digit...ing#Perl_6 runs in 40% of the time of the best jittable pure Perl6 version | ||
colomon | huh, that's getting me No such method 'item' for invocant of type 'NQPMu' | ||
locally | |||
18:48
Ven joined
|
|||
colomon | oh | 18:49 | |
FROGGS | colomon: can you pass --ll-exception to it? | ||
colomon | FROGGS: actual error was in a different line | ||
FROGGS | I'd like to know where in Perl6::Actions this happens | ||
colomon | m: sprintf ("%02d", 2) | 18:50 | |
camelia | rakudo-moar 8af523: OUTPUT«No such method 'item' for invocant of type 'NQPMu' in method message at src/gen/m-CORE.setting:12859» | ||
colomon | that's the code | ||
FROGGS | ohh | ||
colomon | (extra space is the problem) | ||
FROGGS | that explodes while constructing the exception me thinks | ||
Ven | "@list = 1, 2, 3 same as $list = (1, 2, 3)" wut?? | 18:51 | |
@fib and $fib, actually. from lichtkind++'s slides | |||
18:51
gfldex joined
|
|||
Ven | "for forces list context" er, that seems kinda wrong | 18:52 | |
FROGGS | colomon: that might fix it: | 18:53 | |
-"Type check failed in $.operation; expected '{$.expected.^name}' but got '{$.got.^name}'"; | |||
+"Type check failed in $!operation; expected '{$!expected.HOW.name($!expected)}' but got '{$!got.HOW.name($!got)}'"; | |||
[Coke] | $ perl6 rebootstrap.pl | ||
use of uninitialized value of type Any in string context in block <unit> at rebootstrap.pl:27 | |||
FROGGS | in my class X::TypeCheck is Exceptio | ||
colomon | [Coke]: hmmm… either you've got an out-of-date panda, panda is broken, or the module being rebootstrapped is broken. | 18:54 | |
[Coke]: it does work in general, honest | |||
[Coke] | it worked, but I got 3 or 4 warnings. | 18:55 | |
if I want to test a local change to panda, how do I invoke it? just ./bin/panda in the sourcecode dir? | 18:59 | ||
tadzik | perl6 -Ilib may be helpful | ||
FROGGS | or rebootstrap it | 19:01 | |
this will also use and install itself | |||
[Coke] | my $list = from-json slurp $!projectsfile; | ||
^^ $!projectsfile is undefined when I run "panda" | |||
complains when I have http_proxy set. | 19:02 | ||
I have an non empty projects.json file installed. when I try to run panda again, the from-json slurp dies on it. | 19:12 | ||
m: say from-json " " | |||
camelia | rakudo-moar 8af523: OUTPUT«No such method 'ast' for invocant of type 'Any' in sub from-json at src/gen/m-CORE.setting:21321 in block <unit> at /tmp/wqeccb94jU:1» | ||
[Coke] | ^^ | ||
19:13
PerlJam left
|
|||
colomon | hmmm, anyone have an elegant way to ensure that the last character of a string is a period? | 19:13 | |
19:14
PerlJam joined
|
|||
[Coke] | also, the local panda should probably not be pointing there. | 19:14 | |
(to the install dir) | |||
19:16
Sqirrel joined
19:18
Util left,
kjs_ left
|
|||
TimToady | colomon: $string ~= '.'; # :P | 19:18 | |
flussence | .oO( subset ProperlyPunctuatedStr of Str where /\.$/ ... ) |
19:19 | |
19:20
tadzik left
|
|||
TimToady | hmm, p5 does an optimization where it knows it can start scanning that one from the end of the string | 19:21 | |
I'll bet we don't do that one yet | |||
19:22
darutoko- left
|
|||
TimToady | colomon: by "ensure", do you mean test, or do you want add one if there isn't one? | 19:22 | |
m: my $_ = 'foo'; s/ <-[.]> <( /./; .say | 19:23 | ||
camelia | rakudo-moar 8af523: OUTPUT«Potential difficulties: Redeclaration of symbol $_ at /tmp/Uf9HpOWlul:1 ------> my $_ ⏏= 'foo'; s/ <-[.]> <( /./; .sayf.oo» | ||
TimToady | m: $_ = 'foo'; s/ <-[.]> <( $ /./; .say | ||
camelia | rakudo-moar 8af523: OUTPUT«foo.» | ||
TimToady | like that? | ||
m: $_ = 'foo'; s/ <-[.]> $ <( /./; .say | 19:24 | ||
camelia | rakudo-moar 8af523: OUTPUT«foo.» | ||
TimToady | slightly faster, probably | ||
m: $_ = 'foo'; s:p(.chars-1)/ <-[.]> $ <( /./; .say | |||
camelia | rakudo-moar 8af523: OUTPUT«foo.» | ||
TimToady | faster yet | ||
Ven | m: my @a = ^10; say @a[1].WHAT; say @a[1,].WHAT | ||
camelia | rakudo-moar 8af523: OUTPUT«(Int)(Parcel)» | ||
colomon | TimToady: I want to add one if there isn't one. | 19:25 | |
Ven | I must admit that, *sometimes*, sigil variance has advantages | ||
I'd get bit by it so many times tho... | |||
colomon | TimToady++ | ||
TimToady | m: say (1).WHAT; say (1,).WHAT; say (1;).WHAT | 19:27 | |
camelia | rakudo-moar 8af523: OUTPUT«(Int)(Parcel)(Int)» | ||
TimToady | m: say (1).WHAT; say (1,).WHAT; say (1;2).WHAT | ||
camelia | rakudo-moar 8af523: OUTPUT«(Int)(Parcel)(LoL)» | ||
TimToady | looks like a buglet there, I'd think (1;) should also LoL | ||
19:28
donaldh joined
|
|||
TimToady | gee, who wrote that code? <whistles> | 19:28 | |
Ven | :P | 19:31 | |
19:32
tadzik joined
19:35
daxim_ left
19:36
Util joined
|
|||
TimToady | problem is it's just testing # of statements, and seeing 1 | 19:38 | |
19:39
guru joined,
guru is now known as Guest78247,
Guest78247 is now known as ajr_
|
|||
TimToady can think of several ways to fix it, so probably better nap on it | 19:39 | ||
19:42
Util left
19:43
tadzik left,
donaldh left,
spider-mario left
19:44
Util joined,
tadzik joined
19:45
spider-mario joined,
spider-mario left
19:46
jack_rabbit joined
19:48
spider-mario joined
|
|||
dalek | kudo/nom: d8048c9 | coke++ | docs/ChangeLog: keep ChangeLog up to date |
19:55 | |
kudo/nom: 399faac | coke++ | docs/ChangeLog: remove trailing whitespace |
|||
19:57
kjs_ joined
20:04
Akagi201 joined
20:09
Akagi201 left
20:26
Rotwang left
|
|||
Ven | .seen raiph | 20:35 | |
yoleaux | I saw raiph 15 Aug 2014 18:33Z in #perl6: <raiph> cjqwesc | ||
20:36
itz_ joined
20:38
BizarreCake left
|
|||
tgt | r: (*..100)[131072] | 20:39 | |
camelia | ( no output ) | ||
20:39
itz left
|
|||
tgt | Huh. That breaks here with "P6opaque: no such attribute '$!storage'" | 20:39 | |
20:41
kjs_ left
|
|||
tgt | r: (*..100)[1250000] | 20:42 | |
camelia | ( no output ) | ||
moritz | tgt: fixed in latest rakudo | ||
tgt | How latest? I cloned a few minutes ago. | 20:43 | |
moritz | tgt: in commit ce0c258640222761ab8176aff92cf9bbe5b3665f by TimToady++ | ||
tgt | Ah, sorry, nvm. Was using the wrong perl6. | 20:44 | |
20:44
itz joined,
itz_ left
|
|||
tgt | Did whoever it was that looked into fixing smartmatch with ranges sometime in July get anywhere? (Might've been FROGGS?) | 20:45 | |
FROGGS | tgt: I cannot remember fixing something along these lines | ||
tgt | I'll see if I can find it in the archive. It was about smartmatching against a stringy range. | 20:46 | |
FROGGS | ahh | ||
m: say "b" ~ "a" .. "z" | 20:47 | ||
camelia | rakudo-moar 8af523: OUTPUT«"ba".."z"» | ||
FROGGS | m: say "b" ~~ "a" .. "z" | ||
camelia | rakudo-moar 8af523: OUTPUT«True» | ||
FROGGS | m: say "a" ~~ "b" .. "z" | ||
camelia | rakudo-moar 8af523: OUTPUT«False» | ||
FROGGS | okay, not trivial to guess :o) | ||
tgt | m: say "33" ~~ 1..5 | ||
camelia | rakudo-moar 8af523: OUTPUT«True» | ||
FROGGS | ahh, that one | ||
no, I was unable to fix it | |||
tgt | m: say "bb" ~~ "a".."aaa" | 20:48 | |
camelia | rakudo-moar 8af523: OUTPUT«False» | ||
tgt | Ah, okay. | 20:49 | |
With that last one, I disagree with the spec. | |||
It says "X.min le $_ le X.max (mod ^'s)", which isn't at all what I'd usually expect. | 20:50 | ||
moritz | most other defnitions rely on some way to generate all possible strings between the end points | 20:51 | |
which is kinda tricky in Unicode land | |||
PerlJam | moritz: you are a master of understatement :) | ||
tgt | Yeah, I was assuming that was the reason. Just seems like it'd not be what you'd want most of the time. | ||
moritz | the assumption that 'a'..'aaa' only generates ASCII characters is very much culturally laden | 20:52 | |
loden | |||
20:52
kurahaupo joined
|
|||
moritz | whatever | 20:52 | |
tgt | True. | 20:54 | |
Do Perl 6's ranges work outside of ASCII? | |||
timotimo | "ranges"? | 20:55 | |
.u one | |||
yoleaux | U+0011 DEVICE CONTROL ONE [Cc] (␑) | ||
U+001F INFORMATION SEPARATOR ONE [Cc] (␟) | |||
U+0031 DIGIT ONE [Nd] (1) | |||
moritz | m: say ('Ⅰ'..'Ⅴ')).list | ||
camelia | rakudo-moar 8af523: OUTPUT«===SORRY!=== Error while compiling /tmp/RDusUd6t8UUnexpected closing bracketat /tmp/RDusUd6t8U:1------> say ('Ⅰ'..'Ⅴ')⏏).list» | ||
moritz | m: say ('Ⅰ'..'Ⅴ').list | ||
camelia | rakudo-moar 8af523: OUTPUT«Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ» | ||
moritz | looks like a "yes" to me :-) | ||
tgt | :) | ||
PerlJam | I would think they'd *have* to work "outside of ASCII" for character classes to be useful. | 20:56 | |
(or it would certainly be LTA for ranges to work differently depending on whether or not you were in a character class) | |||
20:56
kaare_ left
|
|||
tgt | I'll just need to adjust my expectations when smartmatching against stringy ranges. | 20:57 | |
m: my $r = "a"..*; say $r.min le "b" le $r.max; | 20:59 | ||
camelia | rakudo-moar 8af523: OUTPUT«False» | ||
20:59
kjs_ joined
|
|||
tgt | m: my $r = "a"..*; $r.max.WHAT.say; # Ah | 21:01 | |
camelia | rakudo-moar 8af523: OUTPUT«(Num)» | ||
tgt | That's not quite right. | ||
kurahaupo | tgt: should it even *have* a max? | ||
FROGGS | m: my $r = "a"..*; say $r.max # is meant to be Inf | 21:05 | |
camelia | rakudo-moar 8af523: OUTPUT«Inf» | ||
kurahaupo | Inf kinda makes sense, but it's not very stringy | ||
tgt | Shouldn't it be a stringy equivalent of Inf? | ||
21:05
Akagi201 joined
|
|||
FROGGS | tgt how? | 21:05 | |
gnight #perl6 | 21:06 | ||
kurahaupo | a string consisting of an Inf number of \uffffffff chats? | ||
tgt | I don't know. My first example above seems surprising. (my $r = "a"..*; say $r.min le "b" le $r.max;) | ||
kurahaupo | chars* | ||
moritz | m: say 'b' ~~ 'a'..* | ||
camelia | rakudo-moar 8af523: OUTPUT«True» | ||
tgt | hmm. | 21:07 | |
kurahaupo | Perhap Inf should be in its own class separate from Num? | ||
[Coke] | kurahaupo: that way lies madness. | 21:08 | |
because then you have come up with a class that is basically a singleton that is also every other numeric (and string) type. | |||
m: say Nil.WHAT | 21:09 | ||
camelia | rakudo-moar 8af523: OUTPUT«Nil» | ||
[Coke] | Seems like we want something more Nilistic. | ||
kurahaupo | true | ||
tgt | moritz: I think that's because Range::ACCEPTS uses cmp? | ||
21:10
Akagi201 left
|
|||
moritz | m: say 'z' ~~ 'a'..* | 21:10 | |
camelia | rakudo-moar 8af523: OUTPUT«True» | ||
21:10
Ven left
|
|||
moritz | m: say 'Z' ~~ 'a'..* | 21:10 | |
camelia | rakudo-moar 8af523: OUTPUT«False» | ||
moritz | m: say 'B' ~~ 'a'..* | ||
camelia | rakudo-moar 8af523: OUTPUT«False» | ||
kurahaupo | what about a singleton StrInf? | 21:11 | |
moritz | there's another option | ||
one could store 'a'..* as 'a'..* | 21:12 | ||
that is, the actual whatever in the right endpoint | |||
and then special-case that in Range.ACCEPTS | |||
and in the generator | |||
tgt | I didn't realise * could be stored in things, I thought it was just a thing that had magic done to it when it was compiled. | 21:13 | |
PerlJam | [Coke]: I dunno ... we have a bottom type (Nil), maybe we need a "top" type too that is a chameleon and becomes whatever we need it to be :) | ||
moritz | m: my $x = *; say $x.^name | 21:14 | |
camelia | rakudo-moar 8af523: OUTPUT«Whatever» | ||
21:19
kjs_ left
21:21
Ven joined
21:28
donaldh joined
|
|||
nine_ | Ok, passing arrays and hashes from Perl 6 to Perl 5 is also implemented now. This means for example being able to use full DBI and probably even a Perl 5 DBIx::Class schemafrom Perl 6. | 21:32 | |
moritz | nine_++ | ||
21:33
woolfy left
21:34
woolfy1 joined
|
|||
Ven | nine_++ :) | 21:35 | |
donaldh | exciting # nine_++ | ||
moritz | I think I'll have trouble writing Rust code; they use the presence or absence of a final semicolon to indicate if stuff is an expression or a statement | 21:37 | |
let x = if 1 == 1 { 42 } else { 23 } | |||
works as expected | |||
but if you write 42; it assumes an empty expression (?) after the 42 | |||
21:38
treehug88 left
|
|||
moritz | so x is () after that | 21:38 | |
that's quite a difference to perl's "final ; is optional" | 21:39 | ||
Ven always puts the final ; due to some habit ... :P | |||
21:39
ecocode_ left
21:40
ecocode_ joined
|
|||
moritz | Ven: I tend to do that too | 21:40 | |
Ven | m: class A { sub foo { self.new(); } }; A.new.foo | ||
camelia | rakudo-moar 399faa: OUTPUT«===SORRY!=== Error while compiling /tmp/cc1HKNFX3M'self' used where no object is availableat /tmp/cc1HKNFX3M:1------> class A { sub foo { ⏏self.new(); } }; A.new.foo expecting any of: statemen…» | ||
Ven | m: class A { sub foo { $self.new(); } }; A.new.foo # err? | ||
camelia | rakudo-moar 399faa: OUTPUT«===SORRY!=== Error while compiling /tmp/8HHfOaJNuMVariable '$self' is not declaredat /tmp/8HHfOaJNuM:1------> class A { sub foo { $self.new()⏏; } }; A.new.foo # err? expecting any of: method a…» | ||
moritz | Ven: because if you add a stament after the current one, it's easy to forgetto check for the absence of a semicolon on the previous line | ||
Ven | same problem as the "pending comma" one :) | 21:41 | |
oh, sub. | |||
m: class A { method foo { self.new( } }; A.new.foo | |||
camelia | rakudo-moar 399faa: OUTPUT«===SORRY!=== Error while compiling /tmp/yojXDoL87YUnable to parse expression in argument list; couldn't find final ')' at /tmp/yojXDoL87Y:1------> class A { method foo { self.new( ⏏} }; A.new.foo expect…» | ||
21:43
treehug88 joined
21:44
ecocode_ left,
Ven left
|
|||
tgt | Thanks for your help earlier moritz. (Having a go at storing * at the endpoints as you suggested.) | 21:48 | |
21:52
ardeshir left
|
|||
[Coke] | Maybe we'll have a good answer to InfStr when we have RatStr settled. | 21:54 | |
tgt | m: use Test; my $a = *; my $b = *; is $a, $b; | 21:58 | |
camelia | rakudo-moar 399faa: OUTPUT«not ok 1 - # Failed test at /tmp/BGzq9vsvzc line 1# got: 'Whatever<140583114232904>'# expected: 'Whatever<140583114232992>'» | ||
tgt | Why is that the case? | ||
Ah, is means $a eq $b. | 22:00 | ||
22:04
kjs_ joined
22:06
Akagi201 joined
22:10
Akagi201 left
22:13
tgt left,
kurahaupo left
22:16
treehug88 left,
woolfy1 left
22:18
woolfy joined
22:22
woosley left
22:38
ilogger2_ joined
22:39
Shozan joined
22:41
ggherdov joined
22:42
mtj left,
mtj_- left,
oetiker left
22:43
flussence joined,
isacloud____ joined
22:44
thilp_ joined,
mtj joined,
raydiak joined,
oetiker joined
22:45
sivoais left,
sivoais joined
22:48
MilkmanDan joined
22:49
simcop2387 joined,
ilbot3 joined
22:50
PotatoGim^Home joined
22:55
ggherdov left,
ggherdov joined,
isacloud____ left,
isacloud____ joined
22:58
xragnar_ joined,
xragnar_ is now known as xragnar
23:00
colomon joined
23:02
bowtie_ joined,
telex joined
23:03
aborazmeh joined
23:12
kurahaupo joined
23:15
colomon left,
kurahaupo left
23:16
colomon joined
23:17
aborazmeh left
23:23
araujo joined
23:25
vike joined
23:34
PotatoGim^Home left
23:35
ardeshir joined
23:40
ardeshir left
23:54
PZt joined
|