Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-02-15

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:05 Juerd joined #perl6
00:18 brrt joined #perl6
00:21 AlexDaniel m: say **
00:21 camelia rakudo-moar 585619: OUTPUT«**␤»
00:21 AlexDaniel O_o
00:21 AlexDaniel m: say *
00:21 camelia rakudo-moar 585619: OUTPUT«*␤»
00:21 timotimo uruwi: mergesubstates and mergesubrule are about Longest Token Matching
00:21 AlexDaniel oh, ok
00:22 AlexDaniel m: say **,*,**,**,*,**
00:22 camelia rakudo-moar 585619: OUTPUT«**********␤»
00:22 timotimo uruwi: we generate an NFA for everything that's involved in LTM, and if you have a call to a subrule in the declarative prefix of a rule, that goes into the computation, too
00:24 timotimo uruwi: you can find that code inside the nqp repository under src/QRegex/NFA.nqp (i think) - if you can find something that makes that stuff faster, that'd be cool. the optimize method there is also a good candidate for optimization, as it contains a piece of deduplication code in the middle that's ... quadratic, i think?
00:25 timotimo there hasn't yet been a good idea for how to make a hashmap apply to that algorithm so that it would become a bit faster
00:25 timotimo the optimize function is very busy when you have a module that has lots and lots of operator definitions
00:26 timotimo only when that module gets compiled first, of course
00:28 timotimo ah, i see now
00:28 timotimo you have a left-recursing grammar, don't you
00:29 timotimo i think that might just be a worst-case for our grammars? or something? i seem to recall reading something along those lines
00:29 timotimo what do i know :)
00:37 limhk joined #perl6
00:39 dalek rakudo-star-daily: c7df306 | coke++ | log/ (8 files):
00:39 dalek rakudo-star-daily: today (automated commit)
00:39 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/c7df3060fb
00:53 gtbjj joined #perl6
00:55 BenGoldberg_ joined #perl6
00:58 BenGoldberg_ joined #perl6
01:03 yeahnoob joined #perl6
01:11 AlexDaniel b2gills: here?
01:13 b2gills AlexDaniel: Yes
01:15 AlexDaniel m: {substr $^a x$^b+1: 0,$a.chars*$b}(‘test case’, 3.33).say
01:15 camelia rakudo-moar 585619: OUTPUT«test casetest casetest casete␤»
01:16 AlexDaniel b2gills: that's 32 bytes I think
01:16 AlexDaniel m: {~($^a x$^b+1~~/.**{$a.chars*$b}/)}(‘test case’, 3.33).say
01:16 camelia rakudo-moar 585619: OUTPUT«test casetest casetest casete␤»
01:16 AlexDaniel I've also tried this but it is a bit longer I think
01:17 b2gills m: say "{substr $^a x$^b+1: 0,$a.chars*$b}".chars
01:17 camelia rakudo-moar 585619: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FibgajcYtq␤Placeholder variable $^a may not be used here because the surrounding block takes no signature␤at /tmp/FibgajcYtq:1␤------> 3say "{substr $^a x$^b+1: 0,$a.chars*$b}7⏏5".chars␤    expect…»
01:17 b2gills m: say '{substr $^a x$^b+1: 0,$a.chars*$b}'.chars
01:17 camelia rakudo-moar 585619: OUTPUT«34␤»
01:17 AlexDaniel oh ya including {} that's 34
01:17 AlexDaniel still shorter :)
01:17 b2gills It has to be a function, not a snippet.
01:18 AlexDaniel “Since the rules disallow string repetition,”
01:18 AlexDaniel ooh!
01:19 AlexDaniel I completely missed that
01:19 AlexDaniel nah then…
01:19 AlexDaniel damn rules :)
01:21 Actualeyes joined #perl6
01:22 [Coke] botsnack
01:36 apiw joined #perl6
01:50 revhippie left #perl6
02:11 vendethiel joined #perl6
02:24 Ben_Goldberg joined #perl6
02:41 partly_ joined #perl6
02:51 vendethiel joined #perl6
02:55 Zero_Dogg joined #perl6
02:55 abaugher joined #perl6
02:56 ryan_ joined #perl6
03:03 yeahnoob joined #perl6
03:05 noganex joined #perl6
03:07 ryan_ if I declare an attribute with has $!var, shouldn't I be able to access it in a method with $!var?
03:09 hoelzro ryan_: yes, you should
03:09 hoelzro ryan_: could you provide an example?
03:11 ryan_ class DaySchedule {
03:11 ryan_ has $!opening;
03:11 ryan_ has $!closing;
03:11 ryan_ method add-appointment($time, $client) {
03:11 ryan_ say $!opening;
03:11 ryan_ say $!closing;
03:11 ryan_ }
03:11 ryan_ }
03:11 ryan_ sub MAIN {
03:11 ryan_ my $sched = DaySchedule.new(opening => 9, closing => 17);
03:11 ryan_ $sched.add-appointment(10, ’Fred’);
03:11 ryan_ }
03:13 llfourn ryan_: you can't set $! attributes in .new
03:13 llfourn you will be able to set them in them add-appointment
03:14 llfourn you probably want to make them $. attributes
03:18 ryan_ ok, thank you
03:18 llfourn ryan_: note, you are not alone in expecting to be able to set them in .new. I wrote a module that lets you do it: https://github.com/LLFourn/p6-AttrX-InitArg
03:19 llfourn and you're welcome :)
03:20 llfourn m: my @data = 1,{},@data,"YEWHAT??"; say @data.perl # amusing new bug
03:20 camelia rakudo-moar 585619: OUTPUT«(my \Array_71124752 = [1, {}, Array_71124752, "YEWHAT??"])␤»
03:22 llfourn m: my $data = 1,{},$data,"YEWHAT??"; say $data.perl
03:22 camelia rakudo-moar 585619: OUTPUT«WARNINGS for /tmp/_DkGUH2bs6:␤Useless use of constant string "YEWHAT??" in sink context (lines 1, 1)␤1␤»
03:22 llfourn heh
04:01 Sqirrel joined #perl6
04:13 Ben_Goldberg m: my $data = (1,{},$data,"YEWHAT??"); say $data.perl
04:13 camelia rakudo-moar 585619: OUTPUT«(my \List_64275264 = $(1, {}, List_64275264, "YEWHAT??"))␤»
04:14 remmie joined #perl6
04:14 SWAN joined #perl6
04:15 AlexDaniel Ben_Goldberg: https://rt.perl.org/Public/Bug/Display.html?id=126858
04:17 AlexDaniel Ben_Goldberg: as far as I remember it is not supposed to be this way
04:20 adu joined #perl6
04:22 AlexDaniel yet I have no idea how one would prevent this :)
04:28 remmie hey! perl6.bat appears to crash my cygwin terminal for some reason
04:29 remmie oh! it seems to be because moar.exe lingers after i ^C
04:36 remmie hmmm, it works fine in cmd.exe
04:37 remmie but after i ^C out it momentarily hangs the cygwin shell
04:37 remmie i tried the unix version in cygwin and it didn't work
04:57 skids AlexDaniel: I don't think there's supposed to be an inherent prohibition on self-referential arrays, just eager flattening/iteration in combination with them.
05:00 colomon_ joined #perl6
05:16 ka joined #perl6
05:17 mohae joined #perl6
05:19 mr-foobar joined #perl6
05:44 Cabanossi joined #perl6
06:01 mohae joined #perl6
06:06 _Gustaf_ joined #perl6
06:28 |Tux| joined #perl6
06:36 CIAvash joined #perl6
07:02 [Tux] test            23.504
07:02 [Tux] test-t          12.151
07:02 [Tux] csv-parser      52.929
07:03 apejens joined #perl6
07:03 Util joined #perl6
07:03 Rotwang joined #perl6
07:03 lnx joined #perl6
07:04 xiaomiao joined #perl6
07:04 johan joined #perl6
07:04 ruoso joined #perl6
07:04 japhb joined #perl6
07:04 anshin joined #perl6
07:04 tinita joined #perl6
07:04 brabo joined #perl6
07:04 Exodist joined #perl6
07:04 klapperl joined #perl6
07:04 nowan joined #perl6
07:04 tharkun joined #perl6
07:04 El_Che joined #perl6
07:04 gregf_ joined #perl6
07:04 llfourn joined #perl6
07:04 aigan_ joined #perl6
07:04 matt_ joined #perl6
07:04 mprelude_ joined #perl6
07:04 zhmylove joined #perl6
07:04 SHODAN joined #perl6
07:04 nightfrog joined #perl6
07:04 emdashcomma joined #perl6
07:04 MadcapJake joined #perl6
07:04 gensym joined #perl6
07:04 autarch joined #perl6
07:04 xnrand joined #perl6
07:04 go|dfish joined #perl6
07:04 vike joined #perl6
07:04 inokenty joined #perl6
07:05 notbenh joined #perl6
07:06 sjohnsen joined #perl6
07:06 lestrrat joined #perl6
07:10 _mg_ joined #perl6
07:17 FROGGS joined #perl6
07:30 frankjh joined #perl6
07:42 firstdayonthejob joined #perl6
07:45 llfourn wow quietly is cool!
07:46 llfourn m: quietly try Cool/2
07:46 camelia rakudo-moar 585619: ( no output )
07:46 llfourn as opposed to
07:46 llfourn m: try Cool/2
07:46 camelia rakudo-moar 585619: OUTPUT«Use of uninitialized value of type Cool in numeric context  in code  at /tmp/LovdKylcpB line 1␤»
07:52 begunner joined #perl6
07:57 begunner hi, i am a absolute beginner and have following question: I looked for a string in an array with "my @funde = @array.grep/"matcher"/;" If nothing was found, the code with @funde {...} is nontheless executed. Why is this happening?
07:58 llfourn begunner: with @funde { } would be testing for definedness (if I understand you correctly)
07:59 llfourn why not use if?
08:00 nine m: my @array = <foo bar baz>; my @funde = @array.grep: /"matcher"/; if @funde { say @funde; }
08:00 camelia rakudo-moar 585619: ( no output )
08:00 begunner I used now "if @funde != [ ]" and it worked, but I wanted to understand, why the with block does not behave as expected.
08:00 begunner Is a empty list defined?
08:00 nine begunner: yes, it is
08:00 llfourn yep. just use if @funde { }
08:01 llfourn if it's empty it will be false
08:01 begunner ok thank you very much
08:01 llfourn m: say ?[];
08:01 camelia rakudo-moar 585619: OUTPUT«False␤»
08:01 begunner no i have understood
08:01 llfourn no worries :)
08:12 darutoko joined #perl6
08:25 CIAvash joined #perl6
08:30 ely-se joined #perl6
08:32 abraxxa joined #perl6
08:37 vytas joined #perl6
08:37 RabidGravy joined #perl6
08:42 rindolf joined #perl6
09:07 zakharyas joined #perl6
09:08 RabidGravy marning!
09:09 dakkar_ joined #perl6
09:11 Actualeyes joined #perl6
09:14 llfourn o/
09:15 pmurias joined #perl6
09:16 pmurias jnthn: should columns returned by  HLL::Compiler.line_and_column_of start from 0 or 1?
09:16 go|dfish joined #perl6
09:28 gcole_ joined #perl6
09:28 pyrimidi_ joined #perl6
09:28 dalek nqp: dc7d3d5 | (Pawel Murias)++ | src/HLL/Compiler.nqp:
09:28 dalek nqp: Convert tabs to spaces.
09:28 dalek nqp: review: https://github.com/perl6/nqp/commit/dc7d3d5ab9
09:28 dalek nqp: 5ac9283 | (Pawel Murias)++ | src/HLL/Compiler.nqp:
09:28 dalek nqp: Implement line_and_column_of.
09:28 dalek nqp: review: https://github.com/perl6/nqp/commit/5ac9283738
09:28 dalek nqp: 18ca9a7 | (Pawel Murias)++ | src/vm/js/ (3 files):
09:28 dalek nqp: [js] Generate source-maps with column info.
09:28 dalek nqp: review: https://github.com/perl6/nqp/commit/18ca9a7bb2
09:28 mithaldu__ joined #perl6
09:28 olinkl_ joined #perl6
09:28 aindilis` joined #perl6
09:28 sftp_ joined #perl6
09:28 timrs2991 joined #perl6
09:30 caasih joined #perl6
09:30 Perleone joined #perl6
09:34 kurahaupo joined #perl6
09:34 molaf joined #perl6
09:36 sjoshi joined #perl6
09:50 wamba joined #perl6
09:59 jnthn pmurias: I'd say "same as we do for line numbers", which I guess are 1-based
10:00 jnthn pmurias: It's for human output I guess, and even programmers seem to agree files start at line 1 :)
10:00 [Sno] joined #perl6
10:00 moritz it's a conspiracy of all those editors
10:01 jnthn A conspiracy led by Fortran programmers! /o\
10:03 rurban joined #perl6
10:12 vendethiel joined #perl6
10:18 moritz speaking of conspiracy theories: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0147905 is quite interesting
10:19 moritz it's a mathematical model for the likelyhood that a big conspiracy is uncovered from within
10:19 aindilis` joined #perl6
10:19 moritz and basically the big ones (climate, moon landing, cancer treatment) are far too big to survive more than a few years -- and that's even without considering external investigation
10:26 jnthn But what if this paper is a conspiracy to make us less likely to believe conspiracies?! *gasp* :)
10:27 TEttinger joined #perl6
10:28 moritz my question would be more like: what if the baseline likelyhood for exposing conspiracies is much lower? Because, we only know of exposed ones. There could be thousands of unexposed conspiracies that we can't even dream of right now, each involving millions of people!
10:30 bowtie joined #perl6
10:38 YP-QMUL-W joined #perl6
10:39 espadrine_ joined #perl6
10:53 lizmat good *, #perl6!
10:53 ocbtec joined #perl6
10:56 bpmedley joined #perl6
11:08 Skarsnik joined #perl6
11:09 gregf_ left #perl6
11:11 gregf__ joined #perl6
11:13 frankjh q
11:13 frankjh q
11:24 bowtie joined #perl6
11:27 dalek rakudo/nom: b1a9e62 | lizmat++ | src/core/DateTime.pm:
11:27 dalek rakudo/nom: Give DateTime.new a positional candidate again
11:27 dalek rakudo/nom:
11:27 dalek rakudo/nom: Also adapt .perl to use the faster positional interface.
11:27 dalek rakudo/nom:
11:27 dalek rakudo/nom: Please note this was not done by renaming the new-from-positional
11:27 dalek rakudo/nom: private method to "new", because we probably want to be able to
11:27 dalek rakudo/nom: programmatically recognize added methods / candidates in the (near)
11:27 dalek rakudo/nom: future, e.g. by adding a trait.
11:28 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b1a9e62bd4
11:30 bowtie_ joined #perl6
11:30 jnthn http://news.perlfoundation.org/2016/02/grant-proposal-perl-6-performa.html is looking for feedback from the community
11:30 kaare_ joined #perl6
11:32 moritz jnthn++
11:33 ChoHag joined #perl6
11:34 rindolf Hi all. Que pasa?
11:36 ely-se joined #perl6
11:37 Actualeyes joined #perl6
11:38 dalek doc: 9454fb3 | RabidGravy++ | doc/Type/Semaphore.pod:
11:38 dalek doc: Add Semaphore doc as per #393
11:38 dalek doc:
11:38 dalek doc: From @MARTINMM
11:38 dalek doc: review: https://github.com/perl6/doc/commit/9454fb3c32
11:41 lizmat jnthn: I'm not sure I understand what "make await non-blocking" means...  I mean, it's supposed to wait, isn't it ?
11:41 vendethiel joined #perl6
11:43 moritz lizmat: but it doesn't need to block a thread
11:43 lizmat that's not clear to most people from the description :-)
11:47 jnthn What moritz said, and I think it's the most reasonable interpretation :)
11:48 abraxxa joined #perl6
11:49 YP-QMUL-W joined #perl6
11:50 jnthn Anyways, if there's a question posted in the comments I'll happily post an explanation :)
11:51 lizmat so, technically, would you be able to force a deadock if you would have sufficient awaits at the moment?
11:51 jnthn Not just technically :)
11:52 moritz we actually had that
11:52 jnthn Any kind of recursive divide/conquer today will, if not carefully done, be likley to exhaust the thread pool.
11:52 moritz somebody wrote a blog post about it
11:53 lizmat ah, ok, I see, must have missed the blog post
11:53 dalek ecosystem: 3f61e9d | RabidGravy++ | META.list:
11:53 dalek ecosystem: Switch JSON::Infer to use META6.json
11:53 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/3f61e9db26
11:53 lizmat or it didn't register with me that that was the underlying reason
11:54 moritz (it's been a while, like, certainly last year)
11:56 RabidGravy Yeah Tinky gets in an awful state if there are more than a certain number of validators being awaited on
12:02 RabidGravy So am I going to finish the CouchDB thing this week?  "Only" authentication and attachments left to do
12:03 RabidGravy or am I going to get distracted and right something else off the TODO list
12:05 dalek rakudo/nom: 1654832 | lizmat++ | src/core/DateTime.pm:
12:05 dalek rakudo/nom: Make DateTime fully subclassable
12:05 dalek rakudo/nom:
12:05 dalek rakudo/nom: For additional public attributes, settable by name
12:05 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/16548323d0
12:11 Skarsnik good luck RabidGravy
12:13 RabidGravy lizmat++ # I've actually got a cheeky "augment class DateTime { }" in Chronic :-\
12:14 lizmat yeah, I figured Date / DateTime would be common targets for subclassing
12:15 bowtie_ joined #perl6
12:19 Skarsnik what was blocking to subclass Date? private new?
12:23 lizmat yup
12:24 leont joined #perl6
12:36 rurban joined #perl6
12:37 bowtie joined #perl6
12:46 bowtie_ joined #perl6
12:47 kid51 joined #perl6
12:48 Actualeyes joined #perl6
12:48 eyck joined #perl6
12:51 bowtie_ joined #perl6
12:55 iloveunix8955 joined #perl6
12:55 dalek rakudo/nom: 5648fea | lizmat++ | src/core/ (12 files):
12:55 dalek rakudo/nom: Change fake BUILD methods to SET-SELF
12:55 dalek rakudo/nom:
12:55 dalek rakudo/nom: If a method is called BUILD, it has a special meaning for the
12:55 dalek rakudo/nom: default way of building objects.  These methods only shared the
12:55 dalek rakudo/nom: name, but were never intended to be called by BUILDALL.
12:55 dalek rakudo/nom:
12:55 dalek rakudo/nom: Having a SET-SELF in a class, usually means the class is not
12:55 dalek rakudo/nom: subclassable as is.  By making the method private, it should
12:55 dalek rakudo/nom: hopefully optimize even better in the future
12:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5648fea880
12:59 iloveunix8955 joined #perl6
13:02 cosarara joined #perl6
13:04 _mg__ joined #perl6
13:06 iloveunix8955 joined #perl6
13:06 sufrostico joined #perl6
13:18 bowtie_ joined #perl6
13:22 lizmat http://hoelz.ro/blog/state-of-multi-line-input    # nice blog post, hoelzro++
13:23 bowtie joined #perl6
13:25 dalek rakudo/nom: cddf5da | lizmat++ | src/core/ (29 files):
13:25 dalek rakudo/nom: Mark all BUILD methods as returning nothing
13:25 dalek rakudo/nom:
13:25 dalek rakudo/nom: The remaining BUILD methods in core are intended to be called by
13:25 dalek rakudo/nom: the default building sequence, which does not expect a return value.
13:25 dalek rakudo/nom: Hopefully we'll see some benefit of this speed-wise now, or in the
13:25 dalek rakudo/nom: (near) future.
13:25 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cddf5da0cf
13:26 Skarsnik any feedback on https://gist.github.com/Skarsnik/c4bc15b75b883f69fde1 ?
13:27 lizmat Skarsnik: no anything sensible from me, I'm afraid
13:27 lizmat *not
13:28 Skarsnik hm, don't know why github put the output before x)
13:30 vendethiel joined #perl6
13:38 perlpilot Skarsnik: it orders the files alphabetically.
13:38 Skarsnik I don't remember doing this?
13:38 Skarsnik whatever I change the ouput name x)
13:39 perlpilot Skarsnik: I don't quite understand what ENV is for
13:39 perlpilot "will be used instead of the rest"  used for what exactly?
13:40 Skarsnik to determine the library path x)
13:40 Skarsnik look at the second command in the output
13:41 perlpilot So, PERL6_LIBGUMDO would be a full path to the .so ?  Or could it just be relative to LD_LIBRARY_PATH?   Both?  Something else?
13:41 perlpilot s/DO/BO/
13:42 perlpilot The example you mention doesn't have a version ... did it intuit the version number somehow?
13:42 Skarsnik both probably work x)
13:43 Skarsnik basicly the library-name is something given to dlopen
13:44 Skarsnik a full path or a partial path will work (if the file is in LD_LIBRARY_PATH
13:44 perlpilot Skarsnik: anyway ... my general reaction is +1  :)
13:47 bioexpress joined #perl6
13:47 hoelzro o/ #perl6
13:48 bioexpress Hi! To I have to give Travis authorization to access my accout to get Travis test results on modules.perl6.org?
13:49 hoelzro lizmat: thanks!
13:52 dalek ecosystem: 774150f | sylvarant++ | META.list:
13:52 dalek ecosystem: Switch Avro and Compress::Brotli to Json
13:52 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/774150f757
13:59 smls joined #perl6
14:03 M-eternaleye joined #perl6
14:04 lizmat afk for a few hours&
14:07 El_Che does panda have a magic incantation to reinstall a module (e.g. once installed by 'panda install .')
14:09 flussence --force?
14:12 M-matthew joined #perl6
14:12 M-Illandan joined #perl6
14:14 hoelzro did Panda change how modules are supposed to extend the build process? I'm getting this error when trying to build Linenoise now: Redeclaration of symbol Build
14:19 hoelzro stmuk: do I talk to you about getting my Perl 6 blog entries on pl6anet?
14:20 pyrimidine joined #perl6
14:20 vendethiel joined #perl6
14:23 donaldh joined #perl6
14:23 johan___ joined #perl6
14:23 ChoHag_ joined #perl6
14:24 ruoso_ joined #perl6
14:24 tharkun_ joined #perl6
14:25 RabidGravy joined #perl6
14:25 Actualeyes joined #perl6
14:27 sufrostico joined #perl6
14:32 apiw joined #perl6
14:34 yurivish joined #perl6
14:34 M-eternaleye joined #perl6
14:39 ka joined #perl6
14:43 M-matthew joined #perl6
14:43 M-Illandan joined #perl6
14:51 gregf_ joined #perl6
14:55 RabidGravy boom
15:10 frankjh left #perl6
15:10 skids joined #perl6
15:11 ugexe hoelzro: there were changes to `require` in the latest rakudo and how it handles importing stuff
15:11 ugexe that sounds like it might be consistent with that
15:13 ugexe zef appears to still handle the Build ok, but it spawns it in a new process whereas panda `require`s it into the main program
15:14 p6newbee joined #perl6
15:16 awwaiid Greetings. I made some larger button-looking links for downloading Rakudo Star from rakudo.org. The idea is to put this at the top of the main "How to get Rakudo Perl 6" page, but for review it is separate. Check it out, http://rakudo.org/how-to-get-rakudo/download/
15:17 timotimo ^- my name is timotimo and i approve this message
15:18 awwaiid hehe
15:19 awwaiid timotimo: anyone in particular we should get feedback from on that?
15:19 donaldh joined #perl6
15:19 leont joined #perl6
15:20 apiw joined #perl6
15:20 timotimo not sure
15:21 moritz +1 from me
15:22 jnthn +1
15:24 nchambers^ joined #perl6
15:29 hoelzro ah ha
15:37 Skarsnik awwaiid, this look good
15:40 perlpilot awwaiid: nice!
15:41 ugexe maybe the big download button could download helpful ask toolbar and we can put the rakudo link in small print under it
15:41 awwaiid good idea ugexe. gotta fix my affiliate link...
15:42 flussence while we're fixing rakudo.org, how about putting pl6anet in that “Other Sites” sidebar?
15:44 awwaiid crazy talk
15:45 flussence crazy talk would be asking to remove the links that haven't been active in 3 years :)
15:47 Skarsnik hm constant PIKO = somefunction is not evalued at runtime?
15:48 flussence m: constant foo = say 'bar'; compile-time-error
15:48 camelia rakudo-moar cddf5d: OUTPUT«bar␤5===SORRY!5=== Error while compiling /tmp/OZDuhilvtx␤Undeclared routine:␤    compile-time-error used at line 1␤␤»
15:48 moritz Skarsnik: RHS of a constant declarator is evaluated at compile time, yes
15:48 edehont joined #perl6
15:48 flussence m: INIT constant foo = say 'bar'; compile-time-error
15:48 camelia rakudo-moar cddf5d: OUTPUT«bar␤5===SORRY!5=== Error while compiling /tmp/w5FmK8QhFb␤Undeclared routine:␤    compile-time-error used at line 1␤␤»
15:49 Skarsnik damn that annoying
15:49 flussence m: my \foo = say 'bar'; compile-time-error
15:49 camelia rakudo-moar cddf5d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Cbajticz4j␤Undeclared routine:␤    compile-time-error used at line 1␤␤»
15:49 moritz if you want to avoid the error message:
15:49 iloveunix32 joined #perl6
15:50 moritz m: constant foo = say 'bar; BEGIN exit 0
15:50 camelia rakudo-moar cddf5d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XcGyu02jyW␤Unable to parse expression in single quotes; couldn't find final "'" ␤at /tmp/XcGyu02jyW:1␤------> 3constant foo = say 'bar; BEGIN exit 07⏏5<EOL>␤    expecting any of:␤        argumen…»
15:50 moritz m: constant foo = say 'bar'; BEGIN exit 0
15:50 camelia rakudo-moar cddf5d: OUTPUT«bar␤»
15:50 moritz m: my \foo = say 'bar'; BEGIN exit 0
15:50 camelia rakudo-moar cddf5d: ( no output )
15:50 apiw joined #perl6
15:50 Skarsnik I though it will delay the evuluation of the constant since the right part is not know
15:51 Skarsnik constant should be named compilevar x)
15:51 flussence m: my \foo := 'bar'; say foo; foo = 'baz' # runtime constant-ish var
15:51 camelia rakudo-moar cddf5d: OUTPUT«bar␤Cannot modify an immutable Str␤  in block <unit> at /tmp/j7WXJIVhkr line 1␤␤»
15:51 musiKk joined #perl6
15:52 Skarsnik Yes, but it's not the same meaning that the word constant for me x)
15:52 moritz it's very much inspired by perl 5's "use constant ...."
15:53 flussence we have to give the compiler *some* way to cheat, after all
15:53 Skarsnik It's really bad, for me it's confusing
15:54 Skarsnik just looking at the keyword
15:54 jnthn "I want constants...THAT MIGHT CHANGE!!!" :P
15:54 Skarsnik I want constant that are constant. not constant at compile time
15:55 jnthn If your data were actually constant, that distinction wouldn't matter one bit. :)
15:55 abraxxa Skarsnik: read-only variable?
15:57 p6newbee hi
15:57 perlpilot Skarsnik: maybe you want a once block?
15:57 Skarsnik I mean an use case for me will be: my constant stuff = $config<stuff-value>; or even my constant piko = %*ENV<somevenvalue>;
15:57 moritz just use my \stuff = ...'
15:57 moritz s/'/;/
15:57 Skarsnik I am not talking how achieving what I want. I just found that the constant keyword is not good
15:58 Skarsnik it's totatly not obvious it's a compile time value
15:59 Skarsnik it should be named compileconstant or something like that x)
15:59 jnthn *sigh*
15:59 jnthn It's not going to change. Stop moaning about it.
16:00 moritz Skarsnik: your complaint has been heard.
16:00 jnthn .oO( It's not going to change because...it's constant! :D )
16:01 Skarsnik I guess it's not going to change. It's just very confusing. and the sigilless notation look like a hack for me x)
16:02 b2gills 「use constant」 runs compile time in Perl 5 too, it's just that happens every time you run it.
16:02 geekosaur actually that's your warning that it's not a runtime thing
16:02 Skarsnik but with precomp is an issue inside lib if you use to store a ENV value
16:02 Skarsnik for example
16:02 timotimo i wonder if we should put a little blurb above the announcements on the "home" site of rakudo.org, too
16:03 Skarsnik Since script are not precompiled you are probably fine with constant piko = %*ENV<PIKO> but it will not work on a lib
16:03 awwaiid http://rakudo.org/how-to-get-rakudo/ now updated with download link-button-things
16:04 b2gills Don't use a compile time feature if you want it to run at runtime
16:04 perlpilot Skarsnik: You seem to be more concerned about when initialization happens than the "constantness".  Ergo, you should look at phasers or phaser-like things IMHO.
16:04 timotimo awwaiid: at the moment, clicking those links opens a new tab for a split-second, which immediately closes again; can we change the links so that it won't do that?
16:05 timotimo target=_blank may be the culprit?
16:05 Skarsnik I am just complaining that the keyword constant is confusing for something that happen at compile time
16:05 moritz yes, we heard that.
16:05 RabidGravy GAH! I've just realised why http useragent gets the "compiled in failure"
16:05 RabidGravy thanks Skarsnik!
16:05 timotimo because of "constant"?
16:06 awwaiid yes
16:06 RabidGravy yeah
16:06 RabidGravy "constant $HRC_DEBUG = %*ENV<HRC_DEBUG>.Bool;"
16:06 Skarsnik see. I am pretty sure it will be a weird issue. since in a script it 'work' but not for lib that are precompiled :)
16:06 timotimo ah
16:06 awwaiid timotimo: target _blank removed
16:07 timotimo m: $foo = %*ENV<lalala>:exists.Bool; say $foo.perl
16:07 camelia rakudo-moar cddf5d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9bNUzxhP1i␤Variable '$foo' is not declared␤at /tmp/9bNUzxhP1i:1␤------> 3<BOL>7⏏5$foo = %*ENV<lalala>:exists.Bool; say $f␤»
16:07 timotimo m: my $foo = %*ENV<lalala>:exists.Bool; say $foo.perl
16:07 camelia rakudo-moar cddf5d: OUTPUT«Bool::False␤»
16:07 timotimo m: my $foo = %*ENV<lalala>:exists:v.Bool; say $foo.perl
16:07 camelia rakudo-moar cddf5d: OUTPUT«Bool::False␤»
16:07 RabidGravy it doesn't want to be constant at all
16:07 timotimo oh
16:07 timotimo of course it doesn't :)
16:07 Skarsnik it should be called static x)
16:08 timotimo static means something completely muddy, though
16:08 timotimo static is more like state in perl6
16:08 perlpilot I'm sure he's joking  :)
16:08 RabidGravy well in that case it just wants to be a lexical variable
16:09 apiw joined #perl6
16:10 Skarsnik in my head static is associated with compile, I think it's because of the static keyword before function in C that force the sub to not be seen outside his file (comp/translation unit?)
16:11 timotimo we can hardly expect people think "static" for variables in p6 works like "static" for functions in C
16:11 timotimo when in C, static for variables means something very different
16:12 Skarsnik Yes, I know
16:12 Skarsnik that really weird
16:13 Skarsnik interesting BEGIN is run after the first compile time?
16:13 flussence constant result = $*IN.slurp; exit result; # look, an AOT compiler!
16:13 perlpilot "first compile time"?
16:14 flussence BEGIN is run during compile time...
16:14 flussence m: BEGIN say '0'; constant a = say '1'; BEGIN say '2';
16:14 camelia rakudo-moar cddf5d: OUTPUT«0␤1␤2␤»
16:15 virtualsue joined #perl6
16:15 flussence m: BEGIN say '0'; constant a = say '1'; say 'foo'; BEGIN say '2';
16:15 camelia rakudo-moar cddf5d: OUTPUT«0␤1␤2␤foo␤»
16:15 Skarsnik Ah it's run in order
16:16 Skarsnik root@testperl6:~/piko/cpp/gptrixie# perl6 -e 'constant FOO = %*ENV<FOO>; BEGIN { %*ENV<FOO> = "Hello"}; say FOO'
16:16 Skarsnik (Any)
16:16 Skarsnik root@testperl6:~/piko/cpp/gptrixie# perl6 -e 'BEGIN { %*ENV<FOO> = "Hello"}; constant FOO = %*ENV<FOO>; say FOO'
16:16 Skarsnik Hello
16:16 flussence m: BEGIN say '0'; constant a = say '1'; BEGIN BEGIN say '2'; # I hope this doesn't change it...
16:16 camelia rakudo-moar cddf5d: OUTPUT«0␤1␤2␤»
16:17 flussence m: BEGIN say '0'; constant a = say '1'; BEGIN INIT FIRST say '2'; # this might?
16:17 camelia rakudo-moar cddf5d: OUTPUT«0␤1␤»
16:17 flussence well that's weird.
16:18 perlpilot not really ... you don't have a loop
16:18 flussence oh, duh
16:18 flussence m: BEGIN say '0'; constant a = say '1'; BEGIN INIT say '2';
16:18 camelia rakudo-moar cddf5d: OUTPUT«0␤1␤2␤»
16:18 flussence and there's no other way to jump the queue like that, I guess
16:19 Skarsnik hm INIT is fist run time? Should it ouput 2 twice?
16:19 Skarsnik or it's a modifier on BEING?
16:19 timotimo the code after BEGIN gets run at compile time. the code inside that has a phaser that runs say '2' at the INIT time of that compile-time-run code
16:21 perlpilot Skarsnik: read S04:1369
16:22 timotimo damn it, i still haven't set up synopsebot >_>
16:26 ka joined #perl6
16:29 uruwi joined #perl6
16:30 khw joined #perl6
16:32 alpha123 joined #perl6
16:34 [Coke] S99:NELSON
16:34 Skarsnik how do I catch note in tests?
16:34 Skarsnik m: use Test; dies-ok { CONTROL { when CX::Warn { .die } }; note "hello"}, "Foo";
16:34 camelia rakudo-moar cddf5d: OUTPUT«hello␤not ok 1 - Foo␤␤# Failed test 'Foo'␤# at /tmp/5uPO5Pdmvx line 1␤»
16:35 geekosaur note doesn't die
16:35 geekosaur it's just a write to stderr with a newline
16:35 geekosaur or if you prefer, say to $*STDERR instead of $*STDOUT
16:36 Skarsnik hm, ok seem more difficult to test
16:37 alpha123 joined #perl6
16:37 Skarsnik or should I raise the note in NC that say 'NativeCall: Consider adding the api version of the library you want to use, sub foo is native(foo, v1)' to a warning? I wanted that just being in information than an 'error'
16:38 geekosaur I'd make it a warning (well, I'd make it an error actually >.> )
16:38 * geekosaur considers not specifying the ABI expected to be a bug waiting to happen
16:40 Skarsnik well some lib does not play the ABI version game
16:41 Skarsnik like mysqlclient, their versionning is just... versionning... like so.16 is the same abi than so.22
16:42 Skarsnik and I don't if I can raise this to a warn, since it was not in x-mas release x)
16:42 Skarsnik know
16:43 geekosaur that's another bug waiting to happen (although I suspect in their case it's actually political vs. technical; technical assumes if the client and server are not tightly version-tied, they should be completely separated)
16:57 rurban joined #perl6
16:58 amishGeek joined #perl6
17:02 abraxxa joined #perl6
17:03 rudi_s_ Hi. I'm looking for a perl5-like do in Perl6. I have a "config file" (which is actually a perl6 program) and I'd like to load it from the main program. How can I do this so I can access (specific) variables in the config file and provide functions to it.
17:04 espadrine joined #perl6
17:06 jnthn Well, EVALFILE gets you an EVAL of the code and it'll be evluated with the lexicals (e.g. subs) of the calling scope available. Getting access to things that it declares is trickier, though. You could instead my %vars = EVAL slurp('file') ~ '; MY::';
17:07 jnthn Which'll make the code evaluate to the Stash of lexical variables declared in the config file
17:08 ugexe you could probably also do something like `require "/home/perl6/my-project/bin/config-script";` if you set up your exports/imports
17:10 rudi_s_ jnthn: I don't need access to the stuff it declares, but access to functions and the values they use. Sample: my $x = 4; sub foo { $x = 10 }; EVAL_MAGIC_HERE('path/to/file');
17:10 rudi_s_ And $x is either 4 or 10 if EVAL_MAGIC_HERE called foo or not.
17:11 jnthn Oh, then a plain EVALFILE should do it
17:11 rudi_s_ And EVAL_MAGIC_HERE should be able to access e.g. $y (which is declared like $x) as well.
17:12 jnthn It's just like EVAL but takes a file name
17:12 rudi_s_ Where can I find documentation for that?
17:12 rudi_s_ doc.perl6.org doesn't find it.
17:14 jnthn Indeed it doesn't... :( But docs for http://doc.perl6.org/routine/EVAL apply except EVALFILE takes a filename.
17:14 jnthn And reads the code from that file.
17:16 apiw joined #perl6
17:17 hankache joined #perl6
17:18 nine rudi_s_: one of Perl 6' key features is its excellent parsing abilities. Considering we have those, why not use a more human friendly config format?
17:18 uruwi joined #perl6
17:20 rudi_s_ nine: Because I want a programming language to configure my system. It removes many unnecessary and complicate features like embedding a template engine for better configurability.
17:21 nine rudi_s_: are you the only user of this system?
17:23 rudi_s_ nine: No.
17:24 pmurias joined #perl6
17:25 nine rudi_s_: many programmers come to the same faulty conclusion that the flexibility offered by using a full programming language for configuration outweighs the downsides. Sysadmins tend to disagree. It's no fun having to figure out Erlang's syntax just to be able to set up an XMPP server.
17:26 mst executable configs are satan, especially for systems configuration
17:27 hankache hello *
17:27 nine rudi_s_: the fun really starts when tools try to automatically change the configuration of some service, for example for fully automated upgrades. The halting problem makes this theoretically impossible with touring complete configuration
17:27 rudi_s_ nine: True. But I'm a programmer and a sysadmin and I want a flexible system which is easy to read/write (which I think works with perl6) but still extensible (which is a given with Perl6).
17:28 rudi_s_ I know that it has some issues, but I think that's a fine trade-off.
17:28 rudi_s_ nine: Yeah. But that's not a use case in my case.
17:28 nine not now at least
17:28 SWAN joined #perl6
17:29 rudi_s_ True. But I think that's a good assumption in my setup.
17:29 pmurias aren't excutable config file roughly eqivalent to just exposing the program as a module?
17:29 rudi_s_ mst: "systems configuration?"?
17:30 rudi_s_ jnthn: Thank you! Works fine.
17:31 mst rudi_s_: anything that runs on a server and needs actual uptime.
17:31 mst ok, so, here's my suggestion: make really really sure that your config subsystem is pluggable
17:31 mst that way you can carry on down the route you're currently going, since it's clear that you're going to have to learn this one the hard way
17:32 mst and if you ever do find yourself suddenly missing both feet, you can replace the subsystem then :)
17:32 rudi_s_ mst: Ah.
17:32 rudi_s_ I think that's fine for me ;-)
17:37 stmuk hoelzro: yeah either submit a PR https://github.com/stmuk/pl6anet.org or just tell me the atom/rss link
17:38 * donaldh o O (Given perl 6's built-in grammars, I'd be writing a grammar for config)
17:38 mst rudi_s_: also, you can gradually evolve your programmable config to be steadily more DSL-like, because that'll make it nicer anyway
17:38 mst rudi_s_: at which point turning it into a grammar later should be relatively easy if you do decide to
17:38 apiw joined #perl6
17:38 mst donaldh: yeah, same. but if he wants to go down the rabbit hole, I can't stop him, so I'll settle for making sure he has a plan B
17:39 mst rudi_s_ said he was a sysadmin, and therefore I have faith that he'll actually care about having a plan B ;)
17:40 hoelzro stmuk: thanks, will do!
17:41 donaldh turing complete config files are a huge attack surface
17:41 pierrot joined #perl6
17:41 rudi_s_ mst: Yeah, the idea is to be as DSL-like as possible, but still be extensible when it's useful.
17:41 sortiz joined #perl6
17:41 rudi_s_ Not applicable in my case.
17:41 mst I'm not thinking about attack surface, only debugging surface
17:45 vendethiel joined #perl6
17:46 dalek nqp: 2a21a59 | (Pawel Murias)++ | src/vm/js/RegexCompiler.nqp:
17:46 dalek nqp: [js] Remove (broken) debugging leftover
17:46 dalek nqp: review: https://github.com/perl6/nqp/commit/2a21a59455
17:48 RabidGravy is it Radiator or some other evil RADIUS server that has all its configs in Perl?  That was the satan
17:48 hoelzro stmuk: here's the URL: http://hoelz.ro/perl6.rss
17:49 CIAvash joined #perl6
17:49 dalek rakudo/nom: b5c6a49 | lizmat++ | src/core/Failure.pm:
17:49 dalek rakudo/nom: Creating a Failure is now more efficient
17:49 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b5c6a49072
17:49 * RabidGravy gives up for the second time to debug Websocket
17:51 RabidGravy somehow the equivalent of
17:51 RabidGravy m: my $s = supply -> \s { }; say $s.Channel.receive
17:51 camelia rakudo-moar cddf5d: OUTPUT«Method 'phasers' not found for invocant of class 'Code'␤  in block <unit> at /tmp/rMPaX1EQyj line 1␤␤»
17:51 RabidGravy is happening
17:53 DrForr o/
17:55 stmuk hoelzro: done
17:56 DrForr Question about junctions - I understand they can't be introspected, but is there a way to get access to what is being matched against? I know it's only one term in this case, if it helps.
17:57 donaldh joined #perl6
17:59 iloveunix8955 joined #perl6
18:00 iloveunix32 joined #perl6
18:02 DrForr Aha, just worked around it.
18:03 hoelzro stmuk: thanks!
18:05 apiw joined #perl6
18:06 sufrostico joined #perl6
18:06 musiKk joined #perl6
18:09 dalek rakudo/nom: 659f2e9 | lizmat++ | src/core/Distribution.pm:
18:09 dalek rakudo/nom: Prevent double lookup of RAKUDO_PRECOMP_DIST
18:09 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/659f2e956a
18:17 mohae joined #perl6
18:20 adu joined #perl6
18:23 Skarsnik RabidGravy, the websocket client or server.
18:24 RabidGravy server
18:24 Skarsnik damn
18:24 Skarsnik still nobody to write a websocket client async module? x)
18:26 apiw joined #perl6
18:26 ka joined #perl6
18:26 TEttinger joined #perl6
18:30 iloveunix32 joined #perl6
18:33 vendethiel joined #perl6
18:33 FROGGS joined #perl6
18:35 FROGGS o/
18:36 lizmat FROGGS o/
18:36 FROGGS :o)
18:36 hoelzro o/ FROGGS
18:37 vendethiel \o
18:37 rurban joined #perl6
18:37 hankache o
18:39 sortiz \o #perl6
18:39 dalek rakudo/nom: 90b31ae | lizmat++ | src/core/Str.pm:
18:39 dalek rakudo/nom: Mark some more methods as not returning anything
18:39 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/90b31aea5d
18:43 Laurent_R joined #perl6
18:44 FROGGS huh, a 'use Foo;' in Foo.pm makes it infiniloop >.<
18:48 dalek rakudo/nom: 3c6e44e | lizmat++ | src/core/Str.pm:
18:48 dalek rakudo/nom: Remove superflous call
18:48 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3c6e44eb41
18:48 brrt joined #perl6
18:49 stmuk "How to be a 10x engineer: help ten other engineers be twice as good."
18:49 hankache heh
18:52 RabidGravy WAHAY!
18:52 RabidGravy fix0rificated the Websocket!!
18:53 hankache is there another way to write multiline comments other than =begin comment ............. =end comment?
18:53 hankache something a la /** ..............  **/
18:54 DrForr #`( .. )
18:54 DrForr (shades of Lisp)
18:55 geekosaur or with [] or {} or other matching brackets
18:55 hankache thanks
18:57 Skarsnik =begin and =end ?
18:58 timotimo that also works, but it'll end up in the $= variables, which you may or may not want
19:00 dalek rakudo/nom: 3f469f1 | lizmat++ | src/core/Str.pm:
19:00 dalek rakudo/nom: Make triage_substitution a private method
19:00 dalek rakudo/nom:
19:00 dalek rakudo/nom: Instead of a multi with a where clause: should make substitution
19:00 dalek rakudo/nom: a bit faster, especially when doing many of them
19:00 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3f469f1df1
19:00 firstdayonthejob joined #perl6
19:01 iloveunix32 joined #perl6
19:14 uruwi joined #perl6
19:14 RabidGravy what larks
19:14 lizmat spring surprise
19:24 dalek rakudo/nom: b28da05 | lizmat++ | src/core/Str.pm:
19:24 dalek rakudo/nom: Make increment_index a private method
19:24 dalek rakudo/nom:
19:24 dalek rakudo/nom: Instead of a multi + some more micro-opts
19:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b28da052f1
19:24 RabidGravy micro-opts++
19:26 Jaglor joined #perl6
19:32 dalek doc: 8ab319f | jnthn++ | doc/Type/Cool.pod:
19:32 dalek doc: Extend coverage of EVAL.
19:32 dalek doc: review: https://github.com/perl6/doc/commit/8ab319f513
19:32 dalek doc: 24cb91d | jnthn++ | doc/Type/Cool.pod:
19:32 dalek doc: Document EVALFILE.
19:32 dalek doc: review: https://github.com/perl6/doc/commit/24cb91d6dd
19:34 sufrostico joined #perl6
19:34 sufrosti1o joined #perl6
19:35 apiw joined #perl6
19:36 nine Note to self: always write the user of an API first. Keeps you from pushing embarassing API mistakes...
19:37 FROGGS yeah
19:37 lizmat nine: personally, I prefer a bit of a whirlpool approach, but your note is well taken
19:37 nine Why the hell did I think an API for finding an installed module would be a good match for finding out if a dist is already installed? Why not provide a method that actually looks for a dist?
19:38 lizmat nine: wasn't that what .candidates was ?
19:38 nine lizmat: yes, .candidates let you look for a module same as .resolve now does. But a tool like panda is actually more interested in dists, not modules.
19:39 lizmat nine: ah, good point  :-)
19:39 dalek rakudo/nom: e588d93 | lizmat++ | src/core/Str.pm:
19:39 dalek rakudo/nom: Remove superfluous return
19:39 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e588d93998
19:41 Skarsnik Ok, my last iteration before doing a PR https://gist.github.com/Skarsnik/c4bc15b75b883f69fde1
19:44 ka joined #perl6
19:49 shicheng joined #perl6
19:51 Skarsnik gah of course that does not work since the GUMBO_LIB has no type now that is executed at runtime ><
19:51 Skarsnik it should work like auto in c++ xD
19:52 dalek rakudo/nom: 4cd2875 | lizmat++ | src/core/Str.pm:
19:52 dalek rakudo/nom: Change curly into postfix if
19:52 dalek rakudo/nom:
19:52 dalek rakudo/nom: And reorder conditional because this seems to only be applicable
19:52 dalek rakudo/nom: when squashing, so check that first!
19:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4cd2875d94
19:54 jameslenz joined #perl6
19:54 SCHAAP137 joined #perl6
19:59 lizmat afk for some deadpool, then work on P6W &
20:03 apiw joined #perl6
20:05 orbus apparently 2016.01 came out and I totally missed it
20:06 * orbus compiles
20:08 ka joined #perl6
20:10 Skarsnik hm, I am confused. I don't get this error https://gist.github.com/Skarsnik/28555eade4bd5a40d036
20:17 llfourn joined #perl6
20:23 geekosaur suggest you check with "dd GUMBO_LIB" to make sure it's what you think it is
20:23 musiKk joined #perl6
20:24 Skarsnik dd will be executed at runtime, trait are compile time x)
20:24 geekosaur so comment out the third one
20:24 Skarsnik but it should fallback on the non typed version of the trait?
20:24 tharkun_ joined #perl6
20:26 Skarsnik I mean, it's etheir it don't find a specialised candidate and use the generic version or use the right one. but why it complain it find nothing?
20:29 Skarsnik commenting the 3 trait still does not work. hum
20:31 Skarsnik oh it's the \GUMBO_LIB that confuse it. using $GUMBO_LIB instead work
20:32 Skarsnik well I get Any as type. damn
20:33 perlpilot yep, because your initilization happens at runtime while your traits are compile time.
20:33 Skarsnik m: use NativeCall; my \foo = "Hello"; sub piko is native(foo) { * };
20:33 camelia rakudo-moar 4cd287: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QtJ3n1Lowq␤Can't use unknown trait 'is native' in a sub declaration.␤at /tmp/QtJ3n1Lowq:1␤    expecting any of:␤        rw raw hidden-from-backtrace hidden-from-USAGE␤        pure default DEPRECATED i…»
20:34 Skarsnik Look like a parse bug?
20:35 Skarsnik probably fail with every trait
20:35 cognominal joined #perl6
20:35 jnthn No, \foo isn't bound until runtime
20:35 jnthn But traits are applied at compile time
20:35 jnthn So it's trying to apply the trait with Mu
20:36 * perlpilot taps the mic
20:36 perlpilot *tap* *tap* *tap*  Is this thing on?
20:36 Skarsnik perlpilot, it's a bit a annoying that it does not guess the type from the sub at the right signature (it expliclty return a type)
20:37 jnthn perlpilot: heh, was distracted by valgrind output :)
20:37 perlpilot Skarsnik: type-inference isn't a thing (yet)
20:37 Skarsnik jnthn, hm so Mu can't be a value for the trait argument?
20:38 jnthn Skarsnik: Well it *can* but only if a trait declare it accepts that.
20:38 jnthn And I don't see why `is native` would
20:40 Skarsnik well nc declaration is just the 'generic' one.
20:40 jnthn I've said more than once before now that the right way to provide a richer interface to native resolution would be to pass a type there that implement some interface, perhaps formalized by a role.
20:40 adu joined #perl6
20:40 Skarsnik That why I did jnthn
20:40 jnthn OK, good.
20:40 Skarsnik but I wanted to hide the type from the user so he does not have to type the value
20:41 jnthn Why?
20:41 perlpilot Skarsnik: have you heard about waterbeds and language complexity?  :)
20:42 Skarsnik Well it will be: my NC-Library-Handle $LIB = register-native-lib(....);
20:42 sortiz Anyone need to create an empty (zeroed) Buf of a given size? See https://github.com/rakudo/rakudo/pull/712 and comment
20:42 Skarsnik annoying we have to put the sigil x)
20:43 Skarsnik sortiz, could be useful with NC probably
20:43 sortiz Skarsnik, yes, that's the idea.
20:43 jnthn Skarsnik: But...you're passing it off to a trait, so it should be declared at compile time, not runtime
20:44 jnthn "my" is too late
20:44 Skarsnik but compile time sucks with precompile
20:44 jnthn No, you suck at designing things to work WITH Perl 6 rather than against it.
20:44 Skarsnik in this case
20:45 jnthn class MyLibrary { method resolve() { ...called on first invocation of trait... } }; sub foo() is native(MyLibrary) { * }
20:45 ugexe m: say Buf.new( 0 xx 5 )
20:45 camelia rakudo-moar 4cd287: OUTPUT«Buf:0x<00 00 00 00 00>␤»
20:45 Skarsnik NC solve the libname the first time a sub is called
20:46 jnthn Skarsnik: Right, which is at runtime.
20:46 sortiz Skarsnik, 'is native' accepts a Callable, that way you can move the evaluation till runtime.
20:46 Skarsnik the Callable solution is aweful for me
20:46 jnthn Why?
20:46 * perlpilot is totally confused.
20:47 donaldh joined #perl6
20:47 perlpilot Skarsnik: I have no understanding of your motivations here.  It seems your constructing a situation such that any solution is deliberately wrong or broken in some way.
20:47 perlpilot s/your/you're/
20:48 perlpilot oops,  s:2nd/your/you're/ actually
20:48 _dolmen_ joined #perl6
20:48 TeamBlast joined #perl6
20:51 Skarsnik I base this on a 1-2 common usage: Knowning the lib throug some base info the developper know (basename and the version), allowing the user to use a ENV variable to locate the lib. Or find the lib at runtime like with pkg-config
20:52 edehont joined #perl6
20:53 jnthn sortiz: I left a comment on the PR
20:53 Skarsnik actually if I want to do that I need to give a Callable to NC. It's not really friendly (and I need to use NC interntal to not rewrite the guess_lib_name). Here I want just to build a 'blackbox' type
20:55 Skarsnik And the issue with the Callable solution, you don't really control when it will be called
20:56 edehont_ joined #perl6
20:56 jnthn Why do you want to control when it will be called?
20:57 edehont joined #perl6
20:58 Skarsnik well using the %*ENV example, maybe the env will be changed before your C lib call, like if you work with multiple lib
20:58 jnthn So, solve that inside the sub with INIT?
20:59 jnthn sub resolver() { INIT my $foo = %*ENV<blah>; ... }
20:59 jnthn That'll capture what it was at startup (yes, even if pre-comp'd)
21:01 perlpilot Would using an "our" var do the same?  (If he wanted to continue with the same general approach)
21:01 perlpilot Aren't our vars initialized at INIT time?
21:01 revhippie joined #perl6
21:02 jnthn perlpilot: Yeah, though have the side-effect of being our-scoped :)
21:02 Skarsnik Oh I need to patch DBIish :(
21:02 Skarsnik It use a constant MYSQ_LIB = %ENV<mysql> || (regular stuff);
21:03 Skarsnik and well, that does not really work
21:03 Skarsnik worked before precomp x)
21:06 geraud joined #perl6
21:18 yqt joined #perl6
21:19 sortiz jnthn, The use case of :elems is only for pre-allocate some slots, not for fix its size. Right now Blob size if fixed and Buf can grow, but in both cases, if I need some initial size, the alternatives are expensive.
21:19 sortiz s/if fixed/is fixed/
21:20 jnthn sortiz: OK, then I think it needs to be more like initial-elems or so
21:20 nowan_ joined #perl6
21:20 jnthn TimToady may also have some views, given it's a naming question :)
21:20 perlpilot it would be nice if you could do something like  :init(5)  too  :)
21:21 perlpilot (to initialize the elements to the number 5)
21:24 TreyHarris joined #perl6
21:24 sortiz jnthn, Yes. Thank you. I'll wait for a decision.
21:25 nowan joined #perl6
21:26 sortiz perlpilot, For that case I prefer something like Blob.fill(...)
21:30 TreyHarris On Rakudo 2016.01.1 built on MoarVM version 2016.01, running on darwin 15.2 (El Capitan), the following one-liner causes the moar process to runaway, quickly using up all available CPU:
21:30 TreyHarris perl6 -e 'say so "foo" ~~ /<.ws>+/;'
21:30 TreyHarris Should I report this as a bug?
21:31 Skarsnik m: say so "foo" ~~ /<.ws>+/;
21:32 camelia rakudo-moar 4cd287: OUTPUT«(timeout)»
21:33 Skarsnik I am not sure how so work, but it look like a bug x)
21:33 TreyHarris m: say so "foo" ~~ /<.ws/;
21:33 camelia rakudo-moar 4cd287: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FUWthKeDjt␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at /tmp/FUWthKeDjt:1␤------> 3say so "foo" ~~ /<.ws7⏏5/;␤    expecting any of:␤        term␤»
21:33 TreyHarris oops
21:33 TreyHarris m: say so "foo" ~~ /<.ws>/;
21:33 camelia rakudo-moar 4cd287: OUTPUT«True␤»
21:33 TreyHarris the plus makes it go runaway
21:34 TreyHarris Skarsnik: it's not the so.
21:34 TreyHarris m: say "foo" ~~ /<.ws>+/;
21:34 jnthn TreyHarris: <.ws> can match nothing
21:34 jnthn TreyHarris: And can match nothing infinitely
21:34 camelia rakudo-moar 4cd287: OUTPUT«(timeout)»
21:34 jnthn You don't need to (and shouldn't) quantify <.ws>
21:34 Skarsnik ws is whitespace?
21:35 jnthn Yes, but with the !ww behavior (unless you override it)
21:35 Skarsnik maybe it should warn?
21:35 TreyHarris jnthn: in Perl 5 you can't cause an infinite loop that way, so I didn't know if it was a bug or not. That's why I'm asking.
21:36 Skarsnik I added a compile time solution https://gist.github.com/Skarsnik/c4bc15b75b883f69fde1
21:37 skids RT#75586 probably covers it
21:37 jnthn TreyHarris: There's at lesat one RT ticket tracking the issue of whether quantifying empty things should do that or not.
21:37 skids https://rt.perl.org/Public/Bug/Display.html?id=75586 # alas poor synopsbot, I knew ye well
21:37 TreyHarris jnthn: ah, my search-fu wasn't good enough to find it. That's why I asked here :)
21:38 jnthn We're aware of it, just undecided on how to fix it (or whether to, though I think we generally consider it desirable to if possible)
21:38 * jnthn thought "oh, that's easy" at least once, then it wasn't :)
21:38 jnthn Forget exactly why
21:41 Skarsnik just warning about it it's not easy thou?
21:42 ely-se joined #perl6
21:42 jnthn I think if we can detect it well enough not to build up an infinite number of backtrack points, we could not do that rather than do the warning :)
21:50 sno joined #perl6
21:53 dbrunton joined #perl6
21:54 mst that looks like at least the reasonably normally runnable into cases could be made to throw an exception telling you what to do instead
21:54 M-eternaleye joined #perl6
21:54 flussence maybe we need a trait_mod on regex-y things that turns quantifying them into a compile-time error
21:55 zacts joined #perl6
21:57 shicheng joined #perl6
21:58 MadcapJake is there a concise way to test if some code causes a certain exception to throw? «dies-ok» doesn't let you specify the error type.
21:58 flussence .oO(or a Sufficiently Smart Compiler that can detect when you try to quantify a declarative regex that can match 0..*)
21:59 flussence m: use Test; say &throws-like
21:59 camelia rakudo-moar 4cd287: OUTPUT«sub throws-like ($code, $ex_type, $reason?, *%matcher) { #`(Sub|95507800) ... }␤»
22:00 MadcapJake oh! thanks flussence! don't know how i missed that
22:01 jnthn throws-like is nice :)
22:01 flussence does that work for CX::Warn too?
22:02 jnthn Not sure
22:02 flussence that's a CONTROL-ish, not a CATCH-ish, so I'd guess not
22:02 jnthn Right
22:02 jnthn It'd have to explicitly do so
22:02 jnthn m: use Test; throws-like { warn 'foo' }, CX::Warn;
22:02 camelia rakudo-moar 4cd287: OUTPUT«    1..2␤foo  in block  at /tmp/H1RvP4jmhb line 1␤    not ok 1 - code dies␤    ␤# Failed test 'code dies'␤# at /tmp/H1RvP4jmhb line 1␤    ok 2 - # SKIP Code did not die, can not check exception␤    # Looks like you failed 1 test of 2␤not ok…»
22:02 MadcapJake i've written a whole bunch of try/catch blocks with a series of pass/flunk style tests :S so I'm really glad to cut a lot of that out
22:05 dbrunton I have a few questions about doc/Supply.pod, and I'm not completely certain where to raise them.
22:06 dbrunton Anyone here interested and/or have a few minutes to talk it through?
22:08 jnthn dbrunton: Have a few minutes...hopefully have the brane for it too :)
22:11 dbrunton hee hee, okay :)
22:11 dbrunton Starting with the Promise method-
22:11 dbrunton The doc has a couple places where it doesn't match the implementation and tests, specifically-
22:12 dbrunton Supply.new - could be Supplier.new.Supply, but
22:12 dbrunton later, the Supply $s has emit called on it, which is also not a method on a Supply, but on a Supplier, so maybe it needs to have a Supplier around.
22:13 dbrunton So, something like this works: my $r = Supplier.new; my $s = $r.Supply;
22:13 raiph joined #perl6
22:13 dbrunton Then the emit down below can be changed to $r.emit.
22:14 colomon joined #perl6
22:14 dbrunton But this is where it starts to get a little tangled, because the promise acts a little different as well.
22:15 dbrunton Specifically, $p.then doesn't call its method until $r.done, which is, again, not exactly what's documented.
22:15 jnthn Yeah, there were a number of changes, and it seems the docs weren't updated to match :)
22:16 dbrunton Yeah, that part's fine, I'm just not certain which behavior is correct- should I just make it so the documentation reflects the current rakudo behavior?
22:16 dbrunton I think it's possible there is a bug or two in there (specifically, I'm not certain the $p.then behavior in rakudo is correct, and by not certain, I just mean not certain :))
22:17 dbrunton I feel competent to get rid of all the Supply.new calls and replace them with Supplier.new.Supply or something equivalent :)
22:17 dbrunton I could also happily muddle through this and send it along as a pull request for discussion if that's more sensible, I just wouldn't want it to get merged without some pretty thorough review :)
22:19 gcole joined #perl6
22:21 dalek doc: 6ddeaa2 | jnthn++ | doc/Type/Supply.pod:
22:21 dalek doc: Fix Supply.Promise docs; dbrunton++.
22:21 dalek doc: review: https://github.com/perl6/doc/commit/6ddeaa2a37
22:22 jnthn Yeah, if there's more places that need a similar tweak, a PR would be good.
22:22 jnthn The docs were certainly in the wrong for the case of .Promise
22:23 jnthn They were right at some point in history :)
22:23 dbrunton For sure :)
22:23 jnthn We had various cleanups related to Supply not so long before the Christmas release.
22:23 dbrunton Thanks for taking a look, I'll take another pass through. The test coverage is pretty good, I presume I can treat that as gospel truth?
22:24 shicheng joined #perl6
22:24 sufrostico joined #perl6
22:25 dalek doc: 614044b | jnthn++ | doc/Type/Supply.pod:
22:25 dalek doc: There is no Supply.close method any more.
22:25 dalek doc:
22:25 dalek doc: You .close individual taps.
22:25 dalek doc: review: https://github.com/perl6/doc/commit/614044b108
22:25 jnthn dbrunton: Yeah, so long as they're not fudged (marked with something like `#?rakudo skip ...` or so)
22:26 jnthn dbrunton: But we consider the test suite is the language specification, so it's a good place to look for what is intended behavior.
22:28 dbrunton jnthn: perfect, thanks for taking a pass through it. I have to go feed the kids dinner, but I sent a small pull request and will happily muddle through Supply.wait (the other one that was a bit wonky).
22:28 dbrunton I really appreciate your all's work on this, it's been quite fun to work with.
22:30 mohae joined #perl6
22:30 dalek doc: 7e56f2e | (David Brunton)++ | doc/Type/Supply.pod:
22:30 dalek doc: live method
22:30 dalek doc:
22:30 dalek doc: Supplier creates a Supply.
22:30 dalek doc: review: https://github.com/perl6/doc/commit/7e56f2e172
22:30 dalek doc: 13d61d7 | RabidGravy++ | doc/Type/Supply.pod:
22:30 dalek doc: Merge pull request #396 from dbrunton/patch-9
22:30 dalek doc:
22:30 dalek doc: live method
22:30 dalek doc: review: https://github.com/perl6/doc/commit/13d61d7b1e
22:30 jnthn Oops, that PR adds back the doc for the close method that I removed...
22:30 dbrunton Shoot, I'm sorry jnthn.
22:31 jnthn np :)
22:31 RabidGravy oh sorry I should have noticed
22:31 dbrunton I need to take a break anyhow, so no collisions from me for a while.
22:31 dbrunton :)
22:31 dbrunton Again, thank you all. You're the best!
22:32 dalek doc: 332c51d | jnthn++ | doc/Type/Supply.pod:
22:32 dalek doc: Remove Supply.close docs, again. :-)
22:32 dalek doc: review: https://github.com/perl6/doc/commit/332c51db68
22:32 jnthn dbrunton: Thanks for the PR. Happy feeding. :-)
22:33 xinming joined #perl6
22:33 khw joined #perl6
22:41 flaviusb joined #perl6
22:42 avenj joined #perl6
22:42 avenj joined #perl6
22:46 sortiz m: use NativeCall; class MV is repr('CStruct') { has uint64 $.start; method s { if $!start {} } }
22:46 camelia rakudo-moar 4cd287: OUTPUT«===SORRY!===␤Cannot unbox a type object␤»
22:46 * lizmat returned from Deadpool and starts working on the P6W
22:47 sortiz m: use NativeCall; class MV is repr('CStruct') { has uint64 $.start; method s { if +$!start {} } }  # This works :/
22:47 camelia rakudo-moar 4cd287: ( no output )
22:48 sortiz And the error message is totally uninformative!
22:51 Skarsnik duh
22:51 Skarsnik I don't even get why it does not work x)
22:55 sortiz Toke me hours to find the point of the error!
22:55 jnthn Odd, that's a compile-time failure even
22:55 raiph http://doc.perl6.org/language/control#if says "The block attached to the condition will only be evaluated if the condition means True when coerced to Bool."
22:56 jnthn sortiz: Yeah, it's a crash during code-gen, bizzarely
22:56 jnthn sortiz: Please RT it, if you didn't already. --ll-exception gives some clues as to where it's going wrong.
22:57 sortiz I'll RT it.
22:58 jnthn Thanks
22:58 * jnthn too tired for more patching today
23:09 sortiz jnthn, Do you distract with a mad experiment? See https://gist.github.com/salortiz/64e34f05273e34b04310
23:16 colomon joined #perl6
23:18 adu joined #perl6
23:19 skids joined #perl6
23:19 orbus my $c=Channel.new; my $s1=$c.Supply; my $s2=$c.Supply; $s1.tap(-> $x {say "1:$x"}); $s2.tap(-> $y {say "2:$y"}); for ^10 {$c.send($_)}; $c.close; await $c.closed
23:19 orbus m: my $c=Channel.new; my $s1=$c.Supply; my $s2=$c.Supply; $s1.tap(-> $x {say "1:$x"}); $s2.tap(-> $y {say "2:$y"}); for ^10 {$c.send($_)}; $c.close; await $c.closed
23:19 camelia rakudo-moar 4cd287: OUTPUT«Could not spawn thread: errorcode -111:0␤␤»
23:19 orbus d'oh
23:21 jnthn I think the camelia is limited (by memory?) in how many threads can be started.
23:21 jnthn And the scheduler isn't smart enough to not make so many
23:21 ryan_ joined #perl6
23:22 orbus yeah
23:22 orbus well
23:22 orbus was just trying to figure out if the results of that are expected behavior
23:22 orbus the values from the channel only get emitted on one supply or the other
23:22 orbus I was going to document Channel.Supply better
23:22 jnthn Yeah, they compete
23:22 orbus okay, cool
23:23 orbus I'll write something up and submit a pr
23:23 orbus thanks
23:23 jnthn Channels are largely for that kind of use case
23:23 orbus sure
23:23 jnthn Means you can spin up a bunch of workers that react { whenever $channel { ...  } }
23:24 jnthn And they'll compete over the incoming work
23:24 orbus I was just thinking it might also be nice to have a way for a single channel to send to multiple endpoints
23:24 Ben_Goldberg joined #perl6
23:24 orbus there might already be one
23:24 jnthn my $s = $channel.Supply.share;
23:24 orbus ah
23:26 orbus okay, cool
23:26 orbus haven't had much time to mess with perl6 stuff lately
23:26 orbus life tends to get in the way
23:30 * jnthn decides to let sleep get in the way :)
23:30 jnthn 'night o/
23:31 lizmat good night, jnthn!
23:31 orbus later
23:35 skids m: Failure.new(Exception) # This is a less awesome error than it was prior to today's optimization.  Though, even then it was only awesome by accident.
23:35 camelia rakudo-moar 4cd287: OUTPUT«Use of uninitialized value of type Exception in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/wr4MBQeDE_ line 1␤␤␤Actually thrown at:␤  in block <unit> at /tmp/wr4MBQeDE_ l…»
23:35 skids (used to be "Invocant requires an instance...")
23:37 orbus pr sent
23:37 * orbus goes to find food
23:49 shicheng joined #perl6
23:54 lizmat and another Perl 6 Weekly hits the net: https://p6weekly.wordpress.com/2016/02/15/2016-7-more-versioning/
23:56 lizmat and on that note: good night, #perl6!
23:57 sortiz 'night lizmat

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

Perl 6 | Reference Documentation | Rakudo