Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-03-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:00 labster joined #perl6
00:05 pdcawley_ joined #perl6
00:08 woodruffw joined #perl6
00:09 woodruffw joined #perl6
00:09 tmch joined #perl6
00:15 dalek rakudo/nom: b243a96 | timotimo++ | src/Perl6/Metamodel/ (2 files):
00:15 dalek rakudo/nom: "setdebugtypename" lives in metamodel Naming now instead of ClassHOW
00:15 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b243a96632
00:27 BenGoldberg joined #perl6
00:30 rudi_s sortiz: Sorry for the late reply. Awesome, thank you. our works just fine.
00:30 rudi_s Btw. is there a way to ignore the "is export" from a module. Like perl5's use Foo::Bar (); ?
00:34 pdcawley joined #perl6
00:35 sortiz rudi_s, That is the difference between 'use' and 'need': 'use' imply 'need' *and* 'import'
00:36 rudi_s sortiz: Just to be sure. need Foo::Bar in perl6 works like use Foo::Bar () in perl5?
00:37 sortiz rudi_s, Exactly.
00:39 rudi_s sortiz: Perfect, thank you. - I didn't realize this when reading the docs and was confused that such an important could be missing, but now it's pretty clear (and I've no idea how I could miss that).
00:39 sortiz rudi_s, yw
00:45 cbk joined #perl6
00:45 ggoebel16 joined #perl6
00:53 skids joined #perl6
00:59 dfcarpenterak joined #perl6
01:06 yeahnoob joined #perl6
01:09 labster joined #perl6
01:18 timotimo i think it'd probably be easier to write the "dump all QAST nodes to json" as a single method on QAST::Node that knows all about the individual nodes we have and such
01:18 timotimo rather than splitting it out into multiple methods like the rest of the code already does, with its "dump extra info" and such
01:18 timotimo individual nodes, but especially individual roles
01:18 timotimo which is, i assume, where the majority of the complexity comes from
01:31 yeahnoob joined #perl6
01:31 ZhangGong|2 joined #perl6
01:42 justine joined #perl6
01:53 Actualeyes joined #perl6
01:59 snarkyboojum joined #perl6
02:07 kalkin-_ joined #perl6
02:24 vendethiel joined #perl6
02:32 arc__ joined #perl6
02:33 zostay m: my $c = -1; (4 * [+] (1, 3 ... *)[0 .. 100_000].map({ ($c = -$c) / $_ })).say; # happy approximately pi day
02:33 camelia rakudo-moar b243a9: OUTPUT«3.14160265348972␤»
02:33 arcetera joined #perl6
02:35 arc__ joined #perl6
02:35 arcetera joined #perl6
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:47 MadcapJake` how can I do the FILE C type in nativecall?
02:52 BenGoldberg class FILE is repr('CPointer') { };
02:53 TimToady joined #perl6
02:54 BenGoldberg Note that in C, FILE is a struct, and you'd be using pointer-to-FILE all over the place, whereas 'class FILE ...' creates a class which behaves like a pointer... it's more like a c-level pointer-to-FILE.
03:03 toddr joined #perl6
03:04 toddr Hi, so perl6 doesn't have . in INC right?
03:09 skids not by default
03:09 Juerd I keep wishing that . or ./lib was in there
03:09 Juerd Or at least ~/.lib
03:09 Juerd (Or something like it)
03:11 skids Better than having things hijacked because you didn't notice a .pm file in ./ IMO.
03:14 toddr joined #perl6
03:15 Juerd I guess
03:15 Juerd But what would be the reason not to have any homedir based thing in there by default?
03:16 toddr I missed the answer when my IRC client crashed didn't I?
03:16 Juerd Yes. The answer was yes.
03:16 Juerd Or, actually: <skids> not by default
03:17 Juerd There's PERL6LIB=. or perl6 -I. or use lib '.';
03:17 toddr So I'm putting a presentation together. I'm wondering if there's any documentation on why this decision was made
03:17 Juerd <skids> Better than having things hijacked because you didn't notice a .pm file in ./ IMO.
03:17 MadcapJake` is that how it works in Perl 5?
03:17 toddr don't get me wrong. I applaud it.
03:18 skids I could see a subdir of homedir.  Probably just NYI given the state of package installers, different systems have different conventions e.g. ~/.local
03:18 geekosaur yes, perl5 doesn't include . in @INC
03:18 toddr ?
03:18 geekosaur or ~ or any subdir thereof, by default
03:18 toddr no . is at the end of @INC in perl5
03:18 Juerd MadcapJake`: No, . is in @INC in Perl 5.
03:19 * geekosaur sighs, too tired...
03:19 skids It is on my system.
03:20 Juerd MadcapJake`: And https://metacpan.org/pod/local::lib is sort-of popular. I wish something somewhere in ~ was in Perl6's include paths by default
03:20 Juerd Speaking of this. What is that array called in Perl 6?
03:21 MadcapJake` I'm guessing it has to do with CUR
03:21 MadcapJake` $*REPO?
03:23 skids hrm.  So that's why I couldn't find the precomps in ~/.local where I thought I put them with --prefix.  Hardcoded to ~/.perl6 apparently or something.
03:23 MadcapJake` Seeing as technically modules are located in a separate precomped/mangled directory, it's more about maintaining true cross-platform unicode support
03:24 MadcapJake` yeah precomps does not follow a make --prefix flag
03:24 skids is there a corresponding flag?
03:25 MadcapJake` skids, https://github.com/rakudo/rakudo/blob/nom/​docs/running.pod#affecting-precompilation
03:29 skids huh.  But my hacked-up rakudobrew should be setting NQPs --prefix as well.
03:30 MadcapJake` --prefix wasn't properly passing to nqp until recently, i believe
03:31 skids nqp --show-config | grep prefix shows moar::prefix=/home/me/.local, but my precomps are still in ~/.perl6.
03:34 MadcapJake` prefix only handles installs, precomp doesn't honor it
03:35 MadcapJake` nqp dir only deals with prefix inside Configure.pl (iiuc)
03:36 MadcapJake` I think the only way you can adjust precomp location is with RAKUDO_PREFIX
03:37 skids Then I don't get https://github.com/rakudo/rakudo/blob/nom/s​rc/core/CompUnit/RepositoryRegistry.pm#L69
03:37 geekosaur joined #perl6
03:38 noganex_ joined #perl6
03:39 MadcapJake` maybe RAKUDO_PREFIX is being set somewhere? I'm really an NQP noob but a glance at Configure.pl doesn't really show prefix going anywhere special (must be wrong though...)
03:39 cognominal joined #perl6
03:39 skids well, it's not in my shell's env.  Too tired to figure this out now though.
03:40 timotimo https://github.com/rakudo/rakudo/blob/n​om/src/vm/moar/ModuleLoaderVMConfig.nqp - could this be interesting?
03:41 MadcapJake` maybe it's this: https://github.com/perl6/nqp/​blob/master/Configure.pl#L93
03:43 MadcapJake` yeah i think it's that and then it's stored here: https://github.com/perl6/nqp/blo​b/master/Configure.pl#L235-L239
03:43 MadcapJake` (for MoarVM)
03:44 MadcapJake` oi, makefiles are totally brick walls for me :P
03:45 MadcapJake` honestly it looks like prefix is just used there to install to the right location, I'm not really understanding how nqp::backendconfig attains its data
03:50 skids It looks like the 'home' repo doesn't have a configurable to alter it.
03:52 buharin joined #perl6
03:53 cognominal joined #perl6
04:07 cpage_ joined #perl6
04:28 wamba joined #perl6
05:12 buharin joined #perl6
05:31 saaki is there a nicer way to write the following? (2..22).grep({not $_ % 6}).say
05:33 saaki basically want to skip values in a range
05:43 Hotkeys m: say (2..22).grep(*!%%6)
05:43 camelia rakudo-moar b243a9: OUTPUT«(2 3 4 5 7 8 9 10 11 13 14 15 16 17 19 20 21 22)␤»
05:43 Hotkeys Like that saaki ?
05:44 Hotkeys m: say (2..22).grep(*!%6)
05:44 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NXsrKJ38xo␤Cannot negate % because multiplicative operators are not iffy enough␤at /tmp/NXsrKJ38xo:1␤------> 3say (2..22).grep(*!7⏏5%6)␤    expecting any of:␤        infix␤        infix stoppe…»
05:44 Hotkeys Okay
05:44 Hotkeys So yeah the first one
05:44 Hotkeys I assume
05:45 cpage_ joined #perl6
05:46 saaki p6: (2..22).grep({not $_ % 6}).say
05:46 camelia rakudo-moar b243a9: OUTPUT«(6 12 18)␤»
05:48 saaki Hotkeys: not the right sequence :|
05:50 Cabanossi joined #perl6
05:50 go|dfish p6: (2..22).grep(* %% 6).say
05:50 camelia rakudo-moar b243a9: OUTPUT«(6 12 18)␤»
05:50 saaki let's say i want values in increments of 1_000_000, just doesn't make sense to use grep on a sequential range. guess the range class doesn't have a provision for skipping
05:53 saaki maybe a gather-for-take i guess
05:55 adeeb joined #perl6
05:57 adeeb Hello guys I am adeeb. I need help in extracting email address along with first name and lastname using perl software from any given website. I would be grateful to y99ou
05:58 darutoko joined #perl6
05:58 Hotkeys saaki: oh
05:58 saaki i gave a bad example on the range side since i don't care about 2
05:59 jdv79 adeeb: maybe p5 is better at this task.  i think there may be some cpan modules to so stuff like that already.
05:59 Hotkeys m: say (6, 12 ... 100) # all multiples of 6 to 100
05:59 camelia rakudo-moar b243a9: OUTPUT«(6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 96)␤»
05:59 Hotkeys Like that?
05:59 jdv79 s/so/do/
05:59 Hotkeys if you want more general
06:00 adeeb thank you can you guide me a link
06:00 jdv79 ask in #perl
06:00 saaki Hotkeys: perfect!
06:01 Hotkeys m: say {($^a, * + $a ... $^b)}(1_000_000, 10_000_000)
06:01 camelia rakudo-moar b243a9: OUTPUT«(1000000 2000000 3000000 4000000 5000000 6000000 7000000 8000000 9000000 10000000)␤»
06:01 Hotkeys There's essentially an anonymous function for multiples of a up to b
06:01 adeeb left #perl6
06:01 ZhangGong|2 joined #perl6
06:02 Hotkeys If you want the first n numbers
06:02 saaki Hotkeys: cool. also, i missed out on the *
06:03 Hotkeys m: (6, 12 ... *)[^10]
06:03 camelia rakudo-moar b243a9: ( no output )
06:03 Hotkeys er
06:03 saaki Inf
06:03 saaki ?
06:03 Hotkeys m: say (6, 12 ... *)[^10]
06:03 camelia rakudo-moar b243a9: OUTPUT«(6 12 18 24 30 36 42 48 54 60)␤»
06:03 Hotkeys First 10
06:03 Hotkeys * is hard to explain
06:03 saaki i see
06:03 Hotkeys It means 'whatever'
06:03 Hotkeys And does different things in different contexts
06:04 Hotkeys Like here's the Fibonacci sequence
06:04 Hotkeys m: say (0, 1, * + * ... 100)
06:04 camelia rakudo-moar b243a9: OUTPUT«(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 70140…»
06:04 Hotkeys Well I did that poorly
06:04 Hotkeys But you get the gist
06:05 saaki yes, thanks
06:05 Hotkeys In a sequence like that * + * acts like $^a + $^b
06:05 Hotkeys But at the end of a sequence it basically acts as inf
06:05 Hotkeys Unless you make it a conditional
06:06 Hotkeys like ?p6> say (1,2,4 ... * > 30)
06:06 Hotkeys Er
06:06 Hotkeys Wrong command
06:06 Hotkeys And no new line
06:06 Hotkeys But
06:06 Hotkeys It does what it looks like it does
06:07 saaki can't seem to find those uses of * in docs
06:08 Hotkeys http://design.perl6.org/S0​2.html#The_Whatever_Object
06:08 Hotkeys Here's some from the spec
06:09 saaki really like the docs for the most part, just tough to find some of these cool little patterns there
06:10 Hotkeys yeah
06:10 Hotkeys the docs aren't perfect but they'll improve with time
06:11 jdv79 you could grep the setting for * and Whatever maybe
06:11 Hotkeys Anything you can't find in the docs you can probably find in the specs with a little elbow grease
06:12 saaki have managed to dig up some things from design.* via google, bit surprising sometimes. should probably just read them through.
06:12 Hotkeys lol
06:12 Hotkeys be aware not everything in the spec is implemented yet
06:12 Hotkeys but whatevers implemented is probably in the spec
06:13 Hotkeys if that makes sense :p
06:13 saaki it does
06:17 saaki would like to contribute, seems nqp needs some work
06:31 billj joined #perl6
06:32 billj p6: say 3;
06:32 camelia rakudo-moar b243a9: OUTPUT«3␤»
06:32 * saaki may resolve to docos
06:51 jack_rabbit joined #perl6
06:57 ufobat joined #perl6
07:02 domidumont joined #perl6
07:07 domidumont joined #perl6
07:09 FROGGS joined #perl6
07:23 sjoshi joined #perl6
07:27 abaugher joined #perl6
07:29 jack_rabbit joined #perl6
07:35 CIAvash joined #perl6
07:36 atweiden joined #perl6
07:38 firstdayonthejob joined #perl6
07:39 nakiro joined #perl6
07:41 st_iron joined #perl6
07:42 el_amigo joined #perl6
07:43 masak morning, #perl6
07:43 atweiden in rakudo source, in the case of `multi sub infix:<eqv>(FatRat, FatRat)`
07:43 atweiden (https://github.com/rakudo/rakudo/b​lob/b243a9663273bf3f82c51109ab0eff​9556d2177e/src/core/Numeric.pm#L32)
07:43 atweiden is this the intended behavior?
07:43 atweiden m: my FatRat $f = FatRat(9898989888989898989809090909​39838302233848473393040383234234509​484.3489523478234723847238432423); say $f eqv FatRat(9898989888989898989809090909​39838302233848473393040383234234509​484.3489523478234723847238432423); say $f eqv FatRat(9898989888989899402478441911​34641988224436627880004840480824357​399.83933482381524942767485346932);
07:43 camelia rakudo-moar b243a9: OUTPUT«True␤True␤»
07:43 atweiden or this
07:43 atweiden m: my FatRat $f = FatRat(9898989888989898989809090909​39838302233848473393040383234234509​484.3489523478234723847238432423); say $f eqv FatRat(9898989888989898989809090909​39838302233848473393040383234234509​484.3489523478234723847238432423); say $f == FatRat(9898989888989899402478441911​34641988224436627880004840480824357​399.83933482381524942767485346932);
07:43 camelia rakudo-moar b243a9: OUTPUT«True␤False␤»
07:45 masak ...no? :)
07:45 masak seems they should only be == or eqv if they're numerically equal
07:46 masak which is a pretty clear-cut notion
07:48 atweiden masak: good morning to ya :) i was thinking about writing a new multi sub handling FatRat
07:49 masak ok :)
07:49 ufobat good morning :)
07:49 fireartist joined #perl6
07:50 atweiden should the eqv sub go in rakudo/src/core/Rat.pm ?
07:51 atweiden i haven't tested but it's possible Rat is affected by this too
07:52 st_iron left #perl6
07:53 atweiden any thoughts on rewriting the existing one in Numeric.pm
07:54 masak I'd say go for it; see whether the result is better
07:54 masak this ought to be measurable in absolute passing-tests numbers
07:55 masak the above evals are obviously suspicious and a strike against the current implementation
08:22 papayaman joined #perl6
08:23 papayaman mst: hey man, i know you said on twitter that you don't like perlmaven. why don't you submit PRs or issues to its github repo ? https://github.com/szabgab/perlweekly/issues
08:23 papayaman mst: it's not going to fix itself you know..
08:24 papayaman unless there's some telepathy going on between you and gabor..
08:24 moritz papayaman: does this discussion belong into #perl6?
08:25 papayaman left #perl6
08:26 moritz wow, /quit'ing after leaving such a message isn't the best thing you can do to emphasize your point
08:28 zakharyas joined #perl6
08:29 tweakism trouble in paradise?
08:29 [Tux] test            21.717
08:29 [Tux] test-t          13.739
08:29 [Tux] csv-parser      49.050
08:36 RabidGravy joined #perl6
08:36 Hotkeys moritz: you mean joining specifically to say your message and then immediately leaving isn't the way to do things???
08:37 Hotkeys :p
08:42 RabidGravy marning!
08:45 salv0 joined #perl6
08:45 masak moritz: I agree it wasn't on-topic... but everytime such a thing happens, I understand a bit better the lightning-rod role mst has taken on in the p5 community.
08:47 masak it's like... people who won't ever rise above ad-hominem anyway, end up thinking that mst is the cause of all their worries. (and so other people can get on with being productive.)
08:49 abraxxa joined #perl6
08:56 stmuk_ the best solution for the large minority of people who find mst toxic is to attempt to ignore him
08:57 Hotkeys Idk who mst is
08:57 Actualeyes joined #perl6
08:57 El_Che ah perl6-js grant? \o/
08:58 Hotkeys Yeah we'll take over the web soon
08:58 Hotkeys And then the world
09:00 El_Che and after some years, we'll still be big in Japan!
09:04 dakkar joined #perl6
09:11 RabidGravy sorry, I've taken over the world already, I've just been subtle about it
09:13 masak you're the fifth person this month to come in and say that
09:13 El_Che RabidGravy: if that's the case, can you "fix" a few parking tickets I have, you know as master of the world
09:16 masak I still find it interesting that python3 will not only fail on removed 2.x syntax (like circumfix:<` `> and infix:<< <> >>), but do so in a way that gives no indication it ever worked
09:16 masak it's like the total opposite of the Perl 6 approach
09:16 jast El_Che: that wouldn't be very subtle, now would it
09:17 cpage_ joined #perl6
09:17 Hotkeys masak: its hard when people think of perl 5 -> 6 like they think of python 2 -> 3
09:17 Hotkeys Like perl 6 is brand new
09:17 tweakism masak: I think their goal is to make a clean-break and shed what they consider to be mis-features
09:18 Hotkeys Well
09:18 Hotkeys Its a long time in the making
09:18 Hotkeys But brand new kind of
09:18 tweakism that doesn't forego helpful errors, but it explains why they break backwards compatibility
09:18 Hotkeys In the sense that it isn't p5
09:19 tweakism masak: backwards-compat is valuable, but it can also be a great burden sometimes.
09:19 masak oh, agree in general
09:20 masak but here it just feels like a missed opportunity to put in the minimal amounts of code to recognize-but-flag-as-gone the old syntax
09:20 masak they do in the case of `print "hi"` vs `print("hi")`, thankfully
09:21 tweakism heh, it would be kindof amusing if you could import from past
09:21 tweakism from past import print_statement
09:27 bjz joined #perl6
09:28 masak well, you can always do like the JavaScript community, and compile your private dialect of python3 to standard python3 :)
09:30 tweakism lol.
09:30 tweakism I do that in JavaScript too, because the dialects that are actually available where I need to run are broken and braindead in various ways.
09:38 RabidGravy I'll just mention that I really don't like coffeescript at all
09:43 gregf_ hi, is there a way to list all methods of an instance?
09:44 gregf_ like so, class Foo { method bar() { } method baz(){} }; and then my $f = Foo.new; print $f.methods or something along those lines
09:46 jnthn m: class Foo { method bar() { } method baz(){} }; say Foo.^methods
09:46 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NgJveNd_F9␤Strange text after block (missing semicolon or comma?)␤at /tmp/NgJveNd_F9:1␤------> 3class Foo { method bar() { }7⏏5 method baz(){} }; say Foo.^methods␤    expecting any of:␤        i…»
09:46 jnthn m: class Foo { method bar() { }; method baz(){} }; say Foo.^methods
09:46 camelia rakudo-moar b243a9: OUTPUT«(bar baz)␤»
09:46 jnthn Can do it on an instance too
09:47 gregf_ jnthn: cheers
09:54 virtualsue joined #perl6
09:56 RabidGravy if I have a CStruct and I apply a role to it with an attribute will that mess up the representation in native-land?
09:58 jnthn RabidGravy: Compile-time composition, or mix-in?
09:58 cognominal joined #perl6
09:59 jnthn role Foo { has int32 $.x }; class C is repr('CStruct') does Foo { } # this should be fine since the attributes are flattened into the role, so it's no different from CStruct's point of view
09:59 jnthn afaik, anyways :)
09:59 rindolf joined #perl6
09:59 RabidGravy either really, in portaudio there is a struct DeviceInfo but everywhere else in the API it is reference by an "index"
10:00 RabidGravy so it would be nice to store the index in the class somehow but not make that appear to the native struct
10:00 jnthn Oh...
10:01 jnthn I'd probably solve that with delegation
10:01 RabidGravy yeah, that  was the next option
10:01 jnthn class WrapperThingy { has TheCStructType $.foo handles *; has $.index; }
10:01 Hotkeys What does handles do
10:02 Hotkeys I haven't seen that one before
10:02 Hotkeys Is it a native thing
10:02 RabidGravy it makes the methods of the attribute appear as methods of the object
10:02 RabidGravy no not native
10:03 RabidGravy m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles <bar> = Foo.new };  Baz.new.bar
10:03 camelia rakudo-moar b243a9: OUTPUT«bar␤»
10:04 Hotkeys Neat
10:04 RabidGravy the * in jnthn's example is "gimme everything"
10:04 Hotkeys Right
10:04 Hotkeys I assumed as much
10:04 Hotkeys I've gotten good at guessing what whatever does
10:04 RabidGravy you can also do it with a hash which is their-name => my-name
10:05 Hotkeys Oh so like
10:05 Hotkeys You could map bar to qux
10:05 Hotkeys And then call qux
10:05 RabidGravy yeah
10:05 gregf_ m: class Foo { method bar() { print "Bar"; } }; class Baz { has Foo $.f handles *; method yay(){ self.bar(); } };Baz.new.yay(); #<== something like that i would imagine
10:05 camelia rakudo-moar b243a9: OUTPUT«Bar»
10:06 RabidGravy m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles bar => 'bap' = Foo.new };  Baz.new.bap
10:06 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/d1OfTI0aH_␤Cannot modify an immutable Str␤at /tmp/d1OfTI0aH_:1␤»
10:06 Hotkeys Handles in my mind brings up memories of when I had to do VB.Net in high school
10:06 Hotkeys And handles did evenets
10:06 Hotkeys Events
10:06 RabidGravy m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles (bar => 'bap') = Foo.new };  Baz.new.bap
10:06 camelia rakudo-moar b243a9: OUTPUT«Method 'bap' not found for invocant of class 'Baz'␤  in block <unit> at /tmp/SV50oUkceS line 1␤␤»
10:06 RabidGravy or even the other way around
10:06 RabidGravy m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles (bap => 'bar') = Foo.new };  Baz.new.bap
10:06 camelia rakudo-moar b243a9: OUTPUT«bar␤»
10:07 gregf_ other way i would imagine, as thats how its in Moose :|
10:07 FROGGS .tell azawawi I'd like to extend your Selenium::WebDriver to support BlackBerry devices... and I think I'd need guidance on how to setup Firefox testing. Would be nice if we could chat a little
10:07 yoleaux FROGGS: I'll pass your message to azawawi.
10:09 jnthn Yes, it points from the name you expose to the name it'll map into
10:09 RabidGravy I always have to look
10:10 RabidGravy I also have to not use a '*' in about half of cases as it doesn't like some kinds of members
10:10 FROGGS jnthn: can you tell me if this patch is just rubbish or sensible? https://github.com/rakudo/rakudo/commit/​802a6db7be0c5f962c7ceadbb6b4929e3cddd7bc
10:11 jnthn Makes no sense
10:11 jnthn $s is already a native string
10:11 jnthn So it'll code-gen a box just so it has one to throw away :P
10:13 pmurias joined #perl6
10:14 RabidGravy aga do do do
10:16 FROGGS jnthn: so my gut feeling was right... we got a Heisenbug here
10:17 FROGGS maybe... if I'd add a serialize function to NativeRef, I'd dump its value and maybe get a clue what it is
10:18 * FROGGS wants Data::Dumper in C
10:18 cognominal joined #perl6
10:18 ilmari gdb ;)
10:18 FROGGS ha!
10:18 ilmari p my_struct
10:19 FROGGS well, I could potentially add a breakpoint...
10:19 FROGGS hmmm
10:19 FROGGS yes, will try that
10:27 espadrine joined #perl6
10:31 espadrine_ joined #perl6
10:36 pierrot joined #perl6
10:41 profan joined #perl6
10:42 cpage_ joined #perl6
10:44 espadrine joined #perl6
10:46 daxim joined #perl6
10:54 masak m: try 1e0 / 0e0; say $!.^name
10:54 camelia rakudo-moar b243a9: OUTPUT«X::Numeric::DivideByZero␤»
10:55 * colomon is looking at the FatRat / Rat eqv patch and trying to figure out what it is meant to be doing.
10:59 pmurias_ joined #perl6
11:04 gregf_ m: class Foo { method bar($a) { }; method baz($a, $b) { } }; print Foo.^methods.map(*.arity)
11:04 camelia rakudo-moar b243a9: OUTPUT«2 3»
11:04 gregf_ should'nt this be printing 1 2?
11:05 gregf_ ah nevrmind, prolly self is included :|
11:06 mls_ joined #perl6
11:08 cognominal joined #perl6
11:09 jnthn gregf_: self is included; we don't consider self special. If you wanted to call the method as a code object directly you'd have to pass something to fill the invocant slot.
11:11 mls joined #perl6
11:13 musiKk_ joined #perl6
11:17 kid51 joined #perl6
11:23 cognominal joined #perl6
11:23 gregf_ oh - ok
11:24 gregf_ so Foo.^methods[0].(Foo.new, 10) #or whatever
11:25 Woodi do self/this thingies are realy necesarry ? it's "how it works" currently but you do not pass car somewhere so there car can start engine... currently objects "use" methods in the classes so method need to know which object called it but can it be another way ? objects "slurps" method from class storage and call it ?
11:25 Woodi hi today :)
11:27 tweakism Woodi: a method isn't necessarily called on an instance of the class that defines it.
11:27 Woodi tweakism: but that is special case of OO system you have
11:28 tweakism other languages provide a keyword like 'this', but I like the explicit-self-parameter style personally.
11:28 tweakism Woodi: I don't think 'allows inheritence' is very special among OO implementations, is it?
11:29 Woodi tweakism: no idea what is allow inheritance system...
11:30 tweakism Woodi: Vehicle defines wheels().  Car inherits from Vehicle.  somecar.wheels() calls Vehicle.wheels() on an instance of Car.  (assuming Car doesn't override wheels())
11:31 Woodi tweakism: and what is *popular* in industry is not important at all. what's is better is.
11:32 tweakism *shrug*
11:32 gregf_ Woodi: self/this are not mandatory afaik
11:32 Woodi at the end you will hit valit range of specialisations usefull in particular cases :)
11:32 gregf_ for example in this case: self 'is' needed:
11:33 Woodi gregf_: but it's like current OO implementations work internally. i wonder what about something else :)
11:33 gregf_ class Foo { def bar;end };  class Bar < Foo; def baz; self.class.superclass.instance_​method(:bar).bind(self).();end; end <== in ruby
11:34 gregf_ Woodi : even in Java 'this' is not mandatory
11:35 Woodi gregf_: but it is there, i think. syntax isn't important
11:35 tweakism ultimately, they are just different syntaxes for the same thing, I think.  not entirely certain, but I think.
11:36 tweakism the car object *does* get "passed" to the start_engine method in either case; making it an explicit parameter makes it easy to reason about.
11:36 Woodi gregf_: what this Ruby thing do ? you have variable bar in Foo but later use method bar...
11:36 tweakism some languages make a real mess w/ this (JavaScript).
11:37 Woodi tweakism: yes. but maybe something other have sense too ? and maybe it can be better in some cases ?
11:37 gregf_ Woodi: its a mental way by which a specific class calls a different method from the generic/parent class :| #ofcourse s/{//;
11:39 RabidGravy right off out for a bit
11:39 Woodi gregf_: it's make sense. why clone methods into *every* object, would be waste. but this system just use objects like varibles...
11:39 tweakism Woodi: so you're saying design a language that requires neither a self parameter nor a self/this keyword?
11:40 Woodi tweakism: trying things (or just thinking) is like science works :)
11:40 jnthn Woodi: You might find CLOS interesting :)
11:41 Woodi jnthn: I need to learn Lisp first probably... :)
11:41 Woodi jnsso it's already invented ??
11:41 Woodi jnthn*
11:42 Woodi using objects is indirection via pointer :)
11:42 jnthn Woodi: Well, they have a different way of looking at objects/methods is all. Objects don't have methods, and the "methods" can have multiple invocants
11:42 jast so you're thinking about a system to reference objects wihout referencing them?
11:43 jnthn Actors are also intereting to look at, and probably closer to the original thinking of OO.
11:43 Woodi jast: I think not. objects just take methods from class and use it on fields
11:43 jast depends. not all implementations of object orientiation even *have* classes...
11:44 jnthn The trouble with OO naming wise is it puts the focus on objects, whereas the interesting thing is the messages.
11:44 ilmari like javascript, to take random example
11:44 ilmari +a
11:45 * jnthn found OO design a lot easier when he started desining message first, then grouping them by invariants to discover the objects, rather than trying to work out what objects should exist
11:45 jnthn *designing
11:46 Woodi jnthn: discover ? you mean paper-pencil-design ?
11:46 colomon m: say (989898988898989898980909090939838​302233848473393040383234234509484.​3489523478234723847238432423).nude
11:46 camelia rakudo-moar b243a9: OUTPUT«(98989898889898989898090909​0939838302233848473393040383234234​5094843489523478234723847238432423 9999999999999999583119736832)␤»
11:46 * colomon is trying to figure out how that makes any sense
11:46 moritz a simplistic approach to OO design that works surprisingly well is to start with a bunch of subroutines, and see what data they need in common and pass around everywhere
11:47 jast I take a data-centric view, too, usually
11:47 moritz then you can start putting the common data into one or several related objects, using Common Sense[tm]
11:47 jnthn Woodi: For many design tasks I use pen/paper or a whiteboard at first, but I quickly move to sketching in code instead.
11:47 jast what's almost never a good idea is starting with tons of base classes and building up a huge hierarchy
11:48 ilmari premature generalisation is the root of much mess
11:48 jnthn Woodi: But I mostly just mean that I found that "what classes should I have" and "what fields to they need" tend to come later than "what behaviors should the system have" for me.
11:48 ilmari you don't know what the general patterns are until you've implemented/designed several similar things
11:48 jast I quite like composition like with P6's roles
11:48 tweakism people want to inherit because you can, but has-a relations seem to usually be more appropriate, yes?
11:49 wamba joined #perl6
11:51 dalek nqp: d811340 | (Pawel Murias)++ | src/vm/js/HLL/Backend.nqp:
11:51 dalek nqp: [js] Switch from uglifyjs to js-beautify.
11:51 dalek nqp: review: https://github.com/perl6/nqp/commit/d81134094d
11:51 dalek nqp: 4e1979c | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (2 files):
11:51 dalek nqp: [js] Move up serialization format to version 18.
11:51 dalek nqp: review: https://github.com/perl6/nqp/commit/4e1979c88d
11:52 pmurias jnthn: are there any ways to determine if a given closure needs to be serializable?
11:52 tmch joined #perl6
11:54 cognominal joined #perl6
11:58 * timotimo generally develops dada-centric
11:59 pmurias jnthn: if I store lexicals using js lexicals it's more efficent but makes it hard to extract them for serializing closures :/
12:00 spebern joined #perl6
12:02 jnthn pmurias: I'm pondering, but...I don't really have a good answer.
12:02 jnthn pmurias: Rakudo will get much more aggressive at lexical -> local lowering
12:02 dalek nqp: 6f3aa41 | (Pawel Murias)++ | src/vm/js/nqp-runtime/serialization.js:
12:02 dalek nqp: [js] Fix typo, ilmari++.
12:02 dalek nqp: review: https://github.com/perl6/nqp/commit/6f3aa41f2e
12:03 jnthn pmurias: So it may become less of a problem than today
12:03 spebern joined #perl6
12:03 jnthn pmurias: But yeah, potentially any closure might be serialized and the demand to do so may even come from a totally separate compilation unit.
12:06 pmurias I could generate both a serializable and unserializable version and just switch to the latter once we know that no serialization will happen, but it seems like something that would just end up adding to much complexity
12:06 jnthn Plus you can't know so easily...
12:07 pmurias yes, it would require user "pragmas" or some other things, and compiling Perl 6 is when we care about NQP speed the most
12:08 pmurias more and more I'm coming to the conclusion that I should have a seperate analysis pass before actually compiling to js
12:09 colomon m: say Rat.new(989898988898989898980909090​93983830223384847339304038323423450​94843489523478234723847238432423, 10000000000000000000000000000)
12:09 camelia rakudo-moar b243a9: OUTPUT«98989898889898989898090909093​983830223384847339304038323423450948​4.348952347823472397436717074015␤»
12:10 pmurias which could determine things like "this sub is never rebound and only called with named parameters from those 2 places and doesn't care about dynamic variable"
12:10 spebern` joined #perl6
12:12 pmurias jnthn: would SPESH benefit from being preseeded with facts, like if I could statically infer what the type of a given variable is
12:12 pmurias ?
12:12 jnthn pmurias: Not epsecially. The problem comes down to proof.
12:13 jnthn pmurias: That is, a bunch of what spesh does is throw out checks and virtualization
12:13 jnthn pmurias: But it has to know it's safe to do that
12:14 jnthn pmurias: We can in various cases generate simpler code from static analysis.
12:17 pmurias jnthn: I'm thinking about stuff like "my class Foo {...}; my $foo := Foo.new; # we know what type $foo is once we close the classes"
12:17 Skarsnik joined #perl6
12:18 pmurias mere guess seem of very little value to SPESH as it runs at runtime and can just check the type
12:18 jnthn ...unless it's re-bound :)
12:20 spebern joined #perl6
12:22 pmurias of course, which is why such type inference seems to complex to put in an adhoc manner inside the code generator
12:23 jnthn Yeah...well, I've figured we'll do better with dynamic optimization in general.
12:23 pmurias for moarvm it seems better and it seems like something that will be more predictable
12:23 jnthn Because people want their scripts to run fairly snappy too, and doing fancy analysis on something that won't do much at runtime anyway is kinda wasted
12:23 jnthn But at runtime you can discover what's hot and worth investing time optimizing
12:32 mst moritz: and in any case, as I *said* on twitter, when I submitted bug reports for perlmaven gabor yelled at me for criticising his code and didn't fix any of the bugs, so shrug, I already fscking tried :(
12:33 mst stmuk_: indeed; people are allowed to dislike me if they want to :)
12:33 * mst apologises for the noise, was just following up the highlight
12:36 moritz 's ok
12:36 wamba joined #perl6
12:38 * mst suspects that because I forgot to do the reply-chaining thing he'll've seen an RT of the first tweet but not the subsequent one, so that's arguably my fault anyway
12:42 virtualsue joined #perl6
12:47 johndau joined #perl6
12:48 * masak wonders if he would ever yell at a contributor, no matter who it was, for criticising his code
12:48 tweakism meh, everyone has bad days / makes poor/hasty decisions.
12:48 tweakism some more often than others.
12:49 masak 'sooth
12:51 johndau joined #perl6
12:56 kaare_ joined #perl6
12:57 moritz .oO( how dare you insinuating that I make poor decisions! )
12:59 * masak .oO( how dare you joke about serious subject matters! )
13:06 Cabanossi joined #perl6
13:06 hoelzro o/ #perl6
13:15 cdg joined #perl6
13:21 Some-body_ joined #perl6
13:24 cognominal joined #perl6
13:28 kanishka joined #perl6
13:29 ilbot3 joined #perl6
13:29 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
13:32 aborazmeh joined #perl6
13:32 aborazmeh joined #perl6
13:33 molaf joined #perl6
13:35 RabidGravy joined #perl6
13:36 camelia joined #perl6
13:36 moritz PSA: rakudo, nqp and roast commits will now be announced in #p6dev, not here anymore
13:38 RabidGravy I didn't know there was a #p6dev
13:40 perlpilot That's because it didn't exist until recently  :)
13:40 ilmari recently as in "just now"?
13:40 skids joined #perl6
13:42 moritz yes
13:42 * RabidGravy gets in there
13:42 Cabanossi joined #perl6
13:48 virtualsue i'm happy to hear that new channel day has arrived
13:49 timotimo hey sue :)
13:50 virtualsue did you get to the hackathon last saturday?
13:50 timotimo yes! :D
13:50 virtualsue kewl
13:50 timotimo i was just a little sad so many people that have been to the conference didn't attend the hackathon :|
13:51 timotimo but that just makes the reinforcement of "next time i'll sign up on time" stronger
13:52 virtualsue if it would have helped, you could have had my registration
13:52 timotimo :o
13:52 timotimo i hadn't considered that avenue of thought at all!
13:52 virtualsue however i enjoyed it no end
13:53 timotimo wait ... were you saying you weren't able to attend, or you would have offered to let me attend instead of you?
13:54 dalek rakudo-star-daily: a3d4488 | coke++ | log/ (8 files):
13:54 dalek rakudo-star-daily: today (automated commit)
13:54 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/a3d44886b1
13:55 virtualsue i'd have watched stmuk do his talk through the window ;-)
13:55 timotimo no, i couldn't possibly have accepted that :)
13:56 virtualsue surprised you weren't there but glad you made it on sat
13:57 timotimo i messed up big time. i've been told way in advance about things, been reminded at least once, but still procrastinated signing up until it was quite a bit too late
13:58 timotimo but i did manage to get some code done during the hackathon, which felt good
13:58 vendethiel joined #perl6
14:00 virtualsue stmuk used your code in his talk i believe - SDL2::Raw
14:00 timotimo aye, i saw :)
14:00 timotimo i'm looking forward to the recording
14:01 virtualsue lots of good feedback
14:01 timotimo but SDL2::Raw is really just the most straight-forward binding to SDL2 that you could possibly come up with
14:01 timotimo so there's not too much credit to be given ;)
14:01 timotimo the examples/ folder, on the other hand ... that stuff is kinda neat!
14:01 virtualsue i'm using something quite similar with Go right now
14:02 masak virtualsue: something quite similar to Go? tell us more!
14:03 timotimo i heard virtualsue is actually the person who decides what moves AlphaGo makes
14:03 virtualsue HA
14:03 timotimo remember the few blunders AlphaGo made in the last(?) match? that was just the cat walking over the keyboard
14:04 masak I heard it was the Higgs boson interfering with the circuitry
14:07 virtualsue simple carelessness, not putting the cat out and blaming particle physics
14:08 DrForr_ When it gets confusing is where you're also puttingthe cat out.
14:08 RabidGravy I don't know, I rely on the "cat effect" for most of what I do
14:09 RabidGravy I did a set for a radio show a couple of years ago and the cat decided to attack my feet while I was about halfway through the "live" recotding
14:09 virtualsue i know - i've heard some of your stuff :-)
14:10 RabidGravy :)
14:11 tadzik timotimo: have you used your Cairo bindings with Gtk::Simple?
14:11 timotimo yes, i have
14:11 RabidGravy have you ever been to one of my (rare) live gigs?
14:12 rindolf joined #perl6
14:12 RabidGravy I know ilmari has
14:12 virtualsue unfortunately not
14:12 timotimo that's what powered my first shooter game (last year's GPW) and the live coding environment thingie
14:12 tadzik right, can you point me to that example? I can't find it on your github
14:12 timotimo https://github.com/timo/gtk_cairo_shooter
14:12 tadzik I decided to do my note editor thingy in p6 after all
14:12 tadzik or at least try
14:13 tadzik ah, there it is. Thanks!
14:13 timotimo i coulnd't get it to render with opengl back then; there ought to be some way to do it now, but it would have to be added to GTK::Simple, too
14:13 timotimo so it's doing everything in software rendering
14:13 tadzik should be good enough for me if it's on cairo side
14:14 timotimo yeah
14:16 timotimo good luck in any case :)
14:16 timotimo let me know how it goes
14:26 tadzik yeah, will be a while, now that I realized that cpan's MIDI may not do real-time midi stream handling
14:26 timotimo ugh
14:26 tadzik ah, no, it seems to do
14:26 timotimo who ever needed that anyway
14:27 tadzik at least there was a conference talk about it :P
14:27 tadzik and I know the guy who did it :)
14:28 tadzik ah, no. There's MIDI::Realtime, but it only does writing to midi. Not reading. How convenient :D
14:28 telex joined #perl6
14:28 tadzik I hope p6's Bufs are up to this
14:29 timotimo if we'll get a nice midi module out of this, i'm all for it :P
14:31 Hotkeys There's a p6 live coding environment?
14:32 zakharyas joined #perl6
14:32 timotimo Hotkeys: just for cairo-using code
14:32 Hotkeys Ah
14:34 RabidGravy tadzik, timotimo I have sketched out Audio::PortMidi bindings right here, I may get round to it at some point
14:34 tadzik oo
14:35 timotimo PortMidi is the midi portion of PortAudio?
14:35 RabidGravy yeah
14:35 timotimo mhm, mhm.
14:36 RabidGravy It'll be subject to the same real-time constraints as portaudio but you have more wiggle room
14:36 tadzik RabidGravy: is it up somewhere?
14:39 YvargDibar joined #perl6
14:39 YvargDibar boo
14:40 timotimo network troubles?
14:41 virtualsue ghost in the wire
14:43 SauceRageuse joined #perl6
14:43 SauceRageuse yep, BT engineers messing with the overhead over the road
14:44 RabidGravy boo
14:45 RabidGravy I may have been rudely interrupted by the BT guys doing what BT guys do
14:46 RabidGravy (i.e. breaking everything)
14:53 virtualsue nobody appreciates infrastructure. if they don't break it, you wouldn't realise how much you need it
14:55 virtualsue it's probably in the schedule: x% tactical breakage randomly spread around the customer base
15:03 Skarsnik hm, is there a way to get back a Version to its p6 syntax? Like my $version = v1; say $version.Str; #output v1 and not 1
15:04 Skarsnik oh .gist ><
15:04 perlpilot or .perl
15:04 perlpilot (.perl sounds more like what you want)
15:05 Skarsnik Yes
15:05 Skarsnik that what I just though
15:06 RabidGravy joined #perl6
15:07 RabidGravy gah, if they don't stop that I'm going to go across the road and take their tools off them
15:07 Skarsnik BT guys?
15:08 RabidGravy yeah
15:09 RabidGravy I think they've stopped now.  There's a telephone pole across the road that feeds our line and a few of our neighbours and it's right in a bunch of trees
15:10 RabidGravy so the lines keep getting broken by the trees
15:10 RabidGravy we had a completely new one a couple of years ago
15:10 RabidGravy better than the hundred year old bit of copper that was there before
15:15 tadzik hmmm
15:15 tadzik does P6M Merging GLOBAL symbols failed: duplicate definition of symbol NativeCall ring a bell to anyone?
15:16 RabidGravy yes, but it went away a few weeks ago
15:17 RabidGravy it was a bug in that require was merging the symbols into the local stash so things couldn't see it as being loaded
15:17 RabidGravy or is this a recent rakudo?
15:17 tadzik it's v6.c
15:22 timotimo that's a wee bit old by now
15:23 RabidGravy the bug was only in there for a short window in late january
15:27 cognominal joined #perl6
15:31 donaldh joined #perl6
15:41 stmuk_ http://blogs.perl.org/users/steve_mynott​/2016/03/german-perl-workshop-2016.html
15:46 timotimo stmuk_++ :)
15:52 moritz stmuk_:  "use Foo::Bar:from" can be used from Per... it ate your <perl5> here
15:53 timotimo ah, yes, html tags
15:53 stmuk_ grrr
15:53 moritz stmuk_++
15:54 stmuk_ fixed
15:54 timotimo moritz: i expect we don't have anything like quota set up for hack and www; do we perhaps want quota set up so that processes that have gone berserk won't fill up the disk with garbage?
15:54 moritz timotimo: I'd like to avoid that, and rather react when things go badly
15:55 moritz timotimo: I set up some per-user resource limits, but it seems they don't apply to processes started by cron :(
15:55 timotimo in that case, do we want to set up collectd with some notification mechanism?
15:56 timotimo i think it already supports notification, we'd just have to turn it on and configure it some way. most probably sending mail
15:56 moritz do we? or do we want to use a monitoring system?
15:56 moritz also, so far I've avoided installing a mail server on hack
15:56 timotimo that's probably sane
15:57 moritz I'm not opposed to somebody doing that, but only if they have an eye on it
15:57 timotimo collectd has many different ways to push out notifications. we could exec (or send a network message to) an irc bot
15:58 timotimo exec, log to file, send via network, run perl code, output to syslog, send to a unix domain socket
15:59 moritz timotimo: on the one hand, it would be neat to have something like that. On the other hand, I can't help feeling it's busywork that we don't end up needing/using very much
15:59 timotimo i imagine we'd end up seeing a "hack freezes over" situation coming a bit better when we have something that pings us
15:59 moritz timotimo: on feather, the homes simply ran full occasionally; then somebody would delete compiler and cpanm caches, and all was fine again
16:00 moritz hm
16:00 moritz I thought you were talking about disks filling up
16:00 moritz that doesn't seem to be related to hack freezing
16:01 moritz we have some monitoring for some variables going out of control (number of processes, load average), but it usually comes too late
16:01 moritz I don't know what early indicators are that we could use
16:01 timotimo collectd seems to have a flexible configuration system for "thresholds"
16:03 khw joined #perl6
16:03 timotimo moritz: you know better than i how to administrate dalek; i don't see #p6dev in botnix.conf; is that by accident?
16:04 TimToady joined #perl6
16:04 dalek joined #perl6
16:04 moritz timotimo: yes :-)
16:09 timotimo what's with the multiple-months of packet.*.freenode,* files in dalek-poller/ ?
16:10 timotimo the queue file in there seems to still be appended to, but the beginning of it seems *really* old and it's 26 megabytes big
16:10 Skarsnik could be because of splits?
16:13 CIAvash joined #perl6
16:16 novice33-13 joined #perl6
16:16 novice33-13 my $line='Node=1,Item=W22,Max 10'; $line ~~ /MYREGEX/; say $<Node>, $<Item>, $<Max>; #What is MYREGEX?
16:18 virtualsue joined #perl6
16:18 gregf_ prolly something like (?<Node>(?:\w+)=(\w+)) ?
16:20 perlpilot That's a very P5 looking answer for a channel about P6  :)
16:21 timotimo MYREGEX is a regex that matches any string that contains the literal "MYREGEX" in it
16:21 itaipu joined #perl6
16:21 [Coke] timotimo: wouldn't that be /'MYREGEX'/ ?
16:21 timotimo same thing
16:21 [Coke] kk
16:21 timotimo well, i should have included / in the front and end
16:22 perlpilot [Coke]: all the characters are alphanumeric so no quotes needed
16:25 novice33-13 I need such REGEX so after matching I can say $<Node>, $<Item>, $<Max>
16:25 perlpilot Why?
16:26 Skarsnik It's a grammar then?
16:26 perlpilot Currently, it would have to be a grammar AFAIK  (which is why I wanted to know "why?"  :)
16:27 tony-o_ novice33-13: you can assign in regex to do / $<x>=\w+ / and then $/<x>
16:28 timotimo or even just $<x>
16:28 perlpilot Oh, I suppose he could do a really explicit regex like that.
16:29 perlpilot But, again,  why the constraint that $<Node>, et alia must be available?  Why not just get a list of pairs out of it (for instance)?
16:30 tony-o_ are they ever out of order? not all available?
16:30 RabidGravy can someone come round and do this documentation for me? I'm losing the will to live
16:30 perlpilot and why a regex instead of other, simpler techniques?
16:31 RabidGravy because it's more something or other to have two problems
16:32 perl6newbee joined #perl6
16:32 perlpilot m: "Node=1,Item=W22,Max 10".split(/<[\s,=]>/).hash.perl.say;   # an example
16:32 camelia rakudo-moar b243a9: OUTPUT«{:Item("W22"), :Max("10"), :Node("1")}␤»
16:33 tony-o_ nice
16:34 timotimo m: "Node=1,Item=W22,Max 10".split(["\s", "=", ","]).hash.perl.say # does split take multiple needles?
16:34 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/C0uDrt6SFa␤Unrecognized backslash sequence: '\s'␤at /tmp/C0uDrt6SFa:1␤------> 3"Node=1,Item=W22,Max 10".split(["\7⏏5s", "=", ","]).hash.perl.say # does spli␤    expecting any of:␤        double …»
16:34 timotimo m: "Node=1,Item=W22,Max 10".split([" ", "=", ","]).hash.perl.say # does split take multiple needles?
16:34 camelia rakudo-moar b243a9: OUTPUT«{:Item("W22"), :Max("10"), :Node("1")}␤»
16:35 timotimo it does!
16:35 timotimo ^- this piece of code is probably 100x faster than the one using the character class (though it only accepts the one space, rather than every kind of space)
16:35 perlpilot timotimo: nice
16:35 RabidGravy groovetastic
16:38 tony-o_ awesome
16:38 CIAvash nice!
16:43 virtualsue joined #perl6
16:44 perlpilot timotimo: I challenge your "probably 100x faster"  :-)
16:46 perlpilot but ...
16:46 RabidGravy "significantly faster" should fly
16:46 * perlpilot lunch &
16:46 wamba joined #perl6
16:47 perlpilot RabidGravy: in my little test, it wasn't faster at all.  I want other people to try
16:47 * perlpilot lunch for real this time &
16:48 lostinfog joined #perl6
16:53 tony-o_ for 33 iterations:
16:53 tony-o_ - regex: 0.171848 per iteration
16:53 tony-o_ + regex: 0.188091 per iteration
16:55 cognominal joined #perl6
16:59 timotimo is 33 iterations enough?
16:59 Skarsnik hm, why you can type constraint our variable?
16:59 Skarsnik *can't
17:00 timotimo i guess the string isn't long enough to give you a noticable difference
17:01 tony-o_ 33 isn't very many iterations but it's probably close enough, the times include perl6 start up time and bash iteration times so take them with a grain of salt
17:05 timotimo how have you been, tony-o_? it feels like i haven't talked to you in a while
17:16 novice33-13 m:my $s="Node=1,MaxR 45";$s~~/[ <ident>+ ["=" | \s+] $<val>=<-[,]>+ ]+ % ","/; for flat($<ident> Z $<val>) -> $x,$y { say("our \\$x = $y")}
17:17 tony-o_ not too shabby, have been travelling a lot so i haven't had much time for perl6 :-(
17:17 novice33-13 something like that but with EVAL instead of say and inside regular expression
17:18 novice33-13 p6:my $s="Node=1,MaxR 45";$s~~/[ <ident>+ ["=" | \s+] $<val>=<-[,]>+ ]+ % ","/; for flat($<ident> Z $<val>) -> $x,$y { say("our \\$x = $y")}
17:23 kerframil joined #perl6
17:27 MadcapJake` is there any way I could pass a Perl 6 file handle to a native call class expecting a FILE type?
17:27 MadcapJake` nativecall sub
17:28 ugexe .native-descriptor?
17:28 timotimo what ugexe said
17:28 MadcapJake` what's that?
17:28 jnthn MadcapJake`: .native-descriptor on the Perl 6 handle, then that C thingy that turns an fd into a FILE*
17:29 MadcapJake` ok, so native descriptor is a handle method, what's this C thingy? :P
17:29 geekosaur fdopen()
17:29 Skarsnik hm, how hard it would be to catch SIGSEG and display a Backtrace?
17:29 MadcapJake` ohh so use a C function to create it
17:29 vendethiel joined #perl6
17:30 Skarsnik Well, it's the native component of the Io::Handle on the os, it's a FILE* on unix I guess
17:31 geekosaur no? native-descriptor will be a file descriptor, which is just an int on Unix
17:31 geekosaur (FILE *) is libc's stdio abstraction for buffered I/O on top of file descriptors
17:31 MadcapJake` awesome! will this work with stdout?
17:32 geekosaur mm, that's actually fairly complex
17:32 MadcapJake` or perhaps more precise, is there a nativecall variable for stdout?
17:33 Skarsnik $*IN.native-descriptor?
17:33 geekosaur other stuff already has access to the existing stdout FILE*, you might be better off using nativecall to get at that rather than creating a new FILE* over fd 1
17:33 MadcapJake` haha, seems to work?
17:33 geekosaur buffering will get weird otherwise
17:34 MadcapJake` Skarsnik, $*OUT.native-descriptor gives me 11, will that work?
17:34 geekosaur ...?
17:34 geekosaur 11?
17:34 geekosaur afraid to ask
17:34 MadcapJake` lol
17:34 MadcapJake` geekosaur, could you elaborate on "other stuff"?
17:34 geekosaur stdout is fd1 normally. something is presumably doing something "special"
17:35 geekosaur not easily, no. stdout is a global variable that pretty much any C function could decide to use
17:36 MadcapJake` hmm, I'm not sure I follow, I have a nativecall function that accepts a FILE type and it also states in comment that it can except `stdout` as well, I would like to cover both cases in my nativecall wrapper
17:36 geekosaur stdout is just a specific, globally defined, (FILE*)
17:37 Skarsnik stdout is probably a macro x)
17:37 geekosaur sometimes it is, sometimes it isn't
17:37 MadcapJake` according to gnu.org, it's a regular variable on unix and a macro on other systems xD
17:38 MadcapJake` would be nice if I could pass $*OUT to it and nativecall would Do The Right Thing :P
17:38 geekosaur in the old days it was macroed to an indexed lookup in an array of FILE structs. what it is now will depend on what exact stdio implementation is in use
17:38 tony-o_ timotimo: how's it been going for you?
17:38 geekosaur but if $*OUT.native-descriptor != 1 then I doubt The Right Thing is at all easy
17:39 MadcapJake` bummer
17:39 timotimo tony-o_: it's been going all right. promises of performance improvements are keeping me hopeful :P
17:40 geekosaur and buffering will still potentially be a problem because a FILE* maintains a buffer and presumably the libuv thing perl 6 wraps also maintains a buffer of its own
17:40 perlpilot m: say .native-descriptor for $*IN, $*OUT, $*ERR
17:40 camelia rakudo-moar b243a9: OUTPUT«0␤1␤2␤»
17:41 perlpilot Hmm.
17:41 MadcapJake` geekosaur, any suggestion on what I should do then?
17:41 geekosaur ok, why'd MadcapJake` get 11 then? mistake in checking it?
17:41 ugexe i get 11 on my local as well
17:41 geekosaur hrrr
17:42 MadcapJake` why would mine and ugexe be 11 and camelia be right?
17:42 geekosaur aaaaand I just got 11 as well. wtf
17:42 ugexe difference in eval server?
17:42 geekosaur and $*IN is 9
17:42 perlpilot locally, I get 9, 11, 12
17:42 RabidGravy Isn't it a libuv artefact?
17:43 RabidGravy or something to do with the wrapper or something
17:43 RabidGravy I tracked it down before but forgot what the results where
17:44 * geekosaur has no clue
17:45 Skarsnik I get an issue with calling a NC sub that free a struct. If I use Pointer in the sub definition instead of the struct it work. Even adding is rw does not help
17:45 pmurias joined #perl6
17:45 MadcapJake` maybe it's got to do with one of these SO answers: http://stackoverflow.com/questions/6163​504/linux-proc-pid-fd-for-stdout-is-11
17:45 geekosaur and no idea how this will affect anything. also no idea how exactly this is being used or whether mixing I/O abstractions will be problematic or not
17:45 geekosaur ohhhhhhhhhhhh
17:45 RabidGravy it has no impact on anything that might use them no, I did a test and a "syswrite" using that fd works fine
17:46 geekosaur why would it be using dup() though
17:46 RabidGravy that is the libc's write
17:46 Skarsnik damn my perl6-gdb-m does not work ><
17:46 perlpilot geekosaur: that's what I was wondering
17:48 geekosaur well, you can try it. I have no idea what you're actually trying to do with it, so can't even guess how it will turn out
17:49 vendethiel joined #perl6
17:50 MadcapJake` geekosaur, I will and I'll let you know if it's successful
17:51 novice33-13 Can I EVALuate string "my \Number = 10.5" and get variable named Number?
17:52 timotimo no
17:53 timotimo eval-ing cannot create new lexical variables in an outer/calling scope
17:53 tony-o_ timotimo: what are you working on these days?
17:54 perlpilot also, even if you could make Number, it wouldn't vary.  ;)
17:54 timotimo tony-o_: recently i've been spending some time on SDL2::Raw
17:54 timotimo and of course making rakudo and moarvm better in general is always something i strive for
17:55 Skarsnik IS there a way to get the addr of a NC struct (a cstruct repr class)?
17:57 timotimo yeah, get its WHERE (or WHICH?)
17:58 timotimo m: use NativeCall; my $arr = CArray[int].new(1, 2, 3); say $arr.WHERE; say $arr.WHICH
17:58 camelia rakudo-moar b243a9: OUTPUT«139811157521112␤NativeCall​::Types::CArray[int]|102910000␤»
17:58 timotimo m: use NativeCall; my $arr = CArray[int].new(1, 2, 3); say $arr.WHERE.fmt("%x")
17:58 camelia rakudo-moar b243a9: OUTPUT«7f55dc113130␤»
17:58 timotimo seems legit
17:59 Skarsnik Oh I found my issue ><
18:03 firstdayonthejob joined #perl6
18:03 tony-o_ timotimo: then we can stream audio to one another w perl6
18:03 Skarsnik Hm, I can't find how to export cglobal
18:05 RabidGravy tony-o well ... https://github.com/jonathanstowe/Audio-Por​tAudio/blob/master/examples/stream-source
18:05 RabidGravy just toshing it up, it should hit the ecosystem this evening
18:05 Skarsnik our $kGumboDefaultOptions is export := cglobal(LIB, "kGumboDefaultOptions", GumboOptions); I get (Any) when displaying this variable
18:08 tony-o_ RabidGravy: i'd love to hear 'm: "Node=1,Item=W22,Max 10".split(["\\s", "=", ","]);' spoken rather than written
18:11 FROGGS joined #perl6
18:11 FROGGS o/
18:11 SCHAAP137 joined #perl6
18:11 hoelzro what *exactly* does require() evaluate to? S11 says "the value which is installed as the alias", but what is that? something representing the compunit that was loaded? the last package declaration in that compunit?
18:11 hoelzro o/ FROGGS
18:13 FROGGS hoelzro: I understand it as: if you 'require Foo' and Foo.pm exposes a Foo symbol, then that
18:14 hoelzro ahhhh
18:14 hoelzro that makes sense; maybe I'll update design/docs
18:14 perlpilot what if it doesn't expose a Foo symbol?
18:15 hoelzro I'm seeing some odd behavior; namely, if you already have a symbol named REPL in scope, and you require REPL; you get your original REPL package from require, rather than the new one
18:15 hoelzro perlpilot: good question
18:15 RabidGravy tony-o_, "my $m = Proc::Async.new(:w, 'festival', '--tts');  $m.start; $m.print(""Node=1,Item=W22,Max 10".split(["\\s", "=", ","]);'")"
18:15 RabidGravy there you go ;-)
18:15 FROGGS perlpilot: well, it will evaluate to ::('Foo') anyway
18:16 FROGGS perlpilot: if you intend to use it as a value/type, it probably exposes that symbol...
18:16 FROGGS perlpilot: if you use it by accident, you get a Failure
18:18 patrickz joined #perl6
18:19 perlpilot m: my $x = require Foo;
18:19 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/meaT9Y2fsW␤Undeclared name:␤    Foo used at line 1␤Undeclared routine:␤    require used at line 1␤␤»
18:19 perlpilot What's up with that second message?
18:21 cdg joined #perl6
18:22 FROGGS "Undeclared routine require"
18:22 FROGGS m: my $x = do require Foo;
18:22 camelia rakudo-moar b243a9: OUTPUT«Could not find Foo in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repository::AbsolutePath<139892912…»
18:22 FROGGS m: my $x = do require Test;
18:22 camelia rakudo-moar b243a9: ( no output )
18:22 FROGGS m: my $x = do require Test; say Test
18:22 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VAWrPYnIir␤Undeclared name:␤    Test used at line 1␤␤»
18:22 FROGGS m: my $x = (require Test); say Test
18:22 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BhKeID9HFG␤Undeclared name:␤    Test used at line 1␤␤»
18:22 FROGGS :o(
18:23 FROGGS it is like how you put a while and for loop in statement level
18:23 sufrostico joined #perl6
18:25 nadim joined #perl6
18:25 perlpilot Aye, but that message is LTA.  It points in the wrong direction.
18:30 domidumont joined #perl6
18:33 vendethiel joined #perl6
18:34 FROGGS my $x = while 1;
18:34 FROGGS m: my $x = while 1;
18:34 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pdvd5RwKgr␤Undeclared routine:␤    while used at line 1␤␤»
18:35 FROGGS perhaps we want to specialcase these keywords in this exception?
18:35 MadcapJake` is there a way to make a named argument optional in a multi method signature? I don't want to have a separate multi for every single named argument
18:35 pmurias joined #perl6
18:35 FROGGS MadcapJake`: these are optional by default
18:36 MadcapJake` is it because it's a multi method inside a CPointer class then?
18:36 FROGGS I dunno what your problem is
18:37 MadcapJake` I have 4 multis and all of them can optionally have :$enc left off, but I'm getting an error that there is no signature that matches
18:38 sortiz m: my $pack='Test'; my \M = (require ::($pack)); dd M; # Load Test
18:38 camelia rakudo-moar b243a9: OUTPUT«Test␤»
18:38 FROGGS sortiz++
18:38 FROGGS MadcapJake`: can you gist it?
18:39 FROGGS m: my $x = (require Test); say $x
18:39 camelia rakudo-moar b243a9: OUTPUT«(Test)␤»
18:39 FROGGS of course
18:39 FROGGS MadcapJake`: ohh wait
18:39 xinming_ joined #perl6
18:39 FROGGS MadcapJake`: these methods are not native methods, are they?
18:40 tony-o_ m: my \r = require('Test'); r.ok 1==1;
18:40 camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BvdCmjiu2t␤Two terms in a row␤at /tmp/BvdCmjiu2t:1␤------> 3my \r = require('Test'); r.ok7⏏5 1==1;␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        s…»
18:41 tony-o_ m: my \r = (require Test); r.ok(1==1);
18:41 camelia rakudo-moar b243a9: OUTPUT«Method 'ok' not found for invocant of class 'Test'␤  in block <unit> at /tmp/aRC9iI27hi line 1␤␤»
18:41 MadcapJake` well internally they call native methods but they are members of a class that is repr('CPointer')
18:41 RabidGravy do the signatures contain typed pointers or carrays?
18:42 MadcapJake` yep
18:43 RabidGravy that'll be it, they don't work nicely on methods for some reason, loosen the type consrtraint
18:43 tony-o_ is Test broken currently ?
18:45 MadcapJake` RabidGravy, sweet that did it!
18:46 tony-o_ https://gist.github.com/to​ny-o/6e9634b0c43d22c44833
18:49 tony-o_ that output is from a nuked/freshly built moar from rakudobrew
18:51 MadcapJake` I can't seem to get DESTROY to work with a nativecall CPointer class, does it not happen automatically?
18:51 MadcapJake` s/happen/get called/
18:51 RabidGravy destroy dinnae got called until the GC happens
18:51 musiKk_ joined #perl6
18:51 MadcapJake` dinnae?
18:52 RabidGravy "doesn't"
18:52 MadcapJake` so if I add a say to my DESTROY submethod, will I see it print?
18:52 RabidGravy it may never get called
18:53 MadcapJake` doesn't that mean I've leaked some memory?
18:53 RabidGravy if you want to guarantee something happening when the thing goes out of scope you may want to consider a phaser
18:53 RabidGravy well if the program ends then no
18:56 sortiz MadcapJake`, I use a form of Disposable patern in DBDish's  drivers with a submethod DESTROY { self.dispose } as last resource, and works very well.
18:58 sortiz MadcapJake`, In the Pg and SQLite cases, the statement handlers are native allocated CPointers that need to be deallocated on time.
19:02 spider-mario joined #perl6
19:04 * sortiz Oops! I haven't pushed that DBIish branch yet :-(
19:04 tony-o_ yay for dbiish being updated
19:05 tony-o_ might have to test/update https://github.com/tony-o/perl6-db-orm-quicky
19:07 sortiz tony-o_, I forgot the push 'cus I'm adding ODBC support.
19:07 * sortiz Good excuse! ;-)
19:09 RabidGravy sortiz++ # one off my list ;-)
19:12 tony-o_ sortiz: still an update and ++
19:12 pmurias joined #perl6
19:12 TEttinger joined #perl6
19:12 tony-o_ is Pg more than prepared statement supported yet?
19:14 sortiz tony-o_, What you need?
19:15 tony-o_ in Pg it failed if you tried to prepare more than one statement up front and just call them as needed
19:16 tony-o_ that was over a year ago, i haven't played with anything DBIish since then
19:16 MadcapJake` sortiz, I'm not seeing any DESTROY in the DBIish repo
19:16 sortiz tony-o_, That is solved, yes.
19:16 Skarsnik tony-o_, I have this on some code and it work
19:17 sortiz MadcapJake`, You will see in a few minutes, sorry.
19:17 Skarsnik tony-o_, https://github.com/Skarsnik/fimstuf​f/blob/master/StoryFactory.pm6#L21
19:17 tony-o_ Skarsnik: sortiz awesome guys, thank you
19:17 MadcapJake` oh no problem! I appreciate the advice!
19:21 sufrostico joined #perl6
19:21 virtualsue joined #perl6
19:22 labster joined #perl6
19:25 Woodi m: https://gist.github.com/ano​nymous/e0019267b1320a45cf5c
19:25 camelia rakudo-moar b243a9: OUTPUT«「abcabccaabbc」␤ abc => 「abc」␤  bc => 「bc」␤   c => 「c」␤ abc => 「abcc」␤  bc => 「bcc」␤   c => 「c」␤   c => 「c」␤ abc => 「a」␤ abc => 「abbc」␤  bc => 「bbc」␤   c => 「c」␤»
19:25 Woodi so how to change what tokens generate ?
19:26 yqt joined #perl6
19:28 bartolin joined #perl6
19:30 shlomif joined #perl6
19:30 tony-o_ Woodi: you change the selectors ..
19:32 Woodi tony-o_: you mena in grammar ? I ask about action: how to change result in actions ?
19:32 perlpilot Woodi: perhaps you want what's in $r.ast ?
19:32 tony-o_ are you asking about the type that comes from actions? or ??..what would the end result look like ?
19:33 Woodi just don't get thet .ast stuff
19:33 buharin joined #perl6
19:33 Woodi pleas look on example, last line in action: I changed c into 3 but it is ignored anyway
19:34 lichtkind__ joined #perl6
19:34 Woodi .oO( how to do s/c/3/g with grammar ? ) :)
19:36 dalek DBIish: 8d8f00f | (Salvador Ortiz)++ | lib/DBDish (3 files):
19:36 dalek DBIish: $dbh and $sth objects implements 'dispose'
19:36 dalek DBIish:
19:36 dalek DBIish: The Connection and StatementHandle roles implements an informal
19:36 dalek DBIish: Disposable interface.
19:36 dalek joined #perl6
19:37 perlpilot m: https://gist.github.com/per​lpilot/742924b6e1f6ffc6d1d6
19:37 camelia rakudo-moar b243a9: OUTPUT«[[3] [3 3] [] [3]]␤「abcabccaabbc」␤ abc => 「abc」␤  bc => 「bc」␤   c => 「c」␤ abc => 「abcc」␤  bc => 「bcc」␤   c => 「c」␤   c => 「c」␤ abc => 「a」␤ abc => 「abbc」␤  bc => 「bbc」␤   c => 「c」␤»
19:37 perlpilot Woodi: does that help?
19:37 perlpilot Woodi: I'm still not clear on exactly what you want.
19:37 * sortiz too much for dalek? ;-)
19:38 arnsholt sortiz: I think there's a rate-limiting bug. Occasionally gets triggered when many commits are pushed at once
19:40 sortiz arnsholt, That was the case, seven commits in a row, sorry.
19:40 RabidGravy poor dalek
19:41 perlpilot dalek is supposed to recognize many commits and aggregate the announcement.  I wonder what its threshold is for that
19:43 Woodi perlpilot: it does something very unexpected :)
19:44 sortiz RabidGravy, BTW, I'm developing DBDish::ODBC as a separated module and want to stay that way to test the common services in DBDish for driver developers.
19:44 RabidGravy good plan, I was thinking of doing an Informix driver like that TBH
19:47 sortiz The idea is that a driver only 'need DBDish' in its modules. (and NativeCall, if needed, in its DBDish::Foo::Native)
19:49 sufrostico joined #perl6
19:50 virtualsue joined #perl6
19:52 sortiz The drivers developer documentation will need a good expansion, btw.
19:53 arnsholt sortiz: Don't worry about it; not your fault =)
19:53 pmurias joined #perl6
19:54 arnsholt It's basically sign of having done solid stuff =)
19:58 colomon m: say “98989898889898989898090909093983830​2233848473393040383234234509484.3489​523478234723847238432423”.Rat.nude
19:58 camelia rakudo-moar b243a9: OUTPUT«(98989898889898989898090909​0939838302233848473393040383234234​5094843489523478234723847238432423 10000000000000000000000000000)␤»
19:59 colomon m: say (98989898889898989898090909093983830​2233848473393040383234234509484.3489​523478234723847238432423).Rat.nude;
19:59 camelia rakudo-moar b243a9: OUTPUT«(98989898889898989898090909​0939838302233848473393040383234234​5094843489523478234723847238432423 9999999999999999583119736832)␤»
19:59 colomon why are those two not the same?
20:00 sortiz MadcapJake`, Now pushed, you can see https://github.com/perl6/DBIish/blob/ma​ster/lib/DBDish/StatementHandle.pm6#L27, and if you add there 'note "Destroing";' you can see it working when running the tests.
20:00 lizmat hmmm.... so why is dalek still here and where is #p6dev ?
20:01 sufrostico joined #perl6
20:02 * colomon is afraid something is broken in Rat literals in rakudo.
20:02 Skarsnik gah my blog post is totally mess up with the font change <<
20:02 sortiz #p6dev !?!?
20:03 hoelzro maybe #p6dev should be in the channel subject for the next few days or something
20:03 hoelzro in case interested parties missed it earlier!
20:04 * sortiz I'm interested and missing that
20:04 FROGGS I dont get that:
20:04 FROGGS m: class A { submethod BUILD ($thing = 111) { say $thing } }; class B is A { method new($thing) { self.bless: $thing } }; B.new(42)
20:04 camelia rakudo-moar b243a9: OUTPUT«111␤»
20:04 FROGGS m: class A { submethod BUILD (:$thing = 111) { say $thing } }; class B is A { method new($thing) { self.bless: :$thing } }; B.new(42)
20:04 camelia rakudo-moar b243a9: OUTPUT«42␤»
20:05 FROGGS what dont both output 42?
20:05 MadcapJake` sortiz, I've implemented mine as you have but it doesn't appear to be working, how can I force perl6 to run DESTROY?
20:05 hoelzro FROGGS: I thought new only passed named parameters to BUILD?
20:05 Woodi MadcapJake`: force GC ?
20:05 MadcapJake` yeah
20:06 hoelzro MadcapJake`: what are you doing that you need to force DESTROY?
20:06 MadcapJake` well I'm just testing, but I'm confused that when I place a say statement in there it isn't being printed to stdout
20:06 Praise joined #perl6
20:07 Woodi MadcapJake`: if you use GC then you relay on it. an it frees and sestroys when it decides too.
20:08 MadcapJake` but it should necessarily be run no matter what, right?
20:08 FROGGS hoelzro: I was thinking that I kinda call BUILD directly when calling bless, but I probably dont
20:08 hoelzro MadcapJake`: not necessarily
20:08 Woodi MadcapJake`: I think not
20:08 MadcapJake` why?
20:08 hoelzro not unless --full-cleanup is used with moar
20:08 jnthn MadcapJake`: No, we don't promise to run DESTROY blocks at exit.
20:08 nine MadcapJake`: no, there's no guarantee that a DESTROY will ever run
20:08 yoleaux 14 Mar 2016 22:35Z <jnthn> nine: OK, maybe if that's going to land soonish I'll hold on :)
20:09 MadcapJake` ohh, why is that?
20:09 hoelzro FROGGS: oh duh, I didn't read closely enough and missed your impl of new =/
20:09 pierrot joined #perl6
20:10 Woodi MadcapJake`: and it is industry standard to have such cleenup with GC :)
20:10 hoelzro (this question/answer for DESTROY should probably be added to http://doc.perl6.org/language/faq)
20:10 MadcapJake` Woodi, I don't follow what you mean by that
20:10 Skarsnik That a really bad if we can't easily ensure some cleanup easily x)
20:10 cognominal joined #perl6
20:11 sortiz MadcapJake`, that why I use the pattern 'with $foo = Foo.new { LEAVE { $foo.dispose } ... }' when need a native object deallocated when not needed any more.
20:11 Woodi MadcapJake`: https://en.wikipedia.org/wiki/Finalizer  and related
20:11 cognominal joined #perl6
20:11 MadcapJake` Skarsnik, are you saying that you would prefer it to be guaranteed to run?
20:11 jnthn MadcapJake`: Because the GC's job isn't management of non-memory resources, and DESTROY is simply a callback when the GC can free an object's memory.
20:11 Skarsnik Yes x)
20:12 jnthn MadcapJake`: We don't conflate the two in Perl 6, like in many other languages.
20:12 Skarsnik Well it can have another name?
20:12 jnthn No
20:12 jnthn Too late.
20:12 jnthn (as in, many other languaes *also* don't conflate the two)
20:13 buharin joined #perl6
20:13 MadcapJake` jnthn, ok so you're saying that DESTROY is just a "hook" so to speak? is it because I'm using nativecall and the resources aren't managed by P6 that DESTROY isn't run?
20:14 jnthn MadcapJake`: I'm saying that it's just not meant to be a hook for freeing unmanaged resources, because you can't rely on when it will be run.
20:14 jnthn MadcapJake`: And so far not making it reliably run at exit is doing a good job of catching people mis-using it for that :)
20:14 MadcapJake` so to use it with unamanaged resources is impropr?
20:14 jnthn Yes
20:14 MadcapJake` ahhh i see
20:15 jnthn We provide LEAVE (do stuff at scope exit) and END (do stuff at program exit) for predictable we-promise-to-run-it things
20:15 jnthn The thing is that GC is generational also
20:16 timotimo aye, as soon as something gets considered old, it'll take quite a bit longer for it to be considered for eviction
20:16 jnthn So sure, in a small example you might find your objects get cleared up after a very short time
20:16 RabidGravy implementing phasers for variables would be helpful in this regard
20:16 jnthn But if the conditions are Just Right you could end up with things living for seconds or even minutes.
20:16 MadcapJake` jnthn, if I'm writing a module that uses nativecall, how can I add to LEAVE/END when a user uses my module?
20:16 Skarsnik What are the way to handle clean up stuff without doing it manually? Because it feel like you need to have array or something to keep track of stuff to close/unlock/send quit msg and do it at END?
20:18 jnthn Well, that we really need is something like C#'s using, and a standard role that you implement. I think somebody was exploring this in module space recently...
20:18 jnthn But for now it's like with file handles, taps on supplies, and so on; the expectation is the code using them will .close them
20:18 RabidGravy you can do a trick with an add_phaser on the calling block I guess
20:18 sortiz Yep, the the idea of my (now informal) Disposable role.
20:19 jnthn sortiz: Ah, it was you :)
20:19 timotimo Skarsnik: help, i can't install gptrixie
20:19 Skarsnik Because it's handy to have something that say "I am done with this object" so you can do clean up
20:19 timotimo "Could not find GPT::FileGenerator in: [...]"
20:19 Skarsnik timotimo, damn why?
20:19 Skarsnik Oh
20:19 sortiz On time, with macros I can add 'using Foo.Allocate() {  ..... }' and add the needed LEAVE { } inside.
20:20 jnthn sortiz: Ideally we'll add something to Perl 6 for this because people keep on asking :)
20:20 Skarsnik should be fixed
20:21 Skarsnik I forget to add the file to META
20:21 MadcapJake` is there a way to add to LEAVE/END programmatically?
20:21 timotimo Skarsnik: also, i don't see how to get gccxml on my fedora 23
20:22 timotimo oh, "castxml"
20:22 timotimo i can install that, but your readme says that's bad
20:22 MadcapJake` timotimo, don't
20:22 MadcapJake` check if you have gccxml.real
20:22 timotimo there's also no gccxml.real
20:22 Skarsnik there is for 22, weird
20:22 zakharyas joined #perl6
20:22 jnthn MadcapJake`: Well, ENDs are global so it doesn't matter really what does the END
20:23 timotimo well, my system is on 5.3.1
20:23 timotimo gcc, that is
20:23 jnthn MadcapJake`: For LEAVE, no, not yet.
20:23 timotimo your readme says i'd need 4.9
20:23 cdg joined #perl6
20:23 MadcapJake` jnthn, so if i add an END to my module, and someone uses it, will the END get run?
20:23 sortiz MadcapJake`, Yes, but now is complicated, you need mangling the QAST, with macros should be easy.
20:23 jnthn MadcapJake`: ye
20:23 jnthn *yes
20:24 Woodi MadcapJake`: what id process gets kill -9 signal ?
20:24 skids MadCapJake`: https://github.com/skids/perl6-Control-Ba​il/blob/master/lib/Control/Bail.pm6#L107 if you care to go down to QAST.
20:24 MadcapJake` Woodi, no idea
20:24 timotimo Skarsnik: maybe you can generate the binding for https://github.com/grimfang4/sdl-gpu/ for me; probably just include/SDL_gpu.h
20:24 MadcapJake` jnthn, great! The C library I'm wrapping is a one go kind of thing and offers a clean function if you intend to parse something else, so I think using an END phaser makes sense
20:25 Skarsnik timotimo, maybe try with cast? It seem the last git version handle c99-c11
20:25 MadcapJake` Skarsnik, cool!
20:25 MadcapJake` according to fedoraproject.org, gccxml is now obsolete as of f23 so it probably won't get packaged anymore
20:26 timotimo Installing  : castxml-0.1-0.10.20160125gitfc71eb9.fc23.x86_64                                                    1/1
20:26 Skarsnik Yes, the cast/gccxml business is annoying
20:26 FROGGS damnit, I have a case here where submethod BUILD is called twice... strange
20:26 Skarsnik I did not manage to compile the git version of cast
20:26 timotimo can i tell gptrixie to use "castxml"?
20:27 Skarsnik I mean I never managed to compile a project based on clang/llvm libs xD
20:27 Skarsnik GPT_GCCXML=castxml
20:27 timotimo ah, i see
20:27 Skarsnik I just added that today
20:27 timotimo lovely
20:27 timotimo error: unknown argument: '-fxml=plop.xml'
20:27 timotimo *sigh*
20:27 timotimo that's not how you castxml :)
20:28 Skarsnik need to patch gptrixie x)
20:28 domidumont joined #perl6
20:29 MadcapJake` Skarsnik++ # GPT_GCCXML
20:29 Woodi could someone add some API to grammars, pleas ?
20:29 MadcapJake` Woodi, what do you mean?
20:30 Woodi MadcapJake`: something...
20:30 MadcapJake` o_O
20:30 FROGGS Woodi: what are you talking about?
20:30 Woodi momento
20:31 * lizmat clickbaits https://p6weekly.wordpress.com/2​016/03/14/2016-11-js-fueling-up/
20:32 Woodi could someone add some API to grammars, pleas ?https://gist.github.com/ano​nymous/e0befbf2f05fd84e1c5b
20:32 chienjo joined #perl6
20:33 FROGGS Woodi: could you please try to explain the problem you experience?
20:35 kaare_ joined #perl6
20:35 virtualsue joined #perl6
20:36 Woodi FROGGS: I just want to work with parts catched by tokens but whatever i put into action methods is a) ignored  or b) overrided somehow
20:36 AlexDaniel joined #perl6
20:36 Woodi I think make $<abc>  overrides $<bc>...
20:36 MadcapMobile joined #perl6
20:37 Skarsnik timotimo, it use sdl or sdl2?
20:37 timotimo it can do both, i'd like the one for sdl2, but i don't know how to ensure that's the one it uses
20:39 kaare__ joined #perl6
20:39 Skarsnik why it install me libudev with libsdl2 x)
20:40 RabidGravy is there a special incantation to make internal links in to an "anchor" in POD or is just L<Whatever|#Whatever> ?
20:40 timotimo Skarsnik: that's just suggested dependencies, i expect
20:40 RabidGravy and just hope that whatever generator DTRT
20:40 FROGGS Woodi: do you expect that the letters a and b show up in the output?
20:41 sortiz FROGGS, why you choose 'my str $s' when there are other '$s' in scope? Can that be related to your Heisenbug?
20:41 Woodi FROGGS: yes
20:41 FROGGS sortiz: I did not choose that, that was already there
20:42 FROGGS Woodi: but you dont capture these matches in e.g. BuuAbc1
20:42 Skarsnik -I /usr/include/SDL2/ to make it use sdl2 x)
20:43 sortiz FROGGS, Oops, sorry, I'm reading the code and found that, seems 'unusual' at least :-)
20:43 timotimo a guess that makes sense
20:43 FROGGS Woodi: it "makes" what c had matches, then in bc it makes what c had produces via make (a list of c's), and then in abc it makes what bc had produced (a list of lists of c's)
20:44 Skarsnik I should have a cache or something -Functions: 1328
20:44 Skarsnik and it take a minute to parse the xml file x)
20:44 FROGGS sortiz: aye, but should not be a problem
20:44 Woodi FROGGS: hmm, eg. <abc> is [ 'a' <bc> ] so $<abc> should have it, IMO
20:44 FROGGS Woodi: $/ in method abc will also have the a, yes
20:46 pmurias joined #perl6
20:47 FROGGS m: https://gist.github.com/FR​OGGS/8c9556cf97fb301f8f84
20:47 camelia rakudo-moar ba5270: OUTPUT«TOP => [a => [b => [c]] a => [b => [c c]] a => [b b => [c c]] a => [] a => [b => []] a => [b => [c]]]␤»
20:47 FROGGS Woodi: are you looking for that?
20:47 kaare__ joined #perl6
20:51 Woodi FROGGS: actually I want to have default say $r[.ast]?  "view" with 'c' changed into '3'.  just want to know how to operate on parts.
20:52 Skarsnik timotimo, did you get my dcc?
20:52 FROGGS Woodi: sorry, I dont understand
20:52 timotimo i just tried to accept it
20:52 timotimo then it immediately said failed
20:53 timotimo 225 bytes really isn't very much
20:53 timotimo what went wrong?
20:53 Skarsnik timotimo, http://www.nyo.fr/~skarsnik/sdlgpu.txt
20:54 timotimo that's significantly more than 225 bytes
20:54 Skarsnik hm the uint32_t are standard?
20:55 timotimo yeah, why wouldn't they be?
20:55 cognominal joined #perl6
20:55 timotimo have you considered taking comments in doxygen style and turning them into pod attached thingies?
20:56 Skarsnik I will need to use doxygen for that
20:56 Skarsnik They get catched because I go backward to find like a empty line or a ; to find the function definition (I only have the end line)
20:58 timotimo oh
20:59 Woodi m: https://gist.github.com/ano​nymous/3a768052cdfd807e6d00
20:59 camelia rakudo-moar 93d597: OUTPUT«「abcabccabbccaababc」␤ abc => 「abc」␤  bc => 「bc」␤   c => 「c」␤ abc => 「abcc」␤  bc => 「bcc」␤   c => 「c」␤   c => 「c」␤ abc => 「abbcc」␤  bc => 「bbcc」␤   c => 「c」␤   c => 「c」␤ abc => 「a」…»
20:59 kaare__ joined #perl6
20:59 timotimo Skarsnik: what are these things in the "Extras stuff" section?
21:00 timotimo does that even compile?
21:00 Skarsnik my priority is also writing a libxml2 binding or something to not have to wait a minute at each run
21:00 Woodi FROGGS: this is just what parse do without actions. how change 'c' into '3' in that output ?
21:00 Skarsnik It's supposed to be typedef
21:01 Skarsnik like if you have a typedef int myintbecause; it generate a constant myintbecause = int32;
21:02 timotimo in this case i'll just have to throw that section out?
21:02 sufrostico joined #perl6
21:02 Skarsnik It does not work very well when taking a file that include a lot of other stuff
21:03 n1cky joined #perl6
21:07 FROGGS Woodi: "make 3" in the c method
21:07 dalek ecosystem: c2e3774 | RabidGravy++ | META.list:
21:07 dalek ecosystem: Add Audio::PortAudio
21:07 dalek ecosystem:
21:07 dalek ecosystem: See https://github.com/jonathanstowe/Audio-PortAudio
21:07 dalek ecosystem: Kudos to psch++ for starting it :)
21:07 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/c2e377494d
21:07 kaare__ joined #perl6
21:07 RabidGravy There
21:07 Skarsnik timotimo, you can probably delete them. I will have a look tomorrow of what I can do to improve the case of single file that need lot of other stuff
21:07 Woodi FROGGS: it don't change anytching for me...
21:08 Woodi FROGGS: but Match is ro ?
21:10 FROGGS m: https://gist.github.com/FR​OGGS/8c9556cf97fb301f8f84
21:10 camelia rakudo-moar 93d597: OUTPUT«TOP => [a => [b => [3]] a => [b => [3 3]] a => [b b => [3 3]] a => [] a => [b => []] a => [b => [3]]]␤»
21:11 FROGGS Woodi: why dont you edit the gist I showed you?
21:12 Woodi I can ? :)
21:12 FROGGS well, you can at least improve on that code, so we are talking about the same :o)
21:13 Skarsnik timotimo, if you want to have fun http://www.nyo.fr/~skarsnik/sdluniverse.txt (everything the header imply)
21:14 Woodi FROGGS: ah, you made a and b into ()...
21:14 timotimo i wonder how long perl6 takes to parse that :D
21:16 kaare__ joined #perl6
21:16 timotimo ------> enum ._27⏏ is export (
21:16 timotimo starts out super well :)
21:17 Skarsnik must be an anonymous enum x)
21:17 timotimo yeah, multiple of those
21:17 FROGGS Woodi: yes, and I put these captures into what the action methods make
21:19 Skarsnik hm, I should auto exclude ctypes.h probably
21:20 Skarsnik pthread or other stuff are autoexcluded
21:21 timotimo Skarsnik: it doesn't do any ordering of things?
21:22 timotimo or automatic stubbing
21:22 Skarsnik it ordered on how it appear on the headers
21:22 zakharyas joined #perl6
21:24 Skarsnik but the file order is whatever gccxml does with the id. I think it 'should' avoid putting something that need something that came after
21:29 timotimo could you do a topological sort of the classes and output stubs where needed?
21:29 timotimo otherwise i'd have to go through and do it manually now :)
21:29 timotimo also, uint32_t wants to become uint32 actually
21:29 timotimo when i said "of course it's defined", i misunderstood you
21:32 bjz joined #perl6
21:32 Skarsnik I am not sure if it can happen. do you have an example in this?
21:35 Skarsnik Oh right sdl_surface need a sdl_rect
21:36 yqt joined #perl6
21:37 timotimo i've had to stub two things so far
21:37 timotimo GPU_Renderer and GPU_Target
21:37 timotimo (i'm not using the universe version)
21:38 kid51 joined #perl6
21:39 timotimo SDL_BlitMap seems to be an empty struct
21:39 ely-se joined #perl6
21:40 timotimo SDL_RWops is really a tiny bit b0rked :)
21:40 timotimo we need some better "name mangling" to make all of this work
21:41 timotimo i have a thing that compiled successfully!
21:41 timotimo i have no clue if it'll work, but it does exist now :)
21:41 kanishka joined #perl6
21:43 Skarsnik I use gccxml generated name for anonymous stuff x)
21:44 dalek rakudo-star-daily: a421619 | coke++ | log/ (8 files):
21:44 dalek rakudo-star-daily: today (automated commit)
21:44 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/a4216195df
21:44 Skarsnik well the mangled name
21:44 Skarsnik anonymous enum are annoying :'
21:45 timotimo yeah, well, if they have dots in their name ... :)
21:45 Skarsnik anonymous struct have a name attribute empty, so I know they are anonymous
21:45 Skarsnik anonymous enum have a name x)
21:51 virtualsue joined #perl6
21:54 bjz joined #perl6
21:55 timotimo fish: “perl6 -Ilib example.p6” terminated by signal SIGSEGV (Address boundary error)
21:55 timotimo so close now :)
21:58 timotimo just trying to print the $screen (an GPU_Target) got me into a segfault when trying to output one of its attributes
21:58 timotimo not printing it gives me a main loop that draws the black screen over and over :)
21:58 timotimo Skarsnik: GPT is well done! :)
21:58 timotimo can we has something to get #define in place?
21:58 timotimo there's a GPU_DEFAULT_INIT_FLAGS defined to be 0
21:58 timotimo that could show up in the binding, too, imo
22:01 timotimo i'll just go ahead and push the current state up to github and see where it leads me
22:01 Skarsnik https://gist.github.com/Ska​rsnik/155f3c8062054075d4b0
22:01 zakharyas joined #perl6
22:02 timotimo you shouldn't be using | there
22:02 timotimo you need +|
22:03 Skarsnik This part is 'dumb' it's not a c preprocessor. I manually found #define starting_pattern* xxxx
22:04 timotimo oh, haha
22:04 timotimo well, you could have committed the code, too :)
22:04 Skarsnik I just run it with --define-enum=MYGPU:GPU_
22:05 MadcapJake` what does it mean for a C parameter to be "out"?
22:05 Skarsnik be out?
22:05 RabidGravy isn't that a C++ thing
22:05 MadcapJake` the C doc says «@param[out] status of this operation»
22:06 MadcapJake` it's only in the docs
22:07 RabidGravy what is the actual parameter signature? I'd guess that it's something that is only used as an "rw" parameter, typically a pointer that will be set by the function
22:07 Skarsnik @param[out] look like a doxygen stuff
22:07 RabidGravy yeah
22:08 MadcapJake` https://github.com/lexborisov/myhtml/blo​b/master/include/myhtml/api.h#L886-L895
22:08 Skarsnik it's the name of the parameter x)
22:09 Skarsnik It's probably to tell you the function will have this parameter becaming an output
22:10 Skarsnik I should translate to : myhtml_status_t $status is rw;
22:10 MadcapJake` ah so it's *where* the status will get stored?
22:11 Skarsnik Yes
22:14 RabidGravy oh, yeah it's a pointer so the function can alter the value
22:17 Skarsnik with this type of lib you probably want to call myhtml_parse and visit the given tree based on how the structure are defined
22:19 timotimo Skarsnik: next up we need a binding for OpenGL with gptrixie :)
22:21 Skarsnik I need a libxml2 binding to speed us the parsing x)
22:22 Skarsnik I tried libminixml but this lib is buggy
22:22 Skarsnik I did not even managed to have a working thing in C xD
22:29 arnsholt MadcapJake`: Presumably, an out parameter is a pointer that's written to by the library to pass out the result of the operation
22:34 Relsak joined #perl6
22:39 sufrostico joined #perl6
22:39 timotimo Skarsnik: how would i handle things like "i know this pointer to uint16 is meant to be translated as "uint16 $foo is rw" rather than a Pointer[uint16]"
22:40 timotimo i know gpt takes a config file, but i'm not sure if it allows overrides like that
22:40 Skarsnik https://github.com/Skarsnik/gptrixie/issues/3 :)
22:43 timotimo i hope the title means more to you than it does to anybody
22:43 timotimo because sometimes you want Pointer[*] instead
22:46 Skarsnik It's only for fundamental type
22:46 timotimo yeah, but still
22:46 timotimo this library sometimes has "float *matrix"
22:46 timotimo for example
22:47 Skarsnik hm
22:47 Skarsnik It's not even a typedef?
22:47 timotimo correct
22:48 timotimo https://github.com/timo/SDL2_GPU/blob​/master/lib/SDL2/GPU/SDLGPU.pm6#L1940
22:48 Skarsnik typedef are ****
22:48 timotimo just one example
22:48 Skarsnik duh 404
22:48 timotimo ah, i renamed that
22:48 timotimo https://github.com/timo/SDL2_GPU/blo​b/master/lib/SDL2/GPU/Raw.pm6#L1940
22:49 timotimo i find it strange that the paths i see here start in /root
22:49 Skarsnik Ok, so it's not always a good idea
22:49 timotimo correct
22:50 Skarsnik I work in root in this vm, don't ask why
22:50 timotimo OK
22:51 timotimo it seems like there are exactly two functions where the Pointer is needed to be turned into an "is rw" instead
22:52 timotimo GetVirtualCoords and GetVirtualResolution
22:57 Skarsnik I need to figure how to be able to say that in the conf file like function->GetVirtualCoords->param<foo>:isrw;
22:59 justine joined #perl6
23:12 hc_ joined #perl6
23:21 RabidGravy Skarsnik, you have the wrong path to the FileGenerator.pm6 in the provides of the META.info for GPT
23:21 Skarsnik ><
23:21 Skarsnik I closed the vm
23:22 RabidGravy do it in the browser just needs /GPT adding to the line ;-)
23:28 masak 'night, #perl6
23:29 RabidGravy toodles masak
23:29 RabidGravy Skarsnik, I fixed it locally and installed, no need to worry until next time you're in there
23:31 jack_rabbit joined #perl6
23:32 Skarsnik Oh it's nice the online edit stuff ^^
23:37 RabidGravy yeah, not too shabby, I'm not sure I'd want to write a whole program with it but it can get you out of problems
23:38 Skarsnik Yeah to fix a typo it's nice
23:46 Juerd m: sub infix:<except>(@list, $exception) { @list.grep: * !~~ $exception }; say ^10 except 5; say <foo bar baz quux> except 'bar'; say ^24 except /^1/;
23:46 camelia rakudo-moar 8cbb1e: OUTPUT«(0 1 2 3 4 6 7 8 9)␤(foo baz quux)␤(0 2 3 4 5 6 7 8 9 20 21 22 23)␤»
23:56 [particle] left #perl6
23:57 coreyperry joined #perl6

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

Perl 6 | Reference Documentation | Rakudo