Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-08-26

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 lizmat hoelzro, will do a spectest
00:01 lizmat ah, roast  :-)
00:01 hoelzro lizmat: let me know if you find any failures
00:02 hoelzro if you're running with the master roast, you should only see a few under S26-documentation, but that's to be expected
00:06 lizmat I see none, only one flapper
00:07 dalek rakudo/nom: ce0c258 | TimToady++ | src/core/ListIter.pm:
00:07 dalek rakudo/nom: Reify lists with correct count.
00:07 dalek rakudo/nom:
00:07 dalek rakudo/nom: The ListIter reify called p6arrfindtypes with $max (which is 100000), but should
00:07 dalek rakudo/nom: be using $count, how many we really want.
00:07 dalek rakudo/nom: Fixes RT #122604.
00:07 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=122604
00:07 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ce0c258640
00:08 TimToady PerlJam: ^^
00:17 * TimToady doesn't remember his RT login—if he ever had one—so someone else can close or test-needed it.
00:18 BenGoldberg joined #perl6
00:19 danaj joined #perl6
00:22 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?
00:23 danaj TimToady:  The issue was:  take an example like  http://rosettacode.org/wik​i/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 danaj I had this happen on multiple machines, with Ubuntu perl6 or self-built, with all 3 back ends.
00:23 TimToady that is probably because the REPL is trying to evaluate it to print out the value.
00:24 TimToady 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.
00:25 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
00:25 TimToady so yeah, it's really kind of a feature request
00:25 hoelzro lizmat: should I go ahead and merge, then?
00:25 TimToady lizmat: so it does, hmm, could be my fault
00:26 lizmat it's the only commit between working and not working :-)
00:27 lizmat 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␤␤»
00:27 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.
00:29 lizmat TimToady: it tickles something in Test.pm, throws_like
00:29 TimToady that's the error I get locally too
00:29 TimToady dunno why Test gets a different error
00:30 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:31 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?
00:31 TimToady danaj++ for good intentions anyway :)
00:31 lizmat TimToady: the test is checking specific values in the exception object
00:31 lizmat if I take the extra check out, it passes
00:32 * 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 *);
00:33 lizmat seems like the check on aggregate => 1..* is causing the problem
00:35 TimToady maybe need a specific test for Inf in there somewhere
00:36 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:37 BenGoldberg m: (1..*).gist.say
00:37 camelia rakudo-moar ce0c25: OUTPUT«1..Inf␤»
00:37 TimToady m: constant @primes = grep &is-prime, 2, (3, 5, 7 ... *); say @primes
00:37 camelia rakudo-moar ce0c25: OUTPUT«(timeout)»
00:38 BenGoldberg m: constant @primes = grep &is-prime, 2, (3, 5, 7 ... *); say @primes.gist
00:38 BenGoldberg m: constant @primes = grep &is-prime, 2, (3, 5, 7 ... *); say @primes.gist
00:38 TimToady say already does .gist
00:38 BenGoldberg Oh, nmind.
00:38 TimToady but gist isn't really giving you the gist of it...
00:38 camelia rakudo-moar ce0c25: OUTPUT«(timeout)»
00:38 camelia rakudo-moar ce0c25: OUTPUT«(timeout)»
00:38 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)
00:38 yoleaux btyler: I'll pass your message to colomon.
00:38 TimToady except for the "this is really long" part of the information :)
00:40 lizmat maybe we should limit gists to 140 characters :-)
00:46 dalek roast: ad7a578 | (Elizabeth Mattijsen)++ | S02-types/array.t:
00:46 dalek roast: Fix fragile test
00:46 dalek roast: review: https://github.com/perl6/roast/commit/ad7a57843b
00:47 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:48 xenoterracide joined #perl6
00:48 lizmat flussence: "=item length
00:48 lizmat This word is banned in Perl 6.  You must specify units.
00:49 flussence okay, you got me there :)
00:49 awwaiid slots
00:49 flussence .oO( $elasticity? )
00:50 lizmat :chars probably
00:50 lizmat :tweet maybe ?
00:50 lizmat :-)
00:58 kurahaupo joined #perl6
01:02 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.
01:03 btyler but this is a great opportunity to take the profiler for a spin :)
01:05 hoelzro has anyone run the spectest on the JVM recently?
01:05 hoelzro oh, nvm
01:05 hoelzro I thought it was hanging
01:13 hoelzro is there a way for a role to require a consuming class to provide certain methods?
01:13 hoelzro as a sort of way to document what interface consumers of that role will provide?
01:15 raiph joined #perl6
01:17 lizmat in the role: method required-method-name { ... }   ?
01:17 dayangkun joined #perl6
01:18 FROGGS_ joined #perl6
01:20 hoelzro that's kind of what I figured
01:20 Sqirrel joined #perl6
01:31 aborazmeh joined #perl6
01:34 lizmat shutting down, decommute in 30 mins&
01:51 ardeshir joined #perl6
02:07 chenryn joined #perl6
02:09 colomon joined #perl6
02:20 kurahaupo joined #perl6
02:34 jack_rabbit joined #perl6
02:39 noganex_ joined #perl6
03:14 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)
03:14 yoleaux 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)
03:16 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:17 colomon 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:27 kaare_ joined #perl6
03:46 ingy joined #perl6
03:47 dalek specs: 84550b3 | (Rob Hoelz)++ | S26-documentation.pod:
03:47 dalek specs: Document how S26 behaves regarding roles
03:47 dalek specs: review: https://github.com/perl6/specs/commit/84550b3db7
03:47 dalek specs: 404f1ea | (Rob Hoelz)++ | S26-documentation.pod:
03:47 dalek specs: Clarify leading block declarative comments
03:47 dalek specs: review: https://github.com/perl6/specs/commit/404f1ead9e
04:03 hagiri joined #perl6
04:05 rindolf joined #perl6
04:21 xinming joined #perl6
04:30 anaeem1 joined #perl6
04:48 kaare_ joined #perl6
04:59 chenryn joined #perl6
05:05 anaeem1 joined #perl6
05:14 ecocode joined #perl6
05:26 chenryn joined #perl6
05:32 gfldex joined #perl6
05:47 ecocode_ joined #perl6
05:52 [Sno] joined #perl6
05:52 kaleem joined #perl6
06:01 SamuraiJack joined #perl6
06:02 TimToady added a more performant version of http://rosettacode.org/wiki/It​erated_digits_squaring#Perl_6
06:03 TimToady takes good advantage of the jit, except that div doesn't seem to jit fully yet
06:05 TimToady anyway, does the first million in about 5 seconds, and 100 million to 586 seconds (slight slowdown due to heat throttling, probably)
06:06 TimToady 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 :)
06:08 * 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
06:09 TimToady well, maybe some of the same apparatus would be useful in that regard
06:10 TimToady 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 moritz nor would I be very interested in that
06:11 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 anaeem1 joined #perl6
06:11 TimToady so it won't get you spec coverage
06:12 TimToady 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
06:14 TimToady though I guess there are a lot of valid backlinks from the tests into the specs that show up online
06:14 TimToady yes, that might be a good sort of tool to have
06:17 TimToady 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:18 TimToady have to test both the happy paths and the sad paths, and there's a lot of overlap
06:26 dalek doc: bf04937 | moritz++ | lib/Language/traps.pod:
06:26 dalek doc: [traps] add a SUBTITLE
06:26 dalek doc: review: https://github.com/perl6/doc/commit/bf04937324
06:26 dalek doc: d444665 | moritz++ | lib/Type/IO/Path.pod:
06:26 dalek doc: fix pod error
06:26 dalek doc: review: https://github.com/perl6/doc/commit/d444665797
06:41 dalek doc: ce7613f | moritz++ | htmlify.p6:
06:41 dalek doc: [htmlify] only process .pod files
06:41 dalek doc:
06:41 dalek doc: in particular, do not process .Foo.pod.swp files, which are not valid UTF-8
06:41 dalek doc: review: https://github.com/perl6/doc/commit/ce7613f5b4
06:41 dalek doc: e83e69e | moritz++ | lib/Type/IO/Path.pod:
06:41 dalek doc: [IO::Path] remove TODO comment
06:41 dalek doc:
06:41 dalek doc: it was intefering with pod parsing; probably because I messed it up.
06:41 dalek doc: review: https://github.com/perl6/doc/commit/e83e69ec74
06:46 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:47 TimToady $native op= expression, I meant to say
06:48 TimToady where that's presumably declared 'my int $native;' or so
06:48 TimToady and once you've done that, it's not so hard to desugar ++$native into the same thing
06:49 TimToady that's probably a nice NQLHF for someone to tackle
06:53 TimToady anyway, that would make a lot of our native code a lot prettier
06:53 * TimToady -> zzz however... &
06:53 * moritz tries to profile htmlify in perl6/doc
06:53 moritz runtime without profilinging: 6m16s
06:54 ecocode_ since we can call perl5 code from perl6 (seen on yapceu talk) ... does it mean we can parallelize perl5 code ?
06:56 moritz ecocode_: do you mean call out to a perl5 interpreter, or the p5 reimplmentation in rakudo?
06:57 TimToady the lightning talk was about embedding a real P5
06:57 TimToady and then embedding a real Python inside that...
06:57 moritz and it worked? (ish)
06:57 TimToady yes
06:57 moritz wow
06:57 moritz how did that?
06:58 moritz *who
06:58 moritz and how did they do it?
06:58 TimToady nativecall to p5 embedding interface
06:58 TimToady and Inline::Python for the other, iirc
06:58 ecocode_ yep, as in the lightning talk, but I would see more interesting stuff if we could parallelize p5 in p6 ;)
06:59 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
06:59 TimToady you could, potentially, start up separate Perl interpreters, one per P6 thread, which was diakopter's plan
06:59 TimToady 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
07:01 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 moritz TimToady: so it must be done either in the level above, or in a tree transformation afterwards
07:01 TimToady has to be done at the reduction
07:01 darutoko joined #perl6
07:02 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 #perl6
07:03 * ecocode_ wishes HTML::TreeBuilder and HTML::TableExtract get ported to p6
07:03 TimToady could be done in a later pass as well
07:03 * TimToady isn't zzz'ing very well here... :)
07:03 * moritz noticed
07:04 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:06 moritz profiling htmlify.p6 OOMed after 12m25s
07:06 moritz (presumably during profiling report generation; it completed the processing successfully)
07:09 TimToady ah, it was _reducecheck
07:09 TimToady used by ??!! and by .=
07:10 TimToady it would appear that rakudo also supports a reducecheck
07:12 moritz the special cases //=, infix does etc. are all in method EXPR
07:13 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:15 avuserow joined #perl6
07:15 TimToady though I suppose he might decide he wants a certain amount of desugaring before his AST sees it
07:15 TimToady masak: ^^ talking about where to desugar op= wrt your AST notions
07:19 TimToady 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:20 TimToady if it's going to be handled later longterm, I'm a bit suspicious of handling it before your AST
07:21 TimToady though I suppose it merely degenerates to the ordinary op= handling in that event
07:22 TimToady but we could have people depending on native-ish macros that assume the transformation has been done for them
07:22 TimToady and then we'd be breaking htat
07:22 TimToady *th
07:26 rindolf TimToady: hi, are you feeling better?
07:30 kurahaupo joined #perl6
07:33 nine_ Should I use p5_ or perl5_ as prefix for the helper C functions in Inline::Perl5?
07:35 * moritz has no idea, but can point nine_ to http://doc.perl6.org/type/IO%3A%3APath (in a totally unrelated matter)
07:36 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
07:37 moritz nine_: not complete yet, but should be enough to get you started
07:39 nine_ moritz: a great start in any case!
07:42 * moritz decides that the native =op rewriting rabbit hole is too deep for him atm
07:43 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 nine_ s/would only use/would only lose/
07:45 sergot o/
07:45 moritz nine_: you mean as embedded SVG?
07:46 moritz 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:49 nwc10 all spectests pass
07:49 nwc10 \o/
07:49 nwc10 ship it!
07:52 nine_ moritz: SVG is actually part of HTML5: http://www.w3.org/TR/html5/​embedded-content-0.html#svg
07:52 moritz nine_: wow, things have progress in the last few years :-)
07:54 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:59 moritz now I just have to figure out how to get raw HTML through Pod::To::HTML
08:00 donaldh joined #perl6
08:14 dalek rakudo/nom: cdf80c7 | moritz++ | src/core/Pod.pm:
08:14 dalek rakudo/nom: Add Pod::Raw type
08:14 dalek rakudo/nom:
08:14 dalek rakudo/nom: it is not hooked up to the parser, but can be used to communicate raw
08:14 dalek rakudo/nom: HTML to Pod::To::HTML
08:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cdf80c7737
08:57 fhelmberger joined #perl6
08:59 chenryn joined #perl6
09:02 kjs_ joined #perl6
09:13 aindilis joined #perl6
09:14 nine_ How do I write a destructor in Perl 6?
09:15 moritz you don't :(
09:16 _thou joined #perl6
09:16 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
09:17 nwc10 ("proper" GC, not refcounting)
09:20 nine_ nwc10: yep. As long as it would run some time before exit it would be fine.
09:23 * mrf is asuming that after release of 6.0.0 perl6 will be installable via apt?
09:24 nwc10 why wait that long?
09:24 nwc10 This is perl6 version 2013.12 built on parrot 5.9.0 revision 0
09:24 nwc10 That's what current Ubuntu ships
09:24 mrf nwc10: is there a private repo that has perl6 on moarvm?
09:24 nwc10 that however is about 8 months out of date
09:24 nwc10 mrf: I'm not aware of one, and I'd love someone (else) to make it.
09:25 nwc10 (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
09:25 * moritz consider taking the bait
09:25 nwc10 yay!
09:25 kaleem joined #perl6
09:26 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:27 nwc10 totally agree. I don't have time to help make this happen.
09:28 mathw joined #perl6
09:28 mrf thats cool more a suggestion that a demand
09:37 darutoko joined #perl6
09:38 nine_ I just realized that when I read Perl 6 documentation, I read it with jnthns voice in my head.
09:39 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 mrf I assume this is due to VM startup time
09:39 moritz mrf: it is also due to perl 6 loading a full object system
09:39 nwc10 mrf: compare with perl -MMoose -E 'say "foo"' and it's closer
09:40 nwc10 it's not so much VM startup time, as VM loading all the built in stuff
09:40 nwc10 (strictly)
09:40 nwc10 but, as an end user, "VM startup" vs "default stuff" isn't a useful distinction
09:40 nwc10 it's like "I don't care that it's TalkTalk's fault. A&A, please make my ADSL work again"
09:40 nwc10 also, making the time smaller is being worked on.
09:41 mrf nwc10: that is a fantastically American metaphore :D
09:42 mrf cool. Despite language speed dick waving being rather pointless, comparisons to other language load times do seem to be important to business people
09:43 mrf I see perl6 likely to be competing in the same market as things like Go
09:46 moritz you mean, concurrent network stuff?
09:47 moritz 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:49 mrf indeed. Go is being suggested to replace the use of Python as well as C++ for both networking and general purpose scripting
09:50 spider-mario joined #perl6
09:50 anon joined #perl6
09:51 woolfy joined #perl6
09:55 spider-mario joined #perl6
10:02 ggoebel11111119 joined #perl6
10:09 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:12 mrf nwc10: I think its probably more important for any language a user expects to run on the command line.
10:13 nwc10 yes. and there's quite a lot of Perl used on command lines
10:15 mrf indeed
10:16 mrf to be fair its not a huge slowness but it is definately noticable in very short -e examples
10:17 Ven joined #perl6
10:17 anon java is much slower, if you talk about startup time
10:18 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.
10:19 anon aye
10:22 telex joined #perl6
10:30 masak oh hai #perl6
10:36 Ven o/
10:50 SamuraiJack_ joined #perl6
10:57 timotimo o/
10:58 BizarreCake joined #perl6
10:59 FROGGS o/
11:00 nwc10 aren't we getting a bit unbalanced here?
11:00 timotimo someone's trying to rock the boat
11:00 spider-mario joined #perl6
11:01 moritz \\\o
11:01 FROGGS \ohh n\oes!
11:01 FROGGS damn
11:01 FROGGS we cannot escape!
11:04 _thou joined #perl6
11:11 sergot .tell hoelzro How do you imagine UA as a middleware? :)
11:11 yoleaux sergot: I'll pass your message to hoelzro.
11:11 sergot .seen hoelzro
11:11 yoleaux I saw hoelzro 01:20Z in #perl6: <hoelzro> that's kind of what I figured
11:12 dalek doc: f2d8873 | moritz++ | htmlify.p6:
11:12 dalek doc: embed typegraph SVG directly into the HTML
11:12 dalek doc:
11:12 dalek doc: because we can. nine++
11:12 dalek doc: review: https://github.com/perl6/doc/commit/f2d88734d1
11:12 moritz so much yak shave, so little time.
11:13 moritz .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.
11:14 mrf does perl6 do compile time type checking if types are used?
11:14 akaseki joined #perl6
11:14 moritz mrf: where it can, yes
11:15 moritz mrf: and where it's implemented, that is
11:15 moritz m: say 'alive'; sub f(Str $x) { }; f 42
11:15 camelia rakudo-moar cdf80c: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/jfPuVLG298â�¤Calling 'f' will never work with argument types (int)â�¤    Expected: :(Str $x)â�¤at /tmp/jfPuVLG298:1â�¤------> [32msay 'alive'; sub f(Str $x) { }; [33mâ��[31mf 42[0mâ�¤Â»
11:15 moritz that's a compile-time error, the "say 'alive'" is never executed
11:15 moritz OTOH:
11:16 moritz m: say 'alive'; my Str $x = 42; # only caught at run time
11:16 camelia rakudo-moar cdf80c: OUTPUT«alive␤Type check failed in assignment to '$x'; expected 'Str' but got 'Int'␤  in block <unit> at /tmp/ldqoA6bRHC:1␤␤»
11:16 moritz that one would be possible to catch at compile time too
11:17 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
11:18 moritz 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?
11:19 moritz mrf: they throw an error anyway
11:19 mrf ahh
11:19 moritz mrf: because they check the nominal type, not the runtime (actual) type
11:20 sergot ==> Testing OpenSSL
11:20 sergot t/01-basic.t .. 1/9 Internal error: invalid thread ID in GC work pass
11:20 sergot ohoh, what is this?
11:21 mrf moritz: cheers. That makes sense
11:22 Ven joined #perl6
11:23 sergot this was like: http://i.imgur.com/kzRmuyw.gif
11:33 hoelzro sergot: this is kind of what I had in mind: https://gist.github.com/ho​elzro/671912c49b0efcc8d2aa
11:33 yoleaux 11:11Z <sergot> hoelzro: How do you imagine UA as a middleware? :)
11:34 xinming joined #perl6
11:35 sergot hoelzro++
11:35 sergot it looks nice!
11:50 * timotimo stealthily published a p6weekly
11:52 Alula_ joined #perl6
11:52 hoelzro sergot: thanks =)
11:54 anon_ joined #perl6
12:04 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 #perl6
12:11 anon timotimo: the link about "Perl 6 in Context" is wrong?
12:12 timotimo it is?
12:12 timotimo one sec
12:13 timotimo indeed
12:13 timotimo updated
12:14 anon great
12:16 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:17 sergot m: ::IO::Socket::INET
12:17 camelia rakudo-moar cdf80c: ( no output )
12:17 timotimo sergot: you can have an our sub EXPORT
12:18 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␤»
12:18 timotimo but it's hard to have a "export was not called" thing going on
12:18 timotimo as the mainline will be executed before the EXPORT sub ...
12:19 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:20 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.
12:20 sergot timotimo: yes
12:20 timotimo "if it is installed" is much easier
12:20 sergot And even better in this case I think :)
12:20 timotimo m: my $res = try require IO::Socket::SSL <IO::Socket::SSL::TheClass>; say IO::Socket::SSL; say $res;
12:20 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;
12:21 camelia rakudo-moar cdf80c: OUTPUT«(Any)␤»
12:22 sergot TheClass? what is this?
12:23 sergot 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␤»
12:25 sergot timotimo: it doesn't seem to work.
12:25 Alina-malina joined #perl6
12:26 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 timotimo if it fails, it'll raise a run-time exception, which you can catch
12:28 timotimo m: say 1 cmp 6
12:28 camelia rakudo-moar cdf80c: OUTPUT«Less␤»
12:29 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:30 timotimo 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 timotimo but you can ask the user to use HTTP::UserAgent <SSL>; or something
12:31 sergot Does camelia have access to some p6 modules?
12:31 sergot to try it live
12:32 timotimo if you use "star:" instead of "m:"
12:33 timotimo but the latest rakudo star is kinda old by now
12:33 timotimo star: say $*PERL
12:33 camelia star-m 2014.04: OUTPUT«{"compiler" => {"release-number" => "", "build-date" => "2014-05-06T17:09:26Z", "ver" => "2014.04", "name" => "rakudo", "codename" => ""}, "name" => "rakudo"}␤»
12:33 camelia ..star-p 2014.04: OUTPUT«{"compiler" => {"codename" => "", "ver" => "2014.04", "build-date" => "2014-05-06T17:16:05Z", "name" => "rakudo", "release-number" => ""}, "name" => "rakudo"}␤»
12:33 sergot oh, right, it is
12:33 sergot anyway
12:33 sergot timotimo++
12:33 sergot thanks :)
12:33 timotimo YW :)
12:34 Sterver joined #perl6
12:36 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 https://github.com/perl6/perl6-examples (just example code) or http://learnxinyminutes.com/docs/perl6/ (much more explanation)
12:37 timotimo 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 http://learnxinyminutes.com/docs/perl6/ but it was file on github, and it was more recent
12:38 timotimo https://github.com/Nami-Doc/learnxinyminu​tes-docs/blob/master/perl6.html.markdown - could be this
12:39 timotimo sergot: you have passed GSoC with flying colours, right?
12:39 sergot timotimo: I always get (Any) in $res. :(
12:40 sergot timotimo: yes :)
12:40 timotimo could be that require doesn't have a return value
12:40 timotimo in that case you can inspect $! i believe?
12:40 timotimo you just have to make sure you don't put { } around the require statement
12:40 timotimo otherwise the symbols will only be visible in there; i made that mistake before :)
12:40 Sterver timotimo, yeah, it is :) thanks
12:42 sergot timotimo: $! contains error, thanks
12:43 sergot I thoght I can use :: somehow.
12:43 sergot thought
12:44 timotimo you mean to access the "caller's" pseudostash?
12:44 sergot yes
12:45 timotimo that's what i was unsure about :\
12:45 xfix joined #perl6
12:45 xfix joined #perl6
12:47 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:48 sergot timotimo: I can use $!
12:48 sergot timotimo: you asked about GSoC
12:50 nine_ tadzik: you may want to join soon ;)
12:51 Sterver left #perl6
12:52 chenryn joined #perl6
12:52 PerlJam greetings
12:52 _thou joined #perl6
12:56 rurban nine_: Impressive lightning talk about inline::perl5!
12:56 rurban blitzkost #3
13:01 xenoterracide joined #perl6
13:06 jnthn oh my, how much backlog...
13:06 moritz jnthn: could you please test if the makefile-line-length rakudo branch builds on windows?
13:06 moritz jnthn: if yes, please merge into nom; it fixes a mac os X build issue ("write error")
13:07 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 #perl6
13:07 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
13:08 nwc10 oh. oops.
13:08 moritz http://irclog.perlgeek.de/​perl6/2014-08-26#i_9243290
13:08 anon_ joined #perl6
13:08 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
13:09 brrt moritz: that is so totally cool and awesome
13:09 brrt TimToady++
13:09 jnthn anon_: What, specifically, doesn't work well? :)
13:09 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 #perl6
13:10 raiph joined #perl6
13:10 anon jnthn: only "Characters: " text works
13:10 nwc10 colomon: cool
13:11 colomon nwc10: it's hard to say how substantial, alas, as the profiler seems to return significantly different overall times on different runs.
13:12 colomon but it seemingly involved hacking about 30% off the overall running time.
13:12 jnthn moritz: Tryig it.
13:12 spider-mario joined #perl6
13:12 jnthn *Trying
13:13 * 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?
13:14 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
13:14 anon 4G
13:14 jnthn I need to do something about that...
13:14 spider-mario joined #perl6
13:14 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:15 nwc10 I think the largest thing that I have access to has 96G of RAM
13:15 nwc10 apart from the main work DB server, which has more, but that is the main work DB server...
13:15 jnthn moritz: It seems good to me.
13:15 jnthn moritz: Manages to build and make test just fine.
13:16 chenryn joined #perl6
13:16 jnthn nwc10: Yes, maybe don't use that.
13:17 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
13:17 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 brrt 96G :-o
13:17 brrt how even
13:20 guru joined #perl6
13:21 dalek rakudo/nom: dea7adf | moritz++ | / (5 files):
13:21 dalek rakudo/nom: Read bootstrap sources from file
13:21 dalek rakudo/nom:
13:21 dalek rakudo/nom: because make on Mac OS X has a line length limit in commands
13:21 dalek rakudo/nom: (symptom: "write error")
13:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dea7adf299
13:22 dalek rakudo/nom: c693d75 | moritz++ | / (3 files):
13:22 dalek rakudo/nom: Do not pass M_CORE_SOURCES on the command line
13:22 dalek rakudo/nom:
13:22 dalek rakudo/nom: it is too long for Mac OS X make
13:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c693d75273
13:22 dalek rakudo/nom: 3e55a0d | moritz++ | src/core/IO.pm:
13:22 dalek rakudo/nom: [IO::Path] be more consistent with IO::Path:D markers for the invocant
13:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3e55a0d513
13:22 dalek rakudo/nom: ba9d01d | moritz++ | / (6 files):
13:22 dalek rakudo/nom: Merge branch 'makefile-line-length' into nom
13:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ba9d01d01c
13:22 moritz that should fix the "write error" bug on mac os x for MoarVM builds
13:22 moritz s/fix/work around/
13:22 colomon moritz++
13:23 jnthn oh hurrah!
13:23 jnthn moritz++ indeed
13:23 moritz tgt++ golfed it down
13:23 moritz maybe I should do the same for the JVM build
13:23 jnthn Wow
13:24 moritz (the problem being that in certain constellations, make doesn't like command lines > 1024 chars on mac os X)
13:24 jnap joined #perl6
13:24 masak moritz`
13:24 masak er, moritz++
13:25 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.
13:26 nwc10 clearly different OS X is different
13:26 nine_ I can now use Perl 5's DBI in Perl 6 :)
13:26 JimmyZ nine_++ # that's fast!
13:26 moritz woah
13:27 nine_ Everything available on https://github.com/niner/Inline-Perl5
13:29 nine_ And the weird my $dbh = @dbh[0]; is just because I really suck at Perl 6...
13:29 bjz joined #perl6
13:32 colomon nine_: would be good to add that to the p6 module ecosystem....
13:33 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:35 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! :)
13:36 * colomon is dismayed that searching for info on creating p6 modules turns up a bunch of obsolete information...
13:36 JimmyZ_ joined #perl6
13:37 JimmyZ__ joined #perl6
13:40 agen4 joined #perl6
13:40 agen4 /msg camelia
13:42 hoelzro hmm...S26 doesn't seem to work on jakudo or pakudo
13:42 kaare_ joined #perl6
13:43 betterworld m: "" ~ Buf.new
13:43 camelia rakudo-moar cdf80c: OUTPUT«(signal )»
13:43 betterworld this hangs rakudo.  In an older version, it printed error messages in an endless loop
13:46 masak cute graphs: https://github.com/Dobiasd/programmi​ng-language-subreddits-and-their-cho​ice-of-words/blob/master/README.md
13:46 FROGGS betterworld: there is already an RT ticket...
13:47 betterworld oh, I did not check that, sorry
13:51 potatogim_ joined #perl6
13:52 SamuraiJack joined #perl6
13:54 potatogim_ joined #perl6
13:57 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:58 grondilu joined #perl6
13:58 jnthn Pre-declare one of them
13:58 jnthn class B { ... }
13:59 nine_ jnthn: ah with "...". Thanks!
14:00 _thou joined #perl6
14:02 mberends joined #perl6
14:05 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:12 jnthn I guess you could write it as method init() { self // self.new }
14:13 jnthn If I remember what the p5 code does correctly, anyway. ;)
14:14 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:15 nine_ Now I only need to find out how to overload call and it will be $dbh.selectrow_array("select count(*) from products); :)
14:16 mrf jnthn: the idea being to swap a class str for an object ref
14:16 jnthn String?!
14:17 nine_ s/overload call/do something like AUTOLOAD/
14:17 * jnthn thinks he'll leave this one to somebody who knows Perl 5 :)
14:17 jnthn We almost never think of types by their string name in Pelr 6.
14:17 jnthn *Perl
14:17 nine_ mrf: I'd guess that in Perl 6 classes are full blown objects instead of just names.
14:18 geekosaur perl5's oo is an out and out hack. yes, strings.
14:19 geekosaur there's a reason they adopted an old prototype of p6's mop as a real OO interface :)
14:19 * jnthn chuckles
14:19 jnthn my SomeClassName $x .= new; # is a common Perl 6 idiom
14:19 jnthn Not sure if it applies in this case
14:22 jnthn 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?
14:23 jnthn Preferably.
14:23 nwc10 JIT or not?
14:23 jnthn Since that's what I've got on Windows.
14:23 jnthn JIT.
14:23 jnthn I've just compared rel2abs on Windows and posix and the Windows one is probably rather more costly.
14:24 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 nwc10 but I have no idea how representative that is of optimised builds
14:26 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:27 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'"
14:28 nwc10 OK, 6 minutes later, spectest pass
14:28 mrf PerlJam: Any specific pastebin?
14:28 PerlJam mrf: any is fine with me.
14:28 nwc10 pypy - can you beat that? :-)
14:29 nwc10 rubinius - how low can you go?
14:29 PerlJam nwc10: none of those have spectests though  ;)
14:29 nwc10 good point
14:31 nine_ Is CANDO even implemented? acking rakudo's source yields nothing at all
14:31 PerlJam nine_: I doubt it.
14:31 nwc10 jnthn: http://ccl4.org/~nick/prof​ile-1409063326.04419.html
14:31 nine_ PerlJam: damn...so no way to make progress on that front for now.
14:31 nwc10 "my" machine is x86_64 CentOS, and has loadsaRAM
14:32 nwc10 rel2abs at 13.46%
14:32 nwc10 about to go to http://www.meetup.com/Vienna-P​erl-Mongers/events/201277862/ so won't be around to re-run stuff this evening
14:33 jnthn nwc10: Thanks!
14:33 nwc10 no problem
14:33 * jnthn waits for it to download :)
14:33 PotatoGim^Laptop joined #perl6
14:34 nwc10 did you want it compressed?
14:34 jnthn It's fine; this wifi ain't the fastest
14:35 jnthn Though I just noticed there seems to be a network cable on the desk here too
14:35 dalek rakudo/nom: cfdf260 | jonathan++ | src/core/IO.pm:
14:35 dalek rakudo/nom: Don't try to rel2abs open '-'.
14:35 dalek rakudo/nom:
14:35 dalek rakudo/nom: Seems this isn't the source of the costly rel2abs calls, however, so
14:35 dalek rakudo/nom: only a minor win from this.
14:35 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cfdf260421
14:35 dalek rakudo/nom: 8af523b | jonathan++ | src/core/Supply.pm:
14:35 dalek rakudo/nom: Don't derive grammar in CORE.setting.
14:35 dalek rakudo/nom:
14:35 dalek rakudo/nom: Fixes an issue reported by donaldh++ where we were declaring a new op
14:35 dalek rakudo/nom: inside of the setting. This caused a new grammar to be derived, which
14:35 dalek rakudo/nom: in turn ended up including fresh NFAs and an entire copy of the source
14:35 dalek rakudo/nom: to end up the file too! Fixing this shaves ~6MB off CORE.setting size,
14:35 dalek rakudo/nom: about 14MB off base memory, and decreases startup time too.
14:35 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8af523bd23
14:37 mrf PerlJam: http://pastebin.com/XEsxLfVG
14:37 japhb Whee, may other wins be as easy as that one!
14:37 mrf PerlJam: That code snippet should show what I am attempting to do
14:37 PotatoGim^Home joined #perl6
14:39 PotatoGim^Home joined #perl6
14:40 masak nine_: try 'git grep' instead of 'ack'. it's faster, and it plays really well with git repositories.
14:43 * colomon ponders writing a grammar to parse the output of git log --stat
14:43 nwc10 jnthn: new profile at profile-1409064143.23213.html
14:43 nwc10 er
14:43 nwc10 http://ccl4.org/~nick/prof​ile-1409064143.23213.html
14:43 nwc10 but you might want http://ccl4.org/~nick/profi​le-1409064143.23213.html.gz if your bandwidth is bad
14:44 nwc10 203K rather than 4.1M
14:44 colomon nwc10: when I go to http://ccl4.org/~nick/prof​ile-1409064143.23213.html… oh!  It just takes a while to load!
14:44 nwc10 Oh yes.
14:45 nwc10 sadly that friend's toybox is no longer in the office of an ISP
14:45 * colomon didn't post a profile that way the other day because he thought it wasn't working.
14:45 nwc10 using all their unsold fibre
14:45 nwc10 which was fun
14:45 nwc10 Casey was downloading a Perl 5 RC
14:45 nwc10 the bottleneck was in the wifi in starbucks
14:45 anaeem1_ joined #perl6
14:45 nwc10 on the other side of the pond.
14:46 TimToady too much pond scum, maybe
14:46 nwc10 no, the transatlantic link was fine
14:46 nwc10 it was faster than the starbucks wifi
14:46 nwc10 and I don't think that the starbucks wifi was particularly slow.
14:47 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
14:48 TimToady *accidentally
14:48 colomon jnthn: suggestion: could we include the full command line used in the profiler output?
14:49 * 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?
14:49 * TimToady too
14:50 [Coke] (RT #122604) added "testneeded"
14:50 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=122604
14:50 Timbus mrf, if you want to check if self is defined in your method
14:50 dalek rakudo-star-daily: b21121a | coke++ | log/ (14 files):
14:50 dalek rakudo-star-daily: today (automated commit)
14:50 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/b21121a851
14:50 Timbus .. do exactly that
14:51 Timbus if self { }
14:52 molaf joined #perl6
14:53 TimToady there's a specced FALLBACK method, not yet implemented
14:54 mrf Timbus: if I call Foo::Bar.init whould self be defined?
14:54 TimToady it would presumably call the existing .^add_fallback metamethod to install itself
14:54 TimToady nine_: ^^
14:55 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
14:55 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 Timbus when undefined, i believe self is a type object
14:57 jnthn Time for some sleep... &
14:58 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. :)
14:59 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 spider-mario joined #perl6
15:00 * mrf maybe trying to force bad perl6 paradigms on perl6
15:01 Timbus if you just want a class variable that isn't tied to an instance of the class, use 'my' instead of 'has'
15:03 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:04 nine_ mrf: how about using a multi method for that?
15:04 Timbus ^ beat me to it
15:04 mrf Multi method?
15:04 nine_ mrf: class Foo { multi method init (Str) { self.new().init() } multi method init (Foo) { ... } } or something like that
15:05 Timbus well. id probably use the :D check on the invocant, probably
15:05 * nine_ is still an absolute Perl 6 beginner
15:05 mrf nine_: you seem to be doing better than me :D
15:08 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 class␤actual instance␤»
15:09 akaseki joined #perl6
15:10 xinming joined #perl6
15:10 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«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/YFIE4kpOACâ�¤Variable '$g' is not declaredâ�¤at /tmp/YFIE4kpOAC:1â�¤------> [32m}; my $f = Foo; $f.init([1,2,3]).say; $g[33mâ��[31m = Foo.new; $g.init([4,5,6]).say[0mâ�¤    expecting any of:â�¤ …»
15:11 psch my my
15:11 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; my $g = Foo.new; $g.init([4,5,6]).say
15:11 camelia rakudo-moar ba9d01: OUTPUT«1 2 3␤4 5 6␤»
15:11 psch that's slightly horrible though, in my opinion
15:11 Timbus i think i did that in some code somewhere and  i hate it
15:13 MilkmanDan joined #perl6
15:14 chenryn joined #perl6
15:17 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.
15:17 btyler ultimately healthier for the ecosystem if JSON::Tiny is sufficient for most needs, I think
15:18 colomon dunno if JSON::Tiny's a better fit, it's just something I've got working NOW.  :)
15:18 treehug88 joined #perl6
15:19 colomon btyler: doing a crazy balancing act here, if you know what I mean.
15:20 btyler colomon: totally hear you on the value of 'it works right now' :)
15:21 * 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 mrf joined #perl6
15:22 guru joined #perl6
15:23 * colomon ponders the difference between v and n
15:24 TimToady well, something is usually better than nothing, if only as a bad example :)
15:30 chenryn joined #perl6
15:31 colomon panda install Grammar::Debugger
15:31 colomon ===SORRY!===
15:31 colomon Could not find Shell::Command
15:31 colomon :\
15:31 mrf joined #perl6
15:33 TimToady colomon: I suspect the only difference is that \n will match CRLF
15:33 colomon ah, as one thing?
15:35 Alina-malina joined #perl6
15:36 chenryn joined #perl6
15:37 JimmyZ joined #perl6
15:41 TimToady m: say so "\xd\xa" ~~ /^ \n $/
15:41 camelia rakudo-moar ba9d01: OUTPUT«True␤»
15:41 TimToady m: say so "\xd\xa" ~~ /^ \v $/
15:41 camelia rakudo-moar ba9d01: OUTPUT«False␤»
15:43 chenryn joined #perl6
15:53 firefish5000 joined #perl6
15:53 JimmyZ jnthn++ # CORE.setting.moarvm size is 6M smaller
15:54 xinming_ joined #perl6
15:58 MilkmanDan joined #perl6
15:59 firefish5000 Good day. How do you ignore-case for a token?I have tried <token tkn :i {...}> and <token :i tkn {...}>.
16:00 TimToady try putting the :i inside the brackets
16:00 firefish5000 Ahh. much better. Thanks TimToaday!
16:01 PerlJam firefish5000: What kind of grammar are you writing?
16:04 firefish5000 PerlJam: Im just playing around right now. This one parses time strings like '3d1h4s'
16:04 PerlJam neat.
16:04 PerlJam play on!  :)
16:05 chenryn joined #perl6
16:09 MilkmanDan joined #perl6
16:13 jack_rabbit joined #perl6
16:17 * colomon just made his grammar explode
16:21 Rotwang joined #perl6
16:28 nine_ What's the closest thing to Perl 5's undef there is in Perl 6?
16:28 moritz nine_: Any
16:29 moritz nine_: are you marshalling things between p5 and p6?
16:29 nine_ moritz: yes
16:29 moritz nine_: in the p5 -> p6 direction, I'd translate undef to Any
16:30 moritz nine_: and in the other direction, any value that's not .defined to undef
16:32 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:35 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
16:35 camelia rakudo-moar 8af523: OUTPUT«use of uninitialized value of type Any in numeric context  in block <unit> at /tmp/loqK19mpvH:1␤␤42␤»
16:36 moritz m: '23 + 42' ~~ /(\d+) \D+ (\d+) { make $0 + $1 }/; say $/.ast # for firefish5000
16:36 camelia rakudo-moar 8af523: OUTPUT«65␤»
16:36 moritz firefish5000: the idiomatic thing is to use make(), which stores the result in $/.ast
16:36 moritz m: '23 + 42' ~~ /(\d+) \D+ (\d+) { make $0 + $1 }/; say $/.made
16:36 camelia rakudo-moar 8af523: OUTPUT«65␤»
16:36 moritz in .made; I think .ast is old/deprecated
16:39 firefish5000 moritz: Thanks, that did it!
16:39 TimToady in some respects undef is more like Nil
16:39 TimToady but Nil is still misbehaving in list contexts
16:39 TimToady (I think)
16:40 TimToady m: my @a = 1, Nil, 3; say @a.elems
16:40 camelia rakudo-moar 8af523: OUTPUT«2␤»
16:40 TimToady yeah
16:41 TimToady we need to figure out where we're currently depending on the () semantics
16:41 TimToady and use () instead
16:44 Util joined #perl6
16:44 nine_ Now workign: say $dbh.call("selectall_arrayref", "select * from products where id < ?", Any, 10).perl;
16:44 nine_ In other words: only passing arrays and hashes from Perl 6 to Perl 5 missing for full DBI access :)
16:44 xfix r: say [+] grep * %% 2, (1, 1, *+* ...^ * > 4_000_000);
16:44 nine_ Have to leave now though...more on this tomorrow
16:45 camelia rakudo-jvm 8af523: OUTPUT«(timeout)»
16:45 camelia ..rakudo-{parrot,moar} 8af523: OUTPUT«4613732␤»
16:48 colomon jnthn: if the Grammar trace ends with * MATCH, doesn't that mean the entire rule matched?
16:48 PerlJam joined #perl6
16:51 jnap joined #perl6
16:51 colomon oh, does parse actually fail if the entire string is not parsed now?
16:52 TimToady yes, use subparse if you want to stop in the middle
16:53 xfix r: say [+] grep *%%2,(1,1,*+*...^*>4e6)
16:53 camelia rakudo-{parrot,jvm,moar} 8af523: OUTPUT«4613732␤»
16:53 colomon TimToady: I didn't want to stop in the middle, just the optional last section was failing the match.   :)
16:53 colomon failing to match, I should say.
16:54 guru joined #perl6
16:56 akaseki joined #perl6
16:56 colomon whomever-fixed-parse++
16:57 tadzik joined #perl6
17:03 tadzik joined #perl6
17:04 Util joined #perl6
17:06 telex joined #perl6
17:07 colomon jnthn++ # Grammar::Tracer still rocks
17:09 Util joined #perl6
17:11 akaseki joined #perl6
17:15 tadzik joined #perl6
17:17 PerlJam joined #perl6
17:21 kaleem joined #perl6
17:22 guru joined #perl6
17:23 tgt joined #perl6
17:24 timotimo o/
17:28 moritz \o
17:33 colomon |o|
17:33 TimToady .oO(touchdown?)
17:34 colomon .oO(TIE fighter)
17:35 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
17:35 tadzik is it just me or feather is having problems?
17:35 moritz colomon: lines()
17:35 moritz colomon: the handle is called $*ARGFILES or so
17:35 colomon moritz: what if you want to read everything into a single string?
17:36 moritz m: say $*ARGFILES.slurp.chars
17:36 camelia rakudo-moar 8af523: OUTPUT«1134␤»
17:36 colomon moritz++ # $*ARGFILES is exactly it
17:36 moritz m: say slurp().chars
17:36 camelia rakudo-moar 8af523: OUTPUT«1134␤»
17:36 moritz colomon: slurp() should have the same default
17:36 colomon oh!
17:36 * colomon feels like an idiot now
17:37 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
17:37 colomon FROGGS: we should form a club
17:37 FROGGS and I mean >10 hours a day
17:38 FROGGS yeah :/
17:39 colomon BTW, being able to add { say $<commit-name> } in the middle of the grammar is pretty darned awesome
17:41 FROGGS my default is to add things like: <?{ say "$?FILE:$?LINE &?ROUTINE.name()" }>
17:41 FROGGS like in v5's grammar
17:41 FROGGS because grammar tracer can't help me there
17:45 BizarreCake joined #perl6
17:45 colomon FROGGS: I'm using it as a progress track, how far it's gotten in the file, and where it stops.
17:46 FROGGS I've currently a problem that v5 hangs somewhere in the grammar after parsing a statement
17:47 rindolf joined #perl6
17:51 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 colomon seems like that's much better performance than I've seen in the past...
17:51 Ven joined #perl6
17:51 FROGGS 11.3s sounds not too bad, aye
17:53 [Sno] joined #perl6
17:54 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.
18:03 Ven timotimo: the learnxinyminutes file is not on my github account, it's on the original one :)
18:03 Ven (wrt http://irclog.perlgeek.de/​perl6/2014-08-26#i_9244515 )
18:03 dalek specs: 96719fa | (Stéphane Payrard)++ | S99-glossary.pod:
18:03 dalek specs: fix formatting errors
18:03 dalek specs: review: https://github.com/perl6/specs/commit/96719fa38c
18:04 fling joined #perl6
18:07 dalek perl6-roast-data: 1fef0fa | coke++ | / (6 files):
18:07 dalek perl6-roast-data: today (automated commit)
18:07 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/1fef0fa8b5
18:08 molaf_ joined #perl6
18:09 timotimo Ven: sorry :|
18:09 timotimo sterver isn't around any more, though :(
18:10 Ven yes, which is why I answered to you :)
18:10 Ven Well, I already manually merged learnperl6iny PR manually, I could do it again anyway
18:12 * Ven disagrees a bit with litchkind++'s slides on the brain part :)
18:13 Ven (emotions are in front, graphics is behind)
18:13 TimToady well, emotions are kind of in the middle :)
18:13 [Coke] disk access on feather seems really slow.
18:14 Ven TimToady: the frontal lobe is responsible for reasoning and emotions
18:14 TimToady mostly for controlling emotions :)
18:14 Ven well, it's the most developed part
18:17 TimToady [Coke]: maybe feather is having negative emotions deep down inside :)
18:18 [Coke] htop wasn't reporting anything big on cpu or memory, but launching any new command is verrry slow.
18:18 [Coke] r: say "what?"
18:18 camelia rakudo-{parrot,jvm,moar} 8af523: OUTPUT«what?␤»
18:18 [Coke] huh: load average: 18.42, 13.12, 9.23
18:19 Ven that's a big word.
18:19 [Coke] (that's with 5% of cpu)
18:19 TimToady how many processes in D state?
18:19 ecocode_ joined #perl6
18:20 [Coke] 6
18:21 TimToady could well be disk then
18:21 tadzik what's up with feather :(
18:21 [Coke] kjournald, flush-254:0, syslogd, sshguard, ./run ... now 5. root & syslog
18:22 [Coke] weechat-curses from tjs was in there for a bit
18:22 TimToady disk might be overloaded or failing
18:22 ardeshir joined #perl6
18:22 [Coke] urk. now like 20, including a ton of apache2 processes.
18:22 TimToady does it have a log of failures/resets somewhere
18:22 [Coke] .seen juerd?
18:22 yoleaux I haven't seen juerd? around.
18:22 [Coke] .seen juerd
18:22 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
18:22 tadzik me weechat has been causing trouble before, I hope it's not at it again
18:22 TimToady might just be robots banging on it
18:24 TimToady or it might just have been promoted to its level of incompetence
18:26 [Coke] moritz++ os x fixed.
18:26 Ven joined #perl6
18:27 FROGGS [Coke]: what is fixed?
18:27 [Coke] pinged Randal to let him know.
18:27 [Coke] the make write error.
18:27 FROGGS ohh!
18:27 FROGGS moritz++ # \o/
18:30 * colomon just did $match<date><year month day>.join("-"), which he thinks is quite elegant.
18:31 tadzik <
18:31 tadzik <3
18:33 Akagi201 joined #perl6
18:34 [Coke] install rakudo-moar. install panda. install rakudo-moar. sadface.
18:35 [Coke] should I have to reinstall everything after updating rakudo?
18:36 timotimo yes, sadly
18:36 timotimo all the precompiled modules will have references and dependencies on specific compunits and serialization IDs
18:37 timotimo making a "migration strategy" for that is probably a very Hard Problem.
18:37 PerlJam rakudobrew++
18:38 colomon [Coke]: panda rebootstrap
18:38 FROGGS [Coke]: just chdir panda && perl6 rebootstrap.pl && coffee
18:38 FROGGS (or coke)
18:38 colomon but yeah, rakudobrew++
18:42 colomon in which case a full update is normally just rakudobrew build moar
18:42 colomon and panda rebootstrap happens automatically.
18:42 timotimo cool
18:42 colomon tadzik++
18:43 tadzik :)
18:45 kjs_ joined #perl6
18:47 colomon m: say <a b c>.first-index('b') + 1
18:47 camelia rakudo-moar 8af523: OUTPUT«2␤»
18:47 colomon m: say <a b c>.first-index(* eq 'b') + 1
18:48 camelia rakudo-moar 8af523: OUTPUT«2␤»
18:48 TimToady the nqp version of http://rosettacode.org/wiki/It​erated_digits_squaring#Perl_6 runs in 40% of the time of the best jittable pure Perl6 version
18:48 colomon huh, that's getting me No such method 'item' for invocant of type 'NQPMu'
18:48 colomon locally
18:48 Ven joined #perl6
18:49 colomon oh
18:49 FROGGS colomon: can you pass --ll-exception to it?
18:49 colomon FROGGS: actual error was in a different line
18:49 FROGGS I'd like to know where in Perl6::Actions this happens
18:50 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␤␤»
18:50 colomon that's the code
18:50 FROGGS ohh
18:50 colomon (extra space is the problem)
18:50 FROGGS that explodes while constructing the exception me thinks
18:51 Ven "@list = 1, 2, 3 same as $list = (1, 2, 3)" wut??
18:51 Ven @fib and $fib, actually. from lichtkind++'s slides
18:51 gfldex joined #perl6
18:52 Ven "for forces list context"  er, that seems kinda wrong
18:53 FROGGS colomon: that might fix it:
18:53 FROGGS -"Type check failed in $.operation; expected '{$.expected.^name}' but got '{$.got.^name}'";
18:53 FROGGS +"Type check failed in $!operation; expected '{$!expected.HOW.name($!expected)}' but got '{$!got.HOW.name($!got)}'";
18:53 [Coke] $ perl6 rebootstrap.pl
18:53 [Coke] use of uninitialized value of type Any in string context  in block <unit> at rebootstrap.pl:27
18:53 FROGGS in my class X::TypeCheck is Exceptio
18:54 colomon [Coke]: hmmm… either you've got an out-of-date panda, panda is broken, or the module being rebootstrapped is broken.
18:54 colomon [Coke]: it does work in general, honest
18:55 [Coke] it worked, but I got 3 or 4 warnings.
18:59 [Coke] 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
19:01 FROGGS or rebootstrap it
19:01 FROGGS this will also use and install itself
19:01 [Coke] my $list = from-json slurp $!projectsfile;
19:01 [Coke] ^^ $!projectsfile is undefined when I run "panda"
19:02 [Coke] complains when I have http_proxy set.
19:12 [Coke] 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 [Coke] m: say from-json " "
19:12 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␤␤»
19:12 [Coke] ^^
19:13 colomon hmmm, anyone have an elegant way to ensure that the last character of a string is a period?
19:14 PerlJam joined #perl6
19:14 [Coke] also, the local panda should probably not be pointing there.
19:14 [Coke] (to the install dir)
19:16 Sqirrel joined #perl6
19:18 TimToady colomon: $string ~= '.';   # :P
19:19 flussence .oO( subset ProperlyPunctuatedStr of Str where /\.$/ ... )
19:21 TimToady hmm, p5 does an optimization where it knows it can start scanning that one from the end of the string
19:21 TimToady I'll bet we don't do that one yet
19:22 TimToady colomon: by "ensure", do you mean test, or do you want add one if there isn't one?
19:23 TimToady m: my $_ = 'foo'; s/ <-[.]> <( /./; .say
19:23 camelia rakudo-moar 8af523: OUTPUT«Potential difficulties:â�¤    Redeclaration of symbol $_â�¤    at /tmp/Uf9HpOWlul:1â�¤    ------> [32mmy $_ [33mâ��[31m= 'foo'; s/ <-[.]> <( /./; .say[0mâ�¤f.ooâ�¤Â»
19:23 TimToady m: $_ = 'foo'; s/ <-[.]> <( $ /./; .say
19:23 camelia rakudo-moar 8af523: OUTPUT«foo.␤»
19:23 TimToady like that?
19:24 TimToady m: $_ = 'foo'; s/ <-[.]> $ <( /./; .say
19:24 camelia rakudo-moar 8af523: OUTPUT«foo.␤»
19:24 TimToady slightly faster, probably
19:24 TimToady m: $_ = 'foo'; s:p(.chars-1)/ <-[.]> $ <( /./; .say
19:24 camelia rakudo-moar 8af523: OUTPUT«foo.␤»
19:24 TimToady faster yet
19:24 Ven m: my @a = ^10; say @a[1].WHAT; say @a[1,].WHAT
19:24 camelia rakudo-moar 8af523: OUTPUT«(Int)␤(Parcel)␤»
19:25 colomon TimToady: I want to add one if there isn't one.
19:25 Ven I must admit that, *sometimes*, sigil variance has advantages
19:25 Ven I'd get bit by it so many times tho...
19:25 colomon TimToady++
19:27 TimToady m: say (1).WHAT; say (1,).WHAT; say (1;).WHAT
19:27 camelia rakudo-moar 8af523: OUTPUT«(Int)␤(Parcel)␤(Int)␤»
19:27 TimToady m: say (1).WHAT; say (1,).WHAT; say (1;2).WHAT
19:27 camelia rakudo-moar 8af523: OUTPUT«(Int)␤(Parcel)␤(LoL)␤»
19:27 TimToady looks like a buglet there, I'd think (1;) should also LoL
19:28 donaldh joined #perl6
19:28 TimToady gee, who wrote that code?  <whistles>
19:31 Ven :P
19:32 tadzik joined #perl6
19:36 Util joined #perl6
19:38 TimToady problem is it's just testing # of statements, and seeing 1
19:39 guru joined #perl6
19:39 * TimToady can think of several ways to fix it, so probably better nap on it
19:44 Util joined #perl6
19:44 tadzik joined #perl6
19:45 spider-mario joined #perl6
19:46 jack_rabbit joined #perl6
19:48 spider-mario joined #perl6
19:55 dalek rakudo/nom: d8048c9 | coke++ | docs/ChangeLog:
19:55 dalek rakudo/nom: keep ChangeLog up to date
19:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d8048c94a9
19:55 dalek rakudo/nom: 399faac | coke++ | docs/ChangeLog:
19:55 dalek rakudo/nom: remove trailing whitespace
19:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/399faacb40
19:57 kjs_ joined #perl6
20:04 Akagi201 joined #perl6
20:35 Ven .seen raiph
20:35 yoleaux I saw raiph 15 Aug 2014 18:33Z in #perl6: <raiph> cjqwesc
20:36 itz_ joined #perl6
20:39 tgt r: (*..100)[131072]
20:39 camelia rakudo-{parrot,jvm,moar} 8af523: ( no output )
20:39 tgt Huh. That breaks here with "P6opaque: no such attribute '$!storage'"
20:42 tgt r: (*..100)[1250000]
20:42 camelia rakudo-{parrot,jvm,moar} 8af523: ( no output )
20:42 moritz tgt: fixed in latest rakudo
20:43 tgt How latest? I cloned a few minutes ago.
20:43 moritz tgt: in commit ce0c258640222761ab8176aff92cf9bbe5b3665f by TimToady++
20:44 tgt Ah, sorry, nvm. Was using the wrong perl6.
20:44 itz joined #perl6
20:45 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
20:46 tgt I'll see if I can find it in the archive. It was about smartmatching against a stringy range.
20:46 FROGGS ahh
20:47 FROGGS m: say "b" ~ "a" .. "z"
20:47 camelia rakudo-moar 8af523: OUTPUT«"ba".."z"␤»
20:47 FROGGS m: say "b" ~~ "a" .. "z"
20:47 camelia rakudo-moar 8af523: OUTPUT«True␤»
20:47 FROGGS m: say "a" ~~ "b" .. "z"
20:47 camelia rakudo-moar 8af523: OUTPUT«False␤»
20:47 FROGGS okay, not trivial to guess :o)
20:47 tgt m: say "33" ~~ 1..5
20:47 camelia rakudo-moar 8af523: OUTPUT«True␤»
20:47 FROGGS ahh, that one
20:47 FROGGS no, I was unable to fix it
20:48 tgt m: say "bb" ~~ "a".."aaa"
20:48 camelia rakudo-moar 8af523: OUTPUT«False␤»
20:49 tgt Ah, okay.
20:49 tgt With that last one, I disagree with the spec.
20:50 tgt It says "X.min le $_ le X.max (mod ^'s)", which isn't at all what I'd usually expect.
20:51 moritz most other defnitions rely on some way to generate all possible strings between the end points
20:51 moritz which is kinda tricky in Unicode land
20:51 PerlJam moritz: you are a master of understatement :)
20:51 tgt Yeah, I was assuming that was the reason. Just seems like it'd not be what you'd want most of the time.
20:52 moritz the assumption that 'a'..'aaa' only generates ASCII characters is very much culturally laden
20:52 moritz loden
20:52 kurahaupo joined #perl6
20:52 moritz whatever
20:54 tgt True.
20:54 tgt Do Perl 6's ranges work outside of ASCII?
20:55 timotimo "ranges"?
20:55 timotimo .u one
20:55 yoleaux U+0011 DEVICE CONTROL ONE [Cc] (␑)
20:55 yoleaux U+001F INFORMATION SEPARATOR ONE [Cc] (␟)
20:55 yoleaux U+0031 DIGIT ONE [Nd] (1)
20:55 moritz m: say ('Ⅰ'..'Ⅴ')).list
20:55 camelia rakudo-moar 8af523: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/RDusUd6t8U�Unexpected closing bracket�at /tmp/RDusUd6t8U:1�------> [32msay ('Ⅰ'..'Ⅴ')[33m�[31m).list[0m�»
20:55 moritz m: say ('Ⅰ'..'Ⅴ').list
20:55 camelia rakudo-moar 8af523: OUTPUT«Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ␤»
20:55 moritz looks like a "yes" to me :-)
20:55 tgt :)
20:56 PerlJam I would think they'd *have* to work "outside of ASCII" for character classes to be useful.
20:56 PerlJam (or it would certainly be LTA for ranges to work differently depending on whether or not you were in a character class)
20:57 tgt I'll just need to adjust my expectations when smartmatching against stringy ranges.
20:59 tgt m: my $r = "a"..*; say $r.min le "b" le $r.max;
20:59 camelia rakudo-moar 8af523: OUTPUT«False␤»
20:59 kjs_ joined #perl6
21:00 tgt m: my $r = "a"..*; $r.max.WHAT.say; # Ah
21:01 camelia rakudo-moar 8af523: OUTPUT«(Num)␤»
21:01 tgt That's not quite right.
21:01 kurahaupo tgt: should it even *have* a max?
21:05 FROGGS m: my $r = "a"..*; say $r.max # is meant to be Inf
21:05 camelia rakudo-moar 8af523: OUTPUT«Inf␤»
21:05 kurahaupo Inf kinda makes sense, but it's not very stringy
21:05 tgt Shouldn't it be a stringy equivalent of Inf?
21:05 Akagi201 joined #perl6
21:05 FROGGS tgt how?
21:06 FROGGS gnight #perl6
21:06 kurahaupo a string consisting of an Inf number of \uffffffff chats?
21:06 tgt I don't know. My first example above seems surprising. (my $r = "a"..*; say $r.min le "b" le $r.max;)
21:06 kurahaupo chars*
21:06 moritz m: say 'b' ~~ 'a'..*
21:06 camelia rakudo-moar 8af523: OUTPUT«True␤»
21:07 tgt hmm.
21:07 kurahaupo Perhap Inf should be in its own class separate from Num?
21:08 [Coke] kurahaupo: that way lies madness.
21:08 [Coke] because then you have come up with a class that is basically a singleton that is also every other numeric (and string) type.
21:09 [Coke] m: say Nil.WHAT
21:09 camelia rakudo-moar 8af523: OUTPUT«Nil␤»
21:09 [Coke] Seems like we want something more Nilistic.
21:09 kurahaupo true
21:09 tgt moritz: I think that's because Range::ACCEPTS uses cmp?
21:10 moritz m: say 'z' ~~ 'a'..*
21:10 camelia rakudo-moar 8af523: OUTPUT«True␤»
21:10 moritz m: say 'Z' ~~ 'a'..*
21:10 camelia rakudo-moar 8af523: OUTPUT«False␤»
21:10 moritz m: say 'B' ~~ 'a'..*
21:10 camelia rakudo-moar 8af523: OUTPUT«False␤»
21:11 kurahaupo what about a singleton StrInf?
21:11 moritz there's another option
21:12 moritz one could store 'a'..* as 'a'..*
21:12 moritz that is, the actual whatever in the right endpoint
21:12 moritz and then special-case that in Range.ACCEPTS
21:12 moritz and in the generator
21:13 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   :)
21:14 moritz m: my $x = *; say $x.^name
21:14 camelia rakudo-moar 8af523: OUTPUT«Whatever␤»
21:21 Ven joined #perl6
21:28 donaldh joined #perl6
21:32 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:34 woolfy1 joined #perl6
21:35 Ven nine_++ :)
21:35 donaldh exciting # nine_++
21:37 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 moritz let x = if 1 == 1 { 42 } else { 23 }
21:37 moritz works as expected
21:37 moritz but if you write 42;  it assumes an empty expression (?) after the 42
21:38 moritz so x is () after that
21:39 moritz that's quite a difference to perl's "final ; is optional"
21:39 * Ven always puts the final ; due to some habit ... :P
21:40 ecocode_ joined #perl6
21:40 moritz Ven: I tend to do that too
21:40 Ven m: class A { sub foo { self.new(); } }; A.new.foo
21:40 camelia rakudo-moar 399faa: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/cc1HKNFX3Mâ�¤'self' used where no object is availableâ�¤at /tmp/cc1HKNFX3M:1â�¤------> [32mclass A { sub foo { [33mâ��[31mself.new(); } }; A.new.foo[0mâ�¤    expecting any of:â�¤        statemen…»
21:40 Ven m: class A { sub foo { $self.new(); } }; A.new.foo # err?
21:40 camelia rakudo-moar 399faa: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/8HHfOaJNuMâ�¤Variable '$self' is not declaredâ�¤at /tmp/8HHfOaJNuM:1â�¤------> [32mclass A { sub foo { $self.new()[33mâ��[31m; } }; A.new.foo # err?[0mâ�¤    expecting any of:â�¤        method a…»
21:40 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
21:41 Ven same problem as the "pending comma" one :)
21:41 Ven oh, sub.
21:41 Ven m: class A { method foo { self.new( } }; A.new.foo
21:41 camelia rakudo-moar 399faa: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/yojXDoL87Yâ�¤Unable to parse expression in argument list; couldn't find final ')' â�¤at /tmp/yojXDoL87Y:1â�¤------> [32mclass A { method foo { self.new( [33mâ��[31m} }; A.new.foo[0mâ�¤    expect…»
21:43 treehug88 joined #perl6
21:48 tgt Thanks for your help earlier moritz. (Having a go at storing * at the endpoints as you suggested.)
21:54 [Coke] Maybe we'll have a good answer to InfStr when we have RatStr settled.
21:58 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>'␤»
21:58 tgt Why is that the case?
22:00 tgt Ah, is means $a eq $b.
22:04 kjs_ joined #perl6
22:06 Akagi201 joined #perl6
22:16 woolfy1 left #perl6
22:18 woolfy joined #perl6
22:49 ilbot3 joined #perl6
22:49 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:,  niecza:, std:, or /msg camelia perl6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
22:50 PotatoGim^Home joined #perl6
22:55 ggherdov joined #perl6
22:55 isacloud____ joined #perl6
22:58 xragnar_ joined #perl6
23:00 colomon joined #perl6
23:02 bowtie_ joined #perl6
23:02 telex joined #perl6
23:02 aborazmeh joined #perl6
23:12 kurahaupo joined #perl6
23:16 colomon joined #perl6
23:23 araujo joined #perl6
23:25 vike joined #perl6
23:35 ardeshir joined #perl6
23:54 PZt joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo