[00:01] Yeah, but then you got stuff like size_t, which is its return value. Or "const struct tm *tm" and I don't even know what that struct looks like or how will calling my sub from Perl 6 will look like :P [00:01] I'm gonna first learn how to call strftime in pure C [00:02] *** zakharyas left [00:02] * ZoffixWin found struct tm http://www.tutorialspoint.com/c_standard_library/c_function_strftime.htm [00:04] so is there no easy way to extend core types like Str/Hash/Num if I just want a subtype with an extra method (or just a different type name)? [00:06] well... there's augment, but that modifies the core type throughout your entire program: http://perl6.party/post/20160427-Perl-6-Extra-Typical-Perl-6#herebedragons [00:07] yeah, that's a bit much [00:08] I thought that only modules which 'use'd your code would see the augmented core type. [00:08] BenGoldberg, nope [00:09] m: my $s = 'foobar' but role { method to-large-letters { self.uc } }; say $s.to-large-letters [00:09] rakudo-moar ac36d2: OUTPUT«FOOBAR␤» [00:09] literal, ^ there's also that [00:09] (also in that article) [00:09] the main thing is that I want a different type name [00:10] m: my $s = 'foobar' but role { method to-large-letters { self.uc } }; say $s.WHAT [00:10] rakudo-moar ac36d2: OUTPUT«(Str+{})␤» [00:10] it can just be a Str/Num/Hash in all other respects, to start with [00:10] literal, what are you trying to accomplish? [00:11] An object with a role mixed into it will have a different type name, as you can see above. "Str+{}" is the type in this example. [00:11] *** RabidGravy left [00:12] just trying to port some P5 code example of an interpreter to P6, where in P5 they'd made e.g. a String type by blessing a string, and I wanted a similar no-fuss solution [00:13] I suppose I can just use the native types, but that's not as nice if I need to add methods to them later [00:14] http://mrsharpoblunto.github.io/foswig.js/ [00:14] BenGoldberg: yes, but that's not easy to match against [00:14] AlexDaniel, "restrollo" [00:14] ZoffixWin: “crapup” [00:14] when MyStringType { ... } [00:15] m: class Str2 { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; my $str = Str2("aaa"); say $str.WHAT; say $str; say $str.perl; say $str.foo [00:15] rakudo-moar ac36d2: OUTPUT«(Str2)␤Str2.new(str => "aaa")␤Str2.new(str => "aaa")␤42␤» [00:16] m: class Str2 is Str { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; my $str = Str2("aaa"); say $str.WHAT; say $str; say $str.perl; say $str.foo [00:16] rakudo-moar ac36d2: OUTPUT«(Str2)␤␤""␤42␤» [00:16] ugexe: doesn't actually function as a string though :P [00:16] : class Str2 { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; Str2("abc").substr(1, 1).say; [00:16] He just forgot is Str [00:16] m: class Str2 is Stringy { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; Str2("abc").substr(1, 1).say; [00:16] rakudo-moar ac36d2: OUTPUT«b␤» [00:17] Oh, never mind [00:18] add a method Str { $.str} and method Stringy { $.str} [00:19] in the Ruby example the author just used native types and monkey-patched additional methods on those, I was hoping Perl 6 could do it more elegantly :P [00:21] * grondilu did not know about 'handles *' [00:24] *** jjido joined [00:25] you can get most of the way there, but it stores the string inside a private $!value [00:26] m: class Str2 is Str does Stringy { method CALL-ME($str) { self.new(value => $str) }; method foo { 42 }; }; my $str2 = Str2("xxx"); say $str2.foo; say $str2 ~~ Str; say $str2 [00:26] rakudo-moar ac36d2: OUTPUT«42␤True␤xxx␤» [00:28] https://github.com/supernovus/perl6-datetime-format btw [00:28] nice. Also, looks like "does Stringy" is not needed there [00:28] does Stringy allows ~$var to work [00:28] I see [00:28] how come CALL-ME isn't inherited? [00:28] *** jjido left [00:29] it's not inherited or it's just not invoked when you call an instance of the derived class? [00:29] i think Str("xxx") is really a coercer, not a CALL-ME [00:30] timotimo: results in "Cannot find method 'Str2'" if it's not specified [00:30] *** BenGoldberg left [00:30] wait, how are you trying to invoke that? [00:30] see ugexe's last code paste [00:31] m: my $str = Str("xxx"); say $str [00:31] rakudo-moar ac36d2: OUTPUT«xxx␤» [00:31] Str(123) does call Str [00:31] as in, it invokes the type object [00:31] *** BenGoldberg joined [00:32] also, why is "does Stringy" needed if Str does Stringy? [00:33] i don't think it should be needed [00:34] *** BenGoldberg left [00:37] timotimo, thanks. Not sure what I was searching that I missed it :S [00:41] *** BenGoldberg joined [00:45] :) [00:47] *** telex left [00:48] *** telex joined [00:48] *** Ben_Goldberg joined [00:48] *** BenGoldberg left [00:50] *** Ben_Goldberg is now known as BenGoldberg [00:51] m: require Test <&is>; say is 2, 2; try { EVAL "ok"; CATCH { default { say "caught" }}} [00:51] rakudo-moar ac36d2: OUTPUT«ok 1 - ␤True␤caught␤» [00:51] is there a way to make that compile-time require? [00:52] what, like need? [00:52] * ZoffixWin thinks a BEGIN, but does that play nice with precomp, and is there no easier way to ask for specific symbols [00:52] timotimo, it doesn't take symbols [00:52] m: need Test <&is>; [00:52] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/D3nrCcD1oF␤Confused␤at /tmp/D3nrCcD1oF:1␤------> 3need Test7⏏5 <&is>;␤» [00:52] And use only takes tags :S [00:57] m: BEGIN require Test <&is>; say is 2, 2; try { EVAL "ok"; CATCH { default { say "caught" }}} [00:57] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Cwc0zOAlTX␤An exception occurred while evaluating a BEGIN␤at /tmp/Cwc0zOAlTX:1␤Exception details:␤ 5===SORRY!5=== Error while compiling ␤ Lexical with name '&is' does not exist in this frame␤ …» [00:57] m: BEGIN { require Test <&is> }; say is 2, 2; try { EVAL "ok"; CATCH { default { say "caught" }}} [00:57] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kpQN4eZC69␤Undeclared routine:␤ is used at line 1␤␤» [00:57] *** lostinfog left [00:58] m: need Test; say Test::is( 2, 2 ); try { EVAL "ok"; CATCH { default { say "caught" }}} [00:58] rakudo-moar ac36d2: OUTPUT«Could not find symbol '&is'␤ in block at /tmp/2qa4j_XN7W line 1␤␤Actually thrown at:␤ in block at /tmp/2qa4j_XN7W line 1␤␤» [00:58] * ZoffixWin flips desk [00:59] m: need Test; [00:59] rakudo-moar ac36d2: ( no output ) [01:01] ZoffixWin: right, need will only grab the module into your namespace, you'd have to import the symbols to have them as lexicals [01:01] so like $Foobar := Test::EXPORT::DEFAULT::is or whatever [01:03] bedtime [01:03] m: need Test; my &is = &Test::EXPORT::DEFAULT::is; is 2, 2; try { EVAL "ok 42"; CATCH { default { say "caught" }}} [01:03] rakudo-moar ac36d2: OUTPUT«ok 1 - ␤caught␤» [01:03] That's LTA, but better than nothing. timotimo++ [01:03] *** hotel|out is now known as hotel [01:04] *** colomon left [01:05] :=? [01:05] heh that looks funny [01:06] *** BenGoldberg left [01:07] *** colomon joined [01:08] *** BenGoldberg joined [01:10] *** BenGoldberg left [01:12] *** BenGoldberg joined [01:12] can someone explain promises to me? [01:12] RFC for easier compile type specific symbol import: https://rt.perl.org/Ticket/Display.html?id=128090 [01:13] hotel, try this [slightly dated] slideshow: http://jnthn.net/papers/2015-yapcasia-concurrency.pdf [01:13] thanks [01:14] a simple way to think of it is as a mechanism to chain `start { }`s together [01:19] * hotel needs to brush up on the idea of concurrency altogether [01:20] s/concurrency/asynchrony/ [01:22] m: await ^4 .map: { start sleep 1 }; say now - INIT now [01:22] rakudo-moar ac36d2: OUTPUT«1.00427241␤» [01:25] *** jjido joined [01:25] *** maybekoo2 left [01:26] .ask ufobat is there no way at all to do async stuff with Bailador? Some of my requests can take up to 20 seconds and I looked through the code and see no user-space way to do async [01:26] ZoffixWin: I'll pass your message to ufobat. [01:26] *** jjido left [01:26] *** jjido joined [01:30] standards: use taps or use react blocks? [01:30] ZoffixWin: (re RT #128090) S11 already says how to do compile-time import of symbols [01:30] Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=128090 [01:31] http://design.perl6.org/S11.html#Compile-time_Importation [01:31] *** jjido left [01:31] Is that not what you are looking for? [01:38] how do you set something equal to a promise? I get that it's a type, but what does it actually mean to set something equal to one? [01:40] pmichaud, unsure. It seems to require *author* of the module to do "extra things" instead of just using `is export`: [01:40] m: use Test <&is>; say is 2, 2 [01:40] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zm89zGOGgu␤Error while importing from 'Test':␤no EXPORT sub, but you provided positional argument in the 'use' statement␤at /tmp/zm89zGOGgu:1␤------> 3use Test <&is>7⏏5; say is 2, 2␤» [01:41] pmichaud, so it's out of my control. And I don't know if it's maybe just something that needs to be added to `is export` implementation [01:42] *** kid51 left [01:44] any takers? 3; [01:44] *** cpage_ joined [01:46] *** pierre_ joined [01:48] hotel, what do you mean 'set equal to'? [01:48] yeah I'm not really sure [01:48] ... [01:49] https://github.com/zostay/P6SGI#201-the-environment ==> p6w.ready [01:49] hotel, it takes a Promise object. You can get a promise with `start {...}` among other things [01:51] guess I set that later then [01:53] on another note, just watched what was probably the saddest scene in all of 24 [01:58] m: my constant CRLF = "dummy"; say "hi $CRLF"; [01:58] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kiN9shpLiK␤Variable '$CRLF' is not declared. Did you mean 'CRLF'?␤at /tmp/kiN9shpLiK:1␤------> 3my constant CRLF = "dummy"; say "hi 7⏏5$CRLF";␤» [01:58] m: my constant CRLF = "dummy"; say "hi CRLF"; [01:58] rakudo-moar ac36d2: OUTPUT«hi CRLF␤» [01:58] ZoffixWin: yeah, I think it's just a NYI bug. [01:58] m: sub foo (Promise:D $p) { say 'About to sit and wait for a Promise to complete'; await $p; say 'Done waiting ' ~ now - INIT now }; foo start sleep 1 [01:58] rakudo-moar ac36d2: OUTPUT«About to sit and wait for a Promise to complete␤Done waiting 1.0042692␤» [01:58] {CRLF} [01:59] ZoffixWin: oh, I see what you mean. [01:59] *** mr-foobar left [02:00] m: use Test; sub ok {} [02:00] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kJXCexGsFZ␤Redeclaration of routine ok␤at /tmp/kJXCexGsFZ:1␤------> 3use Test; sub ok {}7⏏5␤» [02:00] *** mr-foobar joined [02:00] Basically, I don't want a module update to introduce an error like this ^ into my code and then rake through a dozen of `use`d modules to find which one imported it [02:01] *** johnjohn101 joined [02:01] hi perl6 [02:01] *** molaf left [02:01] (a module update where Joe Smith implements a new sub in their FooBarBer module that I use) [02:03] Then I suspect the "use Test" ought to be more explicit about what is to be imported. [02:03] And yes, that looks like a NYI bug to me. [02:03] use Test <&is>; should import only &is and nothing else. [02:03] *** Khisanth left [02:05] *** pierre_ left [02:12] *** BenGoldberg left [02:13] *** BenGoldberg joined [02:14] *** molaf joined [02:15] *** noganex joined [02:16] *** Khisanth joined [02:18] *** noganex_ left [02:22] *** colomon left [02:25] *** colomon joined [02:27] *** jjido joined [02:32] *** jjido left [02:32] *** mr-foobar left [02:33] *** mr-foobar joined [02:42] m: say Instant.new: 0 [02:42] rakudo-moar ac36d2: OUTPUT«Cannot make a Instant object using .new␤ in block at /tmp/9wfHQmdrfA line 1␤␤» [02:42] .oO( why the hell not... ) [02:42] m: say now - now [02:42] rakudo-moar ac36d2: OUTPUT«-0.00159147␤» [02:43] *** colomon left [02:43] *** crucialrhyme joined [02:43] m: say DateTime.new(0).Instant [02:43] rakudo-moar ac36d2: OUTPUT«Instant:10␤» [02:43] .oO( 10?? ) [02:44] *** colomon joined [02:46] *** sufrostico left [02:49] ugexe++ [02:49] *** uruwi joined [02:50] can I initialise members of a class in the class body? [02:50] or does it have to be in BUILD [02:50] use defaults [02:50] m: class Foo { has $.bar = 42; }; say Foo.new.bar [02:50] rakudo-moar ac36d2: OUTPUT«42␤» [02:51] yeah but these aren't given to the class when instantiating it [02:51] or at least they're not supposed to be [02:51] oh [02:51] *** hotel is now known as hotel|chagrin [02:52] m: class Foo { has $!bar = 42; method bar { $!bar } }; say Foo.new(:72bar).bar [02:52] rakudo-moar ac36d2: OUTPUT«42␤» [02:53] yeah thanks [02:53] *** Actualeyes left [02:56] *** itcharlie joined [02:57] so what's the real difference between declaring variables with my/has in a class? [02:58] *** crucialrhyme left [02:59] doc: b2f5a76 | (Zoffix Znet)++ | doc/Type/IO/Path.pod: [02:59] doc: Toss non-more-readable "more readable" portion [02:59] doc: review: https://github.com/perl6/doc/commit/b2f5a76ec6 [02:59] hotel|chagrin, my will create a class variable, has an instance attribute [03:00] but what's the functional difference? [03:00] * ZoffixWin is typing an example [03:00] thanks [03:00] class variable should be shared between all instances [03:00] so it's static [03:00] in C++ parlance, es [03:01] yes [03:01] ah [03:01] that makes sense [03:01] m: class Foo { my $.class = 'Original'; has $.instance = 'Original' }; my $first = Foo.new; my $second = Foo.new; $first.class = 'Modded'; $first.instance = 'Also modded'; say [ $first.class, $first.instance, $second.class, $second.instance ] [03:01] rakudo-moar ac36d2: OUTPUT«Cannot modify an immutable Str␤ in block at /tmp/A334GyShlU line 1␤␤» [03:01] m: class Foo { my $.class = 'Original' is rw; has $.instance = 'Original' is rw }; my $first = Foo.new; my $second = Foo.new; $first.class = 'Modded'; $first.instance = 'Also modded'; say [ $first.class, $first.instance, $second.class, $second.instance ] [03:01] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qfDMh426yq␤Two terms in a row␤at /tmp/qfDMh426yq:1␤------> 3class Foo { my $.class = 'Original'7⏏5 is rw; has $.instance = 'Original' is r␤ expecting any of:␤ infix␤ infix sto…» [03:01] screw you then! [03:01] :P [03:01] lol [03:02] thanks to everyone for putting up with my learning [03:02] *** hotel|chagrin is now known as hotel [03:02] hotel|chagrin, well, the output would be [ 'Modded', 'Also modded', 'Modded', 'Original' ]; So the $.class that I modified on $first got modified in $second too, because it's a class variable [03:02] *** crucialrhyme joined [03:02] most of us old-time C-ers thought c++'s (and I think later java's) use of "static" for that was an abuse... [03:04] makes a mean singleton :P [03:04] (it's not actually an abuse, but old C types tend to think of lower level operations and it's not quite the same machine-level thing) [03:04] m: class Foo { my $.class = 'Original'; has $.instance is rw = 'Original' }; my $first = Foo.new; my $second = Foo.new; $first.class = 'Modded'; $first.instance = 'Also modded'; say [ $first.class, $first.instance, $second.class, $second.instance ] [03:04] rakudo-moar ac36d2: OUTPUT«[Modded Also modded Modded Original]␤» [03:05] (is rw goes before the default) [03:05] *** |2701 left [03:06] Curiously, the default accessor for the class var is rw, but isn't for attributes [03:06] m: class X { method !p { say 'p' }; method u { !p }; }; X.new.u [03:06] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7xmlgZ7tUR␤Undeclared routine:␤ p used at line 1␤␤» [03:06] m: class X { method !p { say 'p' }; method u { self!p }; }; X.new.u [03:06] rakudo-moar ac36d2: OUTPUT«p␤» [03:13] *** cdg joined [03:14] m: my %foo = foo => 'bar', meow => 'mer'; [03:14] rakudo-moar ac36d2: ( no output ) [03:14] m: constant %foo = foo => 'bar', meow => 'mer'; [03:14] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/z2fl0Om7G5␤Type check failed in constant declaration of %foo; expected Associative but got List (List)␤at /tmp/z2fl0Om7G5:1␤------> 3stant %foo = foo => 'bar', meow => 'mer'7⏏5;␤ expecting any …» [03:14] Bug? [03:15] Guess not [03:15] m: my foo = foo => 'bar', meow => 'mer'; [03:15] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qZfRTPr31D␤Malformed my (did you mean to declare a sigilless \foo or $foo?)␤at /tmp/qZfRTPr31D:1␤------> 3my foo7⏏5 = foo => 'bar', meow => 'mer';␤» [03:15] oops [03:15] m: my \foo = foo => 'bar', meow => 'mer'; [03:15] rakudo-moar ac36d2: ( no output ) [03:16] Oh. Well, binding := also doesn't work and I guess that's what `constant` is doing [03:18] m: my \foo = foo => 'bar', meow => 'mer'; say foo; [03:18] rakudo-moar ac36d2: OUTPUT«(foo => bar meow => mer)␤» [03:19] m: constant %foo = Hash.new( foo => 'bar', meow => 'mer' ); say %foo< meow > [03:19] rakudo-moar ac36d2: OUTPUT«(Any)␤» [03:19] m: constant %foo = Hash.new( foo => 'bar', meow => 'mer' ); say %foo [03:19] rakudo-moar ac36d2: OUTPUT«{}␤» [03:19] m: constant %foo = ( foo => 'bar', meow => 'mer' ).hash; say %foo [03:19] rakudo-moar ac36d2: OUTPUT«{foo => bar, meow => mer}␤» [03:19] m: constant %foo = ( foo => 'bar', meow => 'mer' ).hash; say %foo< meow > [03:19] rakudo-moar ac36d2: OUTPUT«mer␤» [03:25] m: constant %foo = %( foo => 'bar', meow => 'mer' ); say %foo< meow > [03:25] rakudo-moar ac36d2: OUTPUT«mer␤» [03:28] *** jjido joined [03:30] *** finanalyst joined [03:30] *** mr-foobar left [03:32] *** jjido left [03:34] m: my $a, my $b; $a, $b = split " ", "hello world" [03:34] rakudo-moar ac36d2: ( no output ) [03:35] m: my $a, my $b; $a, $b = split " ", "hello world"; say $a; say $b [03:35] rakudo-moar ac36d2: OUTPUT«(Any)␤(hello world)␤» [03:35] *** kurahaupo left [03:35] is there a concise way to assign elements of an output list to different variables? [03:36] m: my $a, my $b; ($a, $b) = split " ", "hello world"; say $a; say $b [03:36] rakudo-moar ac36d2: OUTPUT«hello␤world␤» [03:36] ah, the elusive parenthesis [03:36] *** pierre_ joined [03:39] *** pierre_ left [03:45] *** johnjohn101 left [03:46] (╯°□°)╯︵ ┻━┻ [03:47] Thus ends my 4-hour attempt to make my Bailador return 304s correctly. [03:47] *** cpage_ left [03:47] good work [03:47] The table flip indicates I failed :P [03:48] Or rather, I just found out I'd have to make a response from scratch too and I don't wanna [03:48] what's the deal with returning things from subs? [03:49] deal? [03:49] so far in all the pl6 things I've seen, I haven't seen any `return` keyword [03:51] * hotel finds out it exists [03:53] it's alwayts been a perl thing that the last value in a sub is what is returned [03:53] in fact the return keyword only came into existence in older perl relatively late (and had horrid performance for a long time) [03:54] oh, so it's not usually necessary? [03:54] correct [03:55] so here https://gist.github.com/HotelCalifornia/ff51508101d295f0ea52f79afc8bed69 [03:55] it'd be sufficient to just say `%env' as the last line [03:56] oh cool [03:56] thanks [03:56] if you go look at some of the stuff sent to camelia in this channel, you'd have noticed that being done a lot [03:57] e.g. `method foo { 42 }` earlier [03:57] *** Ben_Goldberg joined [03:57] *** BenGoldberg left [03:57] *** Ben_Goldberg is now known as BenGoldberg [04:06] yeah, I was wondering in terms of methods with more calculations in them [04:10] *** sortiz joined [04:10] \o #perl6 [04:24] what happens when you define a method with the & twigil? [04:25] m: my &talk = sub { say "hi" }; talk [04:25] rakudo-moar ac36d2: OUTPUT«hi␤» [04:25] oh sorry you meant a method [04:26] also jk [04:26] I misread it [04:26] I don't think it's possibl to define a method as variable. [04:27] it was a sub in the end [04:29] *** jjido joined [04:29] m: my &foo = method () { self.say }; "Hi".&foo; [04:29] rakudo-moar ac36d2: OUTPUT«Hi␤» [04:34] *** jjido left [04:35] if you use callsame from an anonymous function, does it call the other anonymous functions with the same symbol? [04:35] s/symbol/signature/ [04:36] ignore me [04:37] *** milwauke` left [04:39] hotel, a & sigiled variable can hold any Callable, and Method does Callable. [04:39] m: my $f = sub ($x) { $x <= 1 ? 1 : $x * callsame($x-1) }; say $f.(4); [04:39] rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/omOhBSW4hD␤Unsupported use of ? and : for the ternary conditional operator; in Perl 6 please use ?? and !!␤at /tmp/omOhBSW4hD:1␤------> 3my $f = sub ($x) { $x <= 1 ?7⏏5 1 : $x * callsame($x-1) }; say…» [04:39] m: my $f = sub ($x) { $x <= 1 ?? 1 !! $x * callsame($x-1) }; say $f.(4); [04:39] rakudo-moar ac36d2: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub at /tmp/QSAdNG5JqY line 1␤ in block at /tmp/QSAdNG5JqY line 1␤␤» [04:39] yeah yeah, I was misreading that [04:39] I thought it said `method &foo` [04:40] but it really said `my &foo = ...` [04:40] *** BenGoldberg left [04:40] *** itcharlie left [04:41] anyway, time for bed [04:41] night [04:41] *** hotel is now known as hotel|netteiru [04:42] *** kaare_ joined [04:56] *** Cabanossi left [04:58] *** Cabanossi joined [05:03] m: my $xxx = sub ($a) { $a < 5 ?? &?ROUTINE($a+1) !! $a; }; say $xxx.(1) [05:03] rakudo-moar ac36d2: OUTPUT«5␤» [05:03] *** AlexDaniel left [05:21] *** verzit left [05:29] *** jjido joined [05:29] *** cdg left [05:32] *** verzit joined [05:32] *** cdg_ joined [05:33] ZoffixWin, ping. [05:34] *** jjido left [05:37] *** cdg_ left [05:37] *** jack_rabbit joined [05:42] *** CIAvash joined [05:48] *** TreyHarris left [05:52] ecosystem: 54e7f0d | titsuki++ | META.list: [05:52] ecosystem: Add Term::Readsecret to ecosystem [05:52] ecosystem: [05:52] ecosystem: See https://github.com/titsuki/p6-Term-Readsecret [05:52] ecosystem: review: https://github.com/perl6/ecosystem/commit/54e7f0d76a [05:52] ecosystem: ecb5339 | titsuki++ | META.list: [05:52] ecosystem: Merge pull request #204 from titsuki/add-readsecret [05:52] ecosystem: [05:52] ecosystem: Add Term::Readsecret to ecosystem [05:52] ecosystem: review: https://github.com/perl6/ecosystem/commit/ecb5339293 [05:57] *** wamba joined [06:00] *** cdg joined [06:02] *** vendethiel- joined [06:03] *** vendethiel left [06:05] *** cdg left [06:23] *** wamba left [06:29] *** TreyHarris joined [06:48] Morning. Latest commit doesn't install http://nopaste.linux-dev.org/?1098673 any ideas? [06:50] *** hotel joined [06:51] *** skids left [06:51] *** hotel|netteiru left [07:03] *** mr-foobar joined [07:10] *** maybekoo2 joined [07:12] *** mr-foobar left [07:13] *** mr-foobar joined [07:14] *** yqt left [07:15] *** cpage_ joined [07:26] *** finanalyst left [07:36] *** cognominal left [07:45] *** molaf left [07:48] *** jjido joined [07:50] *** jjido_ joined [07:53] *** jjido left [07:54] *** domidumont joined [07:58] *** firstdayonthejob joined [07:59] *** domidumont left [08:00] *** domidumont joined [08:06] *** firstdayonthejob left [08:07] *** firstdayonthejob joined [08:07] *** jjido_ left [08:07] *** rindolf joined [08:08] *** jjido joined [08:15] *** darutoko joined [08:32] *** RabidGravy joined [08:41] *** domidumont left [08:41] *** domidumont joined [08:41] *** wamba joined [08:43] *** mr-foobar left [08:44] *** mr-foobar joined [08:46] *** domidumont left [08:48] good antenoon, #perl6 [08:49] bazzar: fwiw, I've been toying with the idea of parsing out a postgres schema lately. [08:50] *** TEttinger left [09:00] *** araujo left [09:10] *** darutoko left [09:10] masak, but isn't it just query some stuff from information_schema [09:15] RabidGravy: ooh -- that's probably a lot better than parsing out text. [09:15] I haven't thought about this deeply yet -- thanks for the nudge in the right direction! :D [09:15] a *lot* easier [09:16] I don't think there's any of DBIx::Class::Schema::Loader that do it by parsing a DDL specification [09:16] right :) [09:17] so, here's my idea so far: query out the relevant details of the schema, then make sure they match some local JSON or YAML condensed version of that schema. [09:17] after all it is one of Ted Codds requirements for a relational database that the metadata be stored in the same way that the metadata is [09:17] that way, I can have tests that confirm that the database schema is what I think it is. [09:18] er s/metadata/normal data/ [09:18] * masak .oO( Ted Codd requires that the tautology always be what the tautology is ) [09:18] :) [09:18] not enough coffee has got tomy fingers yet [09:18] further, I can use the same JSON-YAML file to statically check all the queries made against the database. [09:19] all this in order to assert that app and database evolve together nicely. [09:19] *** jjido left [09:19] also, I ought to be able to use the info in the JSON-YAML file if/when I want to mock the database. [09:22] I'm actually wondering if making a module to abstract the above for the DBs that DBIish supports will be a kick in the right direction to a proper full schema abstraction thingy [09:22] (hedging on whether that may be an ORM or something else) [09:23] I'm not actively against such plans :) [09:23] but I'm going to start by unabstractedly solving my own use cases [09:24] oh sure [09:30] *** darutoko joined [09:30] *** titsuki joined [09:32] In DBI there are a few methods for schema introspection (table_info, column_info, et. al.), something like that can be added to DBIish. [09:35] that's not a bad idea [09:35] I have a DBIish dependency anyway [09:35] oh, and I could look into what it'd take to provide a mocked database as a driver to DBIish [09:37] In fact there is DBDish::TestMock, just for that kind of stuff. [09:38] *** cpage_ left [09:41] oh wow [09:41] I should think out loud more often on this channel, clearly [09:41] *** cognominal joined [09:42] sortiz++ [09:43] um, though https://github.com/perl6/DBIish/blob/ca68436d952bef65ba8d6ffec6c14b85ec50e795/lib/DBDish/TestMock/StatementHandle.pm6 is probably not enough for my purposes... [09:43] I get bored for lack of open issues to be resolved in DBIish ;-) [09:43] duly noted [09:45] *** Ven joined [09:48] well, I could submit some issue about DBDish::TestMock being locked down to a particular schema... [09:49] but I'm not entirely sure yet what it is I want instead [09:49] I'm still unable to obtain a login from IBM to download the Informix client SDK so no DBDish::Informix this week [09:54] FreeTDS could fly if there is something I can test it against [09:55] RabidGravy, if you have Informix and its ODBC driver, may be that DBDish::ODBC already supports it. [09:56] would still have to download the client sdk to get the ODBC driver [09:56] :\ [09:56] :/ [09:56] plus the native driver is much more fun [09:57] Sure, say that to me ;-) [10:00] *** domidumont joined [10:02] *** mr-foobar left [10:05] *** kurahaupo joined [10:11] *** titsuki left [10:11] *** darutoko left [10:13] WAHAY! Finally managed to log in to the IBM site [10:14] awful, the company clearly knows nothing about computer software [10:14] *** maddingu1 is now known as maddingue [10:18] *** spider-mario joined [10:28] Morning again, [10:29] Latest commit doesn't install http://nopaste.linux-dev.org/?1098673 any ideas? [10:35] *** Ven left [10:36] when was the last time you updated? That change went in weeks ago iirc [10:37] *** mr-foobar joined [10:38] nadim, I suspect that the problem is that the install attempt to install first NativeCall before the new required NativeCall::Types, so use for precomp an old (preinstalled) NC::Types and fails. [10:39] yeah that's what it looks like [10:43] why would "git remote" show nothing when pull and push are clearly working? [10:47] weird [10:48] anyhow just twatted it and re-cloned [10:48] *** firstdayonthejob left [10:52] *** Ven joined [10:57] *** domidumont left [11:04] *** mr-foobar left [11:05] *** mr-foobar joined [11:06] *** nowan_ joined [11:07] *** CIAvash left [11:08] *** nowan left [11:12] *** jack_rabbit left [11:16] *** mr-foobar left [11:18] *** mr-foobar joined [11:24] *** kid51 joined [11:25] sortiz, pong [11:27] *** domidumont joined [11:28] What was it? [11:29] *** sunnavy_ left [11:29] *** sunnavy_ joined [11:31] *** milwauke` joined [11:35] *** Emeric joined [11:37] ZoffixWin o/ [11:37] \o [11:37] \o\o [11:38] I found this for you: https://gist.github.com/salortiz/051c7a81400522e30a7cf12377c02f70 [11:38] * moritz fights with a blank screen after apt-get upgrade and reboot :( [11:39] and the wiki interface on the old lapotp seems to be broken, with about 70% packet loss on an otherwise fine network [11:39] *wifi [11:40] press ctrl+alt+F1 to see the log messages from trying to start X? [11:41] *** domidumont left [11:42] sortiz, cool. Much different than the way I was going about it. [11:42] sortiz, you should submit it as a patch to http://modules.perl6.org/repo/POSIX [11:42] I went with this one at the end: https://github.com/supernovus/perl6-datetime-format#strftime-str-format-datetime-dt-lang [11:42] *** mr-foobar left [11:43] *** perlawhirl joined [11:43] Well, actually, I abandoned that part of the code altogether by now lol :P 4 wasted hours [11:44] Zoffix: The other thing about the module is that strptime is NYI [11:44] I noticed last night [11:45] * ZoffixWin is also weary of supernovus's modules on account of the author saying on multiple occasions they aren't that involved with P6 anymore. [11:47] they accept patches though [11:53] *** |2701 joined [11:55] afk& [12:13] *** jjido joined [12:14] *** Ven left [12:16] *** Relsak joined [12:18] Yey! Finally moved all my blog posts to http://perl6.party/ Didn't realize I had so many :o [12:18] m: say 14 / DateTime.today.week-number [12:18] rakudo-moar cf199c: OUTPUT«Method 'today' not found for invocant of class 'DateTime'␤ in block at /tmp/rAFUpbHH95 line 1␤␤» [12:18] m: say 14 / DateTime.new.today.week-number [12:18] rakudo-moar cf199c: OUTPUT«Cannot make a DateTime object using .new␤ in block at /tmp/17y1cH5Zso line 1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp line 3055␤ in block at /tmp/17y1cH5Zso line 1␤␤» [12:18] Well, that many per week lol :P [12:19] m: say 14 / DateTime.now.week-number [12:19] rakudo-moar cf199c: OUTPUT«0.777778␤» [12:19] And I forget who said they missed the dancing cats (Xliff_ ?), but I brought them back: http://perl6.party/about [12:21] *** aries_liuxueyang left [12:22] ZoffixWin, dancing cats! [12:24] I was a dancing cat fan [12:25] *** araujo joined [12:26] *** araujo left [12:26] *** araujo joined [12:26] *** araujo left [12:26] *** araujo joined [12:28] *** araujo left [12:28] *** araujo joined [12:28] *** araujo left [12:28] *** araujo joined [12:29] *** araujo left [12:29] *** aries_liuxueyang joined [12:36] *** vaisian_ joined [12:39] *** Ven joined [12:40] *** jjido left [12:43] *** aries_liuxueyang left [12:46] *** aries_liuxueyang joined [12:48] *** darutoko joined [12:48] *** darutoko left [12:54] *** aries_liuxueyang left [12:56] *** colomon left [12:56] there isn't anyway of capturing the application of a parameterised role is there? i.e. set an attribute without closing over the parameter in an accessor [12:59] * psch doesn't quite grasp the question [13:00] lizmat, with PackUnpack is there some way I'm missing of getting the byte length of an indivdual directive from the template (e.g. 'N' -> 4) ? [13:02] psch, say I have "role Foo[Str $foo] { has Str $.foo; }" and want $.foo to be the parameter, and of course as I started typing it I released that I can just use it as a default initializer [13:02] me-- [13:04] yay for rubber duck debugging \o/ [13:08] *** Ven left [13:09] *** finanalyst joined [13:10] *** Perl6IRC joined [13:11] *** Perl6IRC left [13:11] *** uruwi left [13:27] *** aries_liuxueyang joined [13:29] *** Actualeyes joined [13:30] *** mr-foobar joined [13:33] *** dogbert17 joined [13:36] *** Actualeyes left [13:40] *** wamba left [13:40] doc: 9d1a02e | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod: [13:40] doc: Documented the yyyy-mm-dd method [13:40] doc: review: https://github.com/perl6/doc/commit/9d1a02e308 [13:41] *** _4d47 joined [13:42] *** mr-foobar left [13:42] *** Ven joined [13:43] *** mr-foobar joined [13:47] *** cdg joined [13:55] *** mr-foobar left [13:56] *** Actualeyes joined [13:56] *** mr-foobar joined [13:59] *** Relsak left [14:00] *** mr-foobar left [14:01] *** mr-foobar joined [14:11] *** vaisian_ left [14:20] *** ufobat joined [14:20] ola! [14:20] 01:26Z ufobat: is there no way at all to do async stuff with Bailador? Some of my requests can take up to 20 seconds and I looked through the code and see no user-space way to do async [14:21] \o [14:22] *** TimToady left [14:22] ZoffixWin, :( no i am afraid not, according to my understanding you need to replay a supply as the content. but HTTP::Easy::PSGI is using the PSGI module [14:22] :( [14:22] and the PSGI module waits until it is done :( [14:22] but! [14:22] HTTP::Server::Tiny is different. [14:23] and thats why I did the get-psgi-app, so it can easily run on other PSGI servers [14:23] *** TimToady joined [14:24] but i am not sure if this can handle supplys [14:25] ZoffixWin, https://github.com/tokuhirom/p6-HTTP-Server-Tiny/pull/29/commits/8568bb2bcd6643e69a795c58580270da02f22cb3#diff-c0a58c1c98f8c011a1987d2167aa590dR445 [14:27] wouldn't that still block just the same, since .receive is blocking? [14:30] i dont know. i am too new to perl6. i haven't played with channels nor supplies. i assumed it would block just for the next "block" [14:30] *** colomon joined [14:30] https://github.com/tokuhirom/p6-HTTP-Server-Tiny/blob/master/lib/HTTP/Server/Tiny.pm6#L323 [14:31] this looks as if each block is sent as soon as possible [14:31] *** espadrine joined [14:32] right, but my very first block would arrive after 30 seconds. [14:33] I wonder if anyone tried seeing if things explode when you shove each request in its own start {}. [14:33] Then on the framework end, you'd just write blocking code and it won't matter. [14:34] thats why a psgi app is supposed to return a promise, the webserver should not block in those 30 sec, it should be able to run other requests [14:35] so isnt that exactly what you're suggesting? [14:36] ah! there is a webserver implementation from zostay called smack, which is his p6sgi reference implementation [14:36] *** _4d47 left [14:36] i had not time to look at it so far, but its on my list :) [14:36] *** Ven left [14:38] Not exactly. As a user of the framework, all I want to care about is my current request. I don't want to think whether I need to return a Promise or hunt down which route is slowing down my entire app. [14:38] https://github.com/zostay/Smack [14:38] m: start { } for ^1000; say now - INIT now [14:38] rakudo-moar cf199c: OUTPUT«Memory allocation failed; could not allocate 14840 bytes␤» [14:38] :/ [14:39] That runs in 0.17918281 [14:39] on my box. [14:40] the promise is part of the psgi spec, so you will(or must) return a promise anyway. [14:40] but yeah async stuff is on my todo list as well ;) but first i need a file upload. [14:41] looking forward for PR on the http/psgi servers to follow the spec, so bailador could run everywhere. [14:42] heh, that's a programmer-defined limitation. [14:42] And sri called that spec antiquated [14:44] the perl5 spec? [14:44] +psgi [14:45] i think zostay did a great job on making the p6sgi spec better :D [14:45] *** hotel_california joined [14:46] *** hotel left [14:46] ufobat, no, on zostay's P6SGI spec. While there seems to be a mismatch between the nicks he used in response, reading around the conversation indicates that he indeed was talking about the link muraiki addressed him with: http://irclog.perlgeek.de/perl6/2016-01-05#i_11834621 [14:47] I don't say we take everything sri says as mana, but he does have good amount of expertise and did point out the RoR example too. [14:49] *manna [14:51] a interesting discussion :D i think i read it from the beginning ,) [14:52] *** vaisian joined [14:54] *** hotel joined [14:55] *** hotel_california left [14:58] Is increasing a variable like this not threadsafe? perl6 -e 'my $c = 0; await ^10000 .map: { start { $c++ } }; say now - INIT now; say $c' [14:58] On every run it's missing 6-50 increments [15:03] And once in a blue moon hangs indefinitely :/ [15:07] yeah, I'm seeing between 0-3 being missed [15:08] it would be interesting at what point it kicks in (i.e. how many iterations) [15:09] * ZoffixWin is half-way through https://6guts.wordpress.com/2014/04/17/racing-to-writeness-to-wrongness-leads/ [15:09] I see ++ is mentioned as not safe **in that example** but it's unclear whether it's *still* unsafe in P6 :P [15:10] I see one miss 50% of the time with ^100 starts [15:10] I would say there may be a very slight danger of a race condition on updating the value, protecting the update with a lock seems to make it okay [15:10] e.g. "my $l = Lock.new; my $c = 0; await ^10000 .map: { start { $l.protect({$c++}) } }; say $c" [15:16] * ZoffixWin nods [15:16] cxreg: the bug you found yesterday is fixed now [15:16] ZoffixWin, i am neither a psgi nor a p6sgi expert, but my understanding of the P6SGI spec is that the server is responsible for parallel requests. If the server is doing to there is a `p6w.multithread` in the environment. and sri didnt metion why p6sgi is antiquated [15:17] and i know that sri is not psgi fan, because when you do async rendering in mojo with the psgi server backend you have some.. issues :/ [15:18] maybe, fyi: http://blogs.perl.org/users/sterling_hanenkamp/2016/01/async-aborts-and-p6sgi.html [15:20] *** CIAvash joined [15:25] zostay: hm your HTTP::Supply test is not aborting on my box.. [15:25] *** winger_ left [15:25] if this is what im thinking of, its not p6sgi that is antiquidated by psgi (implying a completely redesigned spec would be what they would do) [15:26] and by 'that is antiquidated' i mean was called antiquidated [15:26] *** winger_ joined [15:28] so i spent my time reading about psgi :D instead of implementing file uploads ;) *sigh* now its family time.. ttyl guys :) [15:28] ufobat, I think it's more to do with locking yourself into some "spec" which makes it harder to react to future tech changes. [15:28] *** Ven joined [15:29] and designing the spec from the ground up around perl 6's strengths [15:29] s/the/a/ [15:29] *** domidumont joined [15:30] still, by emulating what exists you are better learning the problem domain which may lead to such a new spec [15:32] aren't the difference between psgi and p6sgi are adressing the weaknesses of the psgi spec [15:33] *** ZoffixWin left [15:33] like the promise / supply thing [15:33] anyway :) i need to go now :) [15:35] thats trying to cram perl6 strengths into a spec that was designed around other things [15:37] *** titsuki joined [15:39] *** BenGoldberg joined [15:40] Hi. Sorry for veriy newbie-sh question. Does anyone know how to install panda from rakudo-star for windows( http://rakudo.org/downloads/star/rakudo-star-2016.04-x86_64%20(JIT).msi ) ? [15:40] *very [15:41] *** firstdayonthejob joined [15:41] *** ZoffixWin joined [15:42] titsuki, it's already installed, but IIRC it's broken. See errata on http://perl6.org/downloads/ [15:42] titsuki, as an alternative, you can download and install zef: https://github.com/ugexe/zef [15:43] hello #perl6 [15:44] Already installed ? But I cannot find panda in C:\rakudo\bin directory. [15:44] \o [15:44] titsuki, panda is part of R* distro. Try running where panda in the command prompt [15:44] I was taking a look at ZoffixWin's report https://github.com/perl6/doc/issues/497 hoping that I could document it a bit, but alas I can't figure out the syntax for sending a formatter to Date.new [15:45] dogbert17, have you tried :formatter({ some code; }) [15:45] I thinks so, hmm, let me try [15:46] m: DateTime.new(0, formatter => { say 42; } ).Str.say [15:46] rakudo-moar cf199c: OUTPUT«42␤True␤» [15:46] works [15:46] Hmm, could it have something to do with the semicolon [15:47] m: my $date = DateTime.new: 0; $date.formatter = { say 42; }; $date.Str [15:47] rakudo-moar cf199c: OUTPUT«Cannot modify an immutable Callable␤ in block at /tmp/OGl8igpqlz line 1␤␤» [15:47] m: DateTime.new(0, :formatter({ say 42; }) ).Str.say [15:47] rakudo-moar cf199c: OUTPUT«42␤True␤» [15:47] dogbert17, what's the error you're getting [15:47] sortiz: thanks for the answer earlier. But what is the solution? [15:47] m: y $n = Date.new('2015-12-31', :&formatter({'test'}) ); # fail [15:47] rakudo-moar cf199c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/dXm1uHjs6T␤Unsupported use of y///; in Perl 6 please use tr///␤at /tmp/dXm1uHjs6T:1␤------> 3y7⏏5 $n = Date.new('2015-12-31', :&formatter␤» [15:47] `where panda` returns none of lists ... [15:47] m: my $n = Date.new('2015-12-31', :&formatter({'test'}) ); # fail [15:48] rakudo-moar cf199c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zZbR0IeKg_␤Undeclared routine:␤ formatter used at line 1␤␤» [15:48] titsuki, just use zef [15:48] dogbert17, what's with '&'? [15:48] I see [15:48] I'll try zef [15:48] Thanks! [15:49] ok, it works now, but how do I specify the parameters, suppose I want a format like say yy/dd/mm [15:49] dogbert17, it takes a callable. [15:49] you write the code to do that. thats what formatter is [15:50] m: DateTime.new(0, formatter => { say $^a.year ; } ).Str.say [15:50] rakudo-moar cf199c: OUTPUT«1970␤True␤» [15:50] dogbert17, it takes one positional argument, the DateTime object [15:50] ugexe: yes, but how do I trick the date object to print it's year, month and day attributes? [15:52] m: DateTime.new(0, formatter => sub ($self) { sprintf "%2d/%02d/%02d", .year.substr(2,2), .month, .day given $self ; } ).Str.say [15:52] rakudo-moar cf199c: OUTPUT«70/01/01␤» [15:52] Y2K!! :D [15:52] m: DateTime.new(0, formatter => { say $^a.attributes ; } ).Str.say [15:52] rakudo-moar cf199c: OUTPUT«Method 'attributes' not found for invocant of class 'DateTime'␤ in block at /tmp/tBCskAIFYr line 1␤␤» [15:52] m: DateTime.new(0, formatter => { say $^a.^attributes ; } ).Str.say [15:52] rakudo-moar cf199c: OUTPUT«(int $!hour int $!minute Mu $!second int $!timezone Int $!year Int $!month Int $!day Int $!daycount Callable &!formatter)␤True␤» [15:52] you are just accessing the object [15:52] dogbert17, you don't "trick it." You get that object inside your formatter and you can call any methods your Dateish thing provides [15:52] ok, like Zoffix did then [15:53] m: DateTime.new(0, formatter => { say $^a.^methods; } ).Str.say [15:53] rakudo-moar cf199c: OUTPUT«(new now clone Instant posix offset offset-in-minutes offset-in-hours later truncated-to whole-second in-timezone utc local Date daycount day-of-month IO day-of-week days-in-month earlier week week-number is-leap-year week-year weekday-of-month yyyy-mm-dd …» [15:53] ok, I think I get it, let me whips something together and create a PR [15:53] ZoffixWin++, ugexe++ [15:53] *** Ben_Goldberg joined [15:54] m: print DateTime.new(now, formatter => { $^a.yyyy-mm-dd } ) [15:54] rakudo-moar cf199c: OUTPUT«2016-05-07» [15:54] *** BenGoldberg left [15:54] *** Ben_Goldberg is now known as BenGoldberg [15:54] m: print DateTime.new(now, formatter => *.yyyy-mm-dd ) [15:54] rakudo-moar cf199c: OUTPUT«2016-05-07» [15:54] :) I should be able to do something with this [15:58] *** vaisian left [16:09] is it possible to bind an objects attributes to the elements of an array such that update the elements of the array updates the attributes and vice-versa [16:09] I thought it was but can't find the right incantation [16:14] m: my $n = Date.new('2015-12-31', formatter => sub ($self) { sprintf "%2d/%02d/%02d", .year.substr(2,2), .month, .day given $self; } ); say $n.later(:1day); # how do I keep the format? [16:14] rakudo-moar cf199c: OUTPUT«2016-01-01␤» [16:15] as soon as I do some kind of operation o the Date I get a new instance with the default formatter [16:15] *** skink joined [16:15] how do I keep my shiny new one? [16:16] *** vaisian_ joined [16:17] dogbert17, I don't think you can. You get a new DateTime object as a result of the operation [16:17] *** Actualeyes left [16:18] Date.later returns self.new, i.e. Date [16:18] but otherwise yes [16:18] m: my $n = Date.new('2015-12-31'); say Date.new: $n.later(:1day), formatter => sub ($self) { sprintf "%2d/%02d/%02d", .year.substr(2,2), .month, .day given $self; } [16:18] rakudo-moar cf199c: OUTPUT«16/01/01␤» [16:19] ah, so that's what you have to do then [16:21] You could make a subclass of Date, which always passes it's formatter in when making new children... [16:23] BenGoldberg: thx, that might be a way, do you know if it's possible to change the formatter on an already created object? [16:24] m: my &formatter = sub { sprintf "%2d/%02d/%02d", .year, .month, .day given $^a }; my &new-date = Date.^can('new')[0].candidates[3].assuming(Date, *, :&formatter); my $n = Date.today; say &new-date($n.later(:1day)) [16:24] rakudo-moar cf199c: OUTPUT«2016/05/08␤» [16:24] dogbert17: you can, but only with 'use nqp;' and nqp::bindattr [16:24] is GH slow or is it me? [16:25] dogbert17: depending on how internals-reliant you want to be that may or may not be a good idea :) [16:25] works fine for me [16:27] psch: thanks, I'm just trying to wrap my head around how you're supposed to work with the formats. Suppose I have done some date related calcs during which I have received several Date instances and now, at the end of the calculation I want to write it out the U.S. way [16:28] chances are that I have lost the formatting routine along the way [16:28] * dogbert17 or am I just being silly? [16:28] you can use .wrap, roles, inheritence, monkey-typing... many ways to do what you want [16:28] *** jjido joined [16:30] dogbert17: i do think it's somewhat inconvenient that the formatter isn't passed along, but then you'd probably not want to have modules force formatters onto you either [16:30] dogbert17: i'd just do all the calculation without worrying about the format and create a new Date object when it's time to print it [16:31] ...and add the formatter then [16:31] psch, you'd also have conflicts on how to decide which formatter to choose on operations of two dates [16:31] dogbert17, I think the primary purpose of the formatter is to return a Dateish that will look a specific way when printed(), yet still behave like a Dateish if manipulated. [16:33] thanks guys, my only goal was to write something i Dateish.pod but I guess I got carried away :) [16:33] *** itaipu joined [16:33] s/i/in/ [16:33] like a superposition of Str and Dateish that collapses into one or the other the first time you try to see what it is [16:34] * psch boggles slightly [16:34] :) [16:35] The metaphor isn't exactly accurate (don't use it in the docs) [16:35] i mean, formatter is just how to represent the Dateish when .Str or .perl [16:35] *** wamba joined [16:35] err, .gist, not .perl [16:36] m: say Date.new(Date.today, :formatter(*.perl)); [16:36] rakudo-moar cf199c: OUTPUT«Date.new(2016,5,7)␤» [16:37] *** ZoffixWin left [16:38] :/ [16:39] *** vaisian_ left [16:40] *** itaipu left [16:49] *** titsuki left [16:53] * skink is trying to figure out how to get the rakudo-star msi working right in appveyor [16:58] it's windows, so you probably have to put in a "reboot" step after installing the .msi [17:03] *** ZoffixWin joined [17:04] ZoffixWin: how about https://gist.github.com/dogbert17/829e1adf6c6f9b03f2f47d9eb1a2c72e [17:05] we at least get one formatter example in there [17:06] *** Ven left [17:06] dogbert17, 'defined as' is wrong, it works on a Dateish. The rest looks fine to me [17:09] ZoffixWin: do you want method formatter(Dateish:D:) instead? [17:09] dogbert17, yeah [17:10] It's provided by the Dateish role, which is composed into Date and DateTime and whatever else user wants to compose it into: https://github.com/rakudo/rakudo/blob/nom/src/core/Dateish.pm#L40 [17:10] ok, laptop emergency solved by reinstalling the OS [17:10] Rather this, I guess: https://github.com/rakudo/rakudo/blob/nom/src/core/Dateish.pm#L6 [17:10] why does this feel like Windows, not Linux? [17:11] ... and the Terminal doesn't do UTF-8 anymore :( [17:11] ok, I'll fix that :) [17:12] * ZoffixWin finally finished rewritting huggable from scratch. [17:12] I even taught her to hug :P [17:12] ZoffixWin: gist updated. [17:13] dogbert17, 👍 [17:16] doc: b6fa110 | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod: [17:16] doc: Updated docs for 'formatter'. ZoffixWin++, ugexe++, psch++ [17:16] doc: review: https://github.com/perl6/doc/commit/b6fa110740 [17:17] done [17:17] *** Ben_Goldberg joined [17:17] dogbert17++ [17:17] *** BenGoldberg left [17:17] *** Ben_Goldberg is now known as BenGoldberg [17:17] Weird [17:17] ZoffixWin: not really a fan of writing docs but it's a good way to learn stuff [17:17] *** araujo joined [17:17] When I install the Rakudo MSI in Wine, it automatically updates %PATH% [17:17] *** John[Lisbeth] joined [17:17] But does not do so in AppVeyor [17:18] *** araujo left [17:19] *** araujo joined [17:19] *** Ben_Goldberg joined [17:19] ugexe++ smls++ [17:19] *** BenGoldberg left [17:19] *** Ben_Goldberg is now known as BenGoldberg [17:19] dogbert17, you can add 'Closes #333' in commit messages to automatically close issue 333. [17:20] Fixes #43432 works too, IIRC [17:20] Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=43432 [17:20] synopsebot6, shush [17:20] ZoffixWin: didn't know that :) [17:22] *** finanalyst left [17:24] *** BenGoldberg left [17:24] *** cdg left [17:25] *** BenGoldberg joined [17:27] *** huggable joined [17:27] huggable, hug me [17:27] * huggable hugs ZoffixWin [17:27] huggable, no bikeshedding please [17:27] ZoffixWin, nothing found [17:27] huggable, no bikeshedding [17:27] ZoffixWin, nothing found [17:27] :/ [17:27] huggable, huggable [17:27] BenGoldberg, nothing found [17:27] huggable, help [17:27] BenGoldberg, nothing found [17:27] *** huggable left [17:28] * BenGoldberg thinks this channel needs an infobot of some sort, not unlike perlbot on #perl. [17:29] Isn't that what huggable does? [17:29] Is that what he's for? [17:30] She's for that yeah. [17:30] *** huggable joined [17:30] huggable, no bikeshedding please [17:30] ZoffixWin, 🚳 [17:30] huggable, hug BenGoldberg [17:30] * huggable hugs BenGoldberg [17:30] huggable, huggable [17:30] BenGoldberg, See https://github.com/zoffixznet/huggable [17:31] huggable, perl6 [17:31] BenGoldberg, nothing found [17:31] huggable, perl6 is awesome. [17:31] BenGoldberg, nothing found [17:31] :is: [17:31] Agh, apparently the msi is silently failing [17:31] huggable, perl6 :is: awesome. [17:31] BenGoldberg, Added perl6 as awesome. [17:31] Anyone here familiar with using appveyor? [17:32] .tell AlexDaniel huggable is back with 99% of its db restored :P [17:32] ZoffixWin: I'll pass your message to AlexDaniel. [17:32] somehow this question seems to come up here regularly in recent days [17:33] * BenGoldberg sighs sadly. Google chrome got borked somehow when I hibernated my computer. It did not used to do that! [17:33] maybe somebody should seek an appveyor-related IRC channel and gather some knowledge about it? [17:34] *** cdg joined [17:34] hotel: you can also use Z= if you don't like the parens [17:34] m: my $a, my $b; $a, $b Z= split " ", "hello world"; say $a; say $b [17:34] rakudo-moar cf199c: OUTPUT«hello␤world␤» [17:34] *** vaisian joined [17:35] btw, split " ", "hello world" is usually better spelled "hello world".words or so [17:36] m: say words "hello world" [17:36] rakudo-moar cf199c: OUTPUT«(hello world)␤» [17:36] or that [17:37] skink, the nearest I got to appveyor was azawawi sent me a PR to make one of modules compile with it [17:37] heh [17:39] are you installing the msi in app veyor? or installing rakudo some other way [17:40] *** vaisian left [17:41] Yeah, downloading and installing the msi per appveyor docs [17:42] Originally I was building it, which works, but took a looong time [17:43] ugexe, Current revision: https://github.com/skinkade/openssl/blob/WinTests/appveyor.yml [17:44] fails on the dir command indicating it didn't actually install it [17:47] ZoffixWin, about the issue.. the 'use Bailador' approach has a Bailador::App inside. All exported subs from 'Bailador' modify or use this app. But this app only gets started if you invoke "baile". i am happy that you got your code working, but i dont see how you run into that issue. you're not 'baile'ing but running your app with a webserver. :-( we can track it down or i simply write more documentation.. ;-) [17:49] *** pierrot left [17:51] ufobat, it's probably because of the use of some of the subroutines exported by Bailador [17:52] or maybe I was calling just return template() instead of self.template or whatever [17:52] ah yeah [17:52] thats it! [17:52] skink: first you probably want to remove the `/quiet`, as that might dump some debug output to stdout [17:52] *** huggable left [17:52] the sub template exported by Bailador uses the app inside Bailador, not your own app!!! [17:53] *** huggable joined [17:53] that isn't the same app? that sounds bizarre [17:53] not unless you set it [17:53] what you have when you do a 'use bailador' is like mojolicous::lite [17:53] so why isn't template() the same as self.template() ? [17:54] it is [17:54] Well, self in self.template() is a different app. [17:54] right, which seems strange to me [17:55] surely the DSL is curried config methods for the app instance you're working with [17:55] it woudn't behave like that if you set your app inside bailador [17:55] there is a exported sub for this [17:56] why aren't the route handlers being invoked as methods on the same app, so you don't need the extra step? [17:56] it is a bit strange, it took to long to figure out what's going on [17:56] *** cdg left [17:56] Mojo handles this, Dancer2 handles this, not sure why perl6 is trying to be more clumsy than perl5 in a method invocation when half the fun of perl6 is method invocations being easier? [17:58] i am not perfectly sure what you suggest to be different. the handles are methods of the app. [17:59] it could probably be implemented better, but i dont know it better so far :-( [17:59] I don't understand how it ended up how it is [17:59] zoffix had 2 apps. [18:00] mst, it just has a class variable that it sets to a default app unless you set one yourself by calling app() and DSL is just a bunch of subs that call Bailador::App methods on that class variable [18:00] there is a app when you use all the exported subs. and if you write your app by inheritng fomr bailador::App there is your real app [18:01] class variable? [18:01] wat [18:01] yeah :} [18:01] why would there by a class variable involved at all? [18:01] I dunno [18:01] Not everyone is a genius programmer. [18:02] that's how it was for quite a while :( [18:02] or is [18:02] ufobat: did you not look at mojo or dancer2 at all? [18:02] .oO(Hang the genius programmers on the right peg...) [18:02] i did [18:02] i just didnt change it so far [18:02] both of them do this with closures rather than a magic global variable [18:02] PR are welcome :) [18:04] .oO(Torment the early adopters on behalf of the late adopters...) [18:04] ... change it? [18:05] the idea of prior art is ... you look first ... to steal ideas before you start :) [18:06] More Fun™ the other way [18:06] mst, change it because I don't think ufobat started Bailador, but inherited it [18:06] *** spider-mario left [18:06] aha [18:06] *** spider-mario joined [18:06] i think bailador::app used to be a singleton, when i started to add some stuff it was a "semi" singelton.. [18:07] ooooh, right [18:07] so it started off using the simpleton antipattern [18:07] and is slowly being rescued [18:07] * mst wishes we could build something into the compiler so that every time a newbies attempts to implement a simpleton they got a gentle electric shock and a link to a page full of alternatives [18:07] (pretty sure this would've saved me some time back in the day too) [18:08] * tadzik hides [18:08] to my defense, I wrote it on a napkin during my spanish classes [18:08] :) [18:09] *** kaare_ left [18:10] *** milwauke` left [18:11] i am open for critique and stuff. so anything is welcome. [18:11] hard for me to be that helpful with it, given that entire style mostly makes me respond with 'wait, http method first? have you of you people even heard of REST? aaaaaaaaaaaaa *sob*' [18:12] *** araujo left [18:12] but "your delcarative-style mutative DSL should probably be exporting subs that curry method calls onto a builder object that itself then is attached to an app object it's building" seems like, albeit maybe a little bit of effort, well worth it [18:13] *** araujo joined [18:14] *** araujo left [18:15] *** araujo joined [18:16] *** AlexDaniel joined [18:16] . [18:16] 17:32Z AlexDaniel: huggable is back with 99% of its db restored :P [18:16] ZoffixWin: thank you! [18:16] huggable, hug AlexDaniel [18:16] * huggable hugs AlexDaniel [18:16] oh [18:16] new feature? [18:16] :P [18:16] *** cdg joined [18:17] Yeah [18:17] can also do: [18:17] ufobat: does the above sentence make some sort of sense? I'm happy to discuss architecture bits, just not 100% sure I'm the right person for 'user facing API' when it's a style of user-facing-API I'm not 100% fond of :) [18:17] huggable, hug me [18:17] * huggable hugs ZoffixWin [18:17] huggable, hug huggable [18:17] * huggable hugs huggable [18:17] huggable, hug it [18:17] * huggable hugs it [18:18] huggable: hug yourself. [18:18] * huggable hugs yourself. [18:18] ts sk sk [18:18] mst, well... i am still thinking about it. [18:19] i think i dont understand how such a code would look like [18:19] huggable: hug you [18:19] * huggable hugs you [18:19] huggable: hug everyone [18:19] * huggable hugs everyone [18:19] huggable: hug 42 [18:19] * huggable hugs 4 [18:19] 2 [18:19] heh [18:20] huggable, hug 4QUIT [18:20] * huggable hugs 4 [18:20] QUIT [18:20] who would have thought, right? [18:20] *** maybekoo2 left [18:21] ZoffixWin: anyway, so what's the placeholder? [18:21] mst: why should the builder be attached to the app? why not just building the app just before you call 'baile' [18:21] i would use a adapter dependency inversion facade visitor aggregate pattern [18:21] ZoffixWin: or how can I create similar actions? [18:21] AlexDaniel, in where? Your own bot? [18:22] ZoffixWin: no, in huggable [18:22] ZoffixWin: like foo :is: foo ?someone?! or what is it? [18:22] %s? [18:22] AlexDaniel, oh, no placeholder. I just wrote a small Hug.pm6 plugin: https://github.com/zoffixznet/huggable/blob/master/lib/IRC/Client/Plugin/Hug.pm6 [18:22] :( [18:22] *** grondilu left [18:22] The :is: is part of the Factoid plugin [18:23] ufobat: eh? [18:23] ZoffixWin: another thing I'd love to see is, uh, so that I could make huggable speak to somebody else [18:23] ZoffixWin: like [18:23] huggable: tell ZoffixWin dunno [18:23] AlexDaniel, nothing found [18:23] huggable: dunno [18:23] i misread you .( [18:23] AlexDaniel, nothing found [18:23] huh? [18:24] AlexDaniel, oh, that one is missing. The "backup" I got had unicode mangled [18:24] *** grondilu joined [18:24] ufobat: oh, yeah, it should, but then you have to cram everything the builder knows how to do to the app into the app's new() method, which isn't always an advantage [18:24] huggable, dunno :is: ¯\_(ツ)_/¯ [18:24] ZoffixWin, Added dunno as ¯\_(ツ)_/¯ [18:24] ufobat: and if your DSL is currently global all the way, I'd bet that wouldn't be the easiest refactor to do first [18:25] ufobat: but, yeah, if I was designing it from scratch, and willing to take the time to get that to work, I'd do it the way you just suggested [18:25] good ol strategy pattern [18:25] ufobat: just it's probably more work than what I suggested and I was trying for "how would I end up not regarding this as a code smell in the fewest number of rectoring steps" :) [18:25] ugexe: eh? [18:26] ugexe, No output with or without additional flags, let alone /quiet [18:26] don't get all computer sciencey on me, I'm an easily confused ex-mathematician ;) [18:27] i am confused because i feel like i didnt suggest anything [18:28] 'why not just build the app' [18:28] *** zakharyas joined [18:28] ah sorry [18:28] RabidGravy: re http://irclog.perlgeek.de/perl6/2016-05-07#i_12447261 , PackUnpack is supposed to be close to P5's implementation [18:28] RabidGravy: how would you do that in P5 ? [18:29] *** jjido left [18:29] doc: e848c76 | (Jan-Olof Hendig)++ | doc/Type/IO/Handle.pod: [18:29] doc: Documented the 'opened' method [18:29] doc: review: https://github.com/perl6/doc/commit/e848c767e5 [18:29] lizmat, I wouldn't do what I'm trying to do in P5 ;-) [18:30] well, then you can't :-) [18:30] huggable: hug me [18:30] * huggable hugs AlexDaniel [18:30] m: say “/me hugs %ENV” [18:30] rakudo-moar cf199c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3xPgNSF0Kv␤Variable '%ENV' is not declared␤at /tmp/3xPgNSF0Kv:1␤------> 3say “/me hugs 7⏏5%ENV”␤» [18:30] I really see PackUnpack as a drop in for pack/unpack in P6 and v5 [18:30] m: say “/me hugs %*ENV” [18:30] rakudo-moar cf199c: OUTPUT«/me hugs AlexDaniel␤» [18:30] im probably off, but strategy pattern just encapsulates some interface in which you can use a multi method to processing individual arguments [18:30] mst^ [18:31] RabidGravy: nothing more, nothing less [18:31] :o [18:31] AlexDaniel, hax [18:31] m: say “/me hugs %*ENV” [18:31] rakudo-moar cf199c: OUTPUT«/me hugs ZoffixWin␤» [18:31] neat [18:33] m: say [~] %*ENV.comb.pick: * [18:33] rakudo-moar cf199c: OUTPUT«eAlDenxial␤» [18:33] m: say [~] %*ENV.comb.pick: * [18:33] rakudo-moar cf199c: OUTPUT«lnlAexaiDe␤» [18:33] m: say ([~] %*ENV.comb.pick: *).tc [18:33] rakudo-moar cf199c: OUTPUT«EAaixenllD␤» [18:33] hmm [18:33] m: say ([~] %*ENV.comb.pick: *).lc.tc [18:33] rakudo-moar cf199c: OUTPUT«Ialeaelndx␤» [18:33] ugexe: oh, I guess you could use that instead of what I was thinking, sure [18:33] I was just thinking 'curried method calls' [18:33] AlexDaniel: you can leave of the second . there [18:33] m: say ([~] %*ENV.comb.pick: *).lctc [18:33] rakudo-moar cf199c: OUTPUT«Method 'lctc' not found for invocant of class 'Str'␤ in block at /tmp/Tn9zHhaLRN line 1␤␤» [18:33] AlexDaniel: oh, no, sorry [18:33] AlexDaniel: gotta switch them around too :/ [18:33] m: say ([~] %*ENV.comb.pick: *).tclc [18:33] rakudo-moar cf199c: OUTPUT«Leaalnxide␤» [18:34] great [18:34] mst, so your suggestion with the builder object attached to the app, how would this end up... when does the app do something with the builder object? [18:35] eh? [18:35] the app ... doesn't [18:35] other way around [18:36] i am not getting the "attach the builder to the app" part [18:36] so 'get $path, $sub;' # as a sub call [18:36] something like $class.*method to curry the results along to the next argument instead of returning a set of results might be cool [18:37] does roughly $builder.get($path, $sub) [18:37] and then inside that, you're doing $!app.add_route('get', $path, $sub) [18:37] m: print 8.chr x 27; say “/me hugs %*ENV” [18:37] rakudo-moar cf199c: OUTPUT«/me hugs AlexDaniel␤» [18:37] the 'builder' thing is just somewhere to keep that logic that you can compose roles into etc. so plugins can extend the DSL [18:38] builder is entirely possibly the wrong name for it enterprise-pattern-wide [18:38] ahh, not it makes sense! thank you! [18:38] now [18:38] ZoffixWin: I wonder if that ↑ works on some irc clients :) [18:39] ufobat: and then basically your 'default' case then becomes [18:39] ZoffixWin: I mean, I don't expect it to actually /me, but the backspace thingy itself [18:39] ufobat: $builder.new(:app($global_class_app)).export(); [18:39] (roughly, do excuse me half perl5 half perl6 pseudocoding) [18:40] huggable hug foof [18:40] huggable, hug foof [18:40] * huggable hugs foof [18:40] ur huggable is defective [18:41] Why? [18:41] m: my $b = 8.chr x 27; say “/me hugs %*ENV$b” [18:41] rakudo-moar cf199c: OUTPUT«/me hugs ZoffixWin␤» [18:41] apparently ilbot3 strips those weird thingies you do there at least [18:41] because it just hugged a nonexistant nick that wasn't even a valid IRC nick? [18:42] huggable: hug herself and sobs [18:42] * huggable hugs herself and sobs [18:42] mst, that's a feature not a bug! :D [18:42] psch++ [18:43] mst but just for the thing zoffix did, having a $global_class_app and a own class inherting Bailador::App this woudn't help. because the builder has nothing to do with your class.. [18:44] *** BenGoldberg left [18:45] class Builder { has $.app handles /*/; }; ? [18:45] ufobat, right, because you also have subs that you call inside route callables. [18:45] ufobat, have you seen Growing Guide that shows the process of converting a ::Lite mojo app into a full one? http://mojolicious.org/perldoc/Mojolicious/Guides/Growing [18:45] not yet, ZoffixWin [18:46] ugexe, ? [18:47] ::Lite is basically for quit prototyping and you can continue using for small apps and convert to a full app when it grows. With Bailador, (currently) you just have a choice between using the sub interface or the class-y interface and you have to explode a lot of stuff if you want to get fancy.r [18:47] s/quit/quick/; [18:49] basically you provide a interface/contract for what some class needs to implement. then the 2 classes do not need to know anything about one another other than it does method XXX and method YYY [18:49] m: class Builder { has $.app handles *; }; my $b = Builder.new: :app('meow'); say $b.uc; $b = Builder.new: :app(class { method frob { rand } }.new); $b.frob.say [18:49] rakudo-moar cf199c: OUTPUT«MEOW␤0.994158023560217␤» [18:49] the 'use Bailador' thingy is the ::lite approach. and i think if there would be a $controller passed to the callable [18:50] *** ZoffixWin left [18:50] “quit prototyping” :) [18:51] and the $c is capable of doing more, everything would be more easy. but this would break other web apps using the classical bailador approach [18:51] thats why i haven't thought much about it. i didnt want to break runnig code [18:51] ufobat: aye, fair enough [18:52] I'm ... blah, I'm convinced there's a way to square the circle but I'm not awake/alive enough today to quite figure it out [18:52] I'll have to try and think about this again later, sorry [18:54] thanks for the feedback :) mst, i appreciate it [18:55] if you look at the internals of Dancer2::Core::DSL you can see my last attempt at producing something sort of like this that I didn't dislike overly, though there's a few things about that that I think I got wrong [18:55] i assumed the approach through inherting from Bailador::App would result in a better interface and not breaking old code [18:56] but did i get you right, you like the "use exported subs" way better? [18:56] *** BenGoldberg joined [18:56] mst i [18:56] 'll read it [18:56] I know some people find the exported subs approach more elegant and easy to write [18:57] I'm not actually fond of it myself, really, but since Dancer/Dancer2 has turned out to be more accessible to a lot of people [18:57] I've been thinking about the design problems in the vein of "how do I allow the exported subs approach for whipuptitude without interfering with manipulexity later" [18:58] ufobat: so, no, I don't like it better, but I want to be able to share an ecosystem with people who do :) [18:58] m: role Bar { method xxx($a is rw) { $a += 10; }; }; role Bar2 { method xxx($a is rw) { $a += 20 }; }; class Foo { }; my $foo = Foo.new; $foo does Bar; $foo does Bar2; my $work = 1; say $foo.*xxx($work) [18:58] rakudo-moar cf199c: OUTPUT«(21 31)␤» [18:59] mst and it's not enoght doing a app $incance-of-my-class-hat-inhertied-from-bailador-app (a sub which is exported) and then everthing would work as expected [18:59] I refer you to my previous "I've concluded I'm not awake enough to be confident about trying to analyse the details", sorry [18:59] because this would be possible [18:59] :D [19:00] I'd rather refuse to answer than give answers I think are quite possibly bull excrement [19:00] also, I have to go meet somebody [19:00] but I'd love to discuss this again when I'm actually capable of being properly useful to you :D [19:00] & [19:00] mst++ [19:09] * tadzik wondews how much work would there be to turn rakudo-js into rakudo-webassembly [19:15] um, isn't that a very big difference? [19:16] like, rakudo-js is trying to emit javascript source code, webassembly is basically assembly code? [19:17] as in, it'd be almost easier to turn moarvm into a webassembly blob and run code that way? [19:21] timotimo: webasm is standardized starting from asm.js, which is a subset of JavaScript [19:22] *** domidumont left [19:22] MadcapJake, You around? [19:24] *** jjido joined [19:24] A little. I'm out shopping. [19:25] masak: you sure? wasm will have its own designed AST so it should be possible to generate it to target wasm without going through javascript. [19:27] turning moarvm into webassembly sounds even cooler :D [19:27] MadcapJake, Does that choco stuff for r* still work? [19:28] No its old, I haven't been on Windows in years. Use the rakudo star msi [19:28] grondilu: yes, that's still true. [19:29] *** hankache joined [19:29] hello #perl6 [19:29] grondilu: I'm just pointing out that the starting material is not all that different in spirit from asm.js -- though the format is [19:29] MadcapJake, That's the problem. I'm trying to get the msi to work in appveyor and I'm having a doozy of a time [19:30] Rakudo has an appveyor setup doesn't it? [19:32] hankache o/ [19:33] hiya lizmat [19:34] *** hotel_california joined [19:34] *** hotel left [19:36] *** vaisian_ joined [19:38] Oh wow I actually got it working [19:38] Only took eight commits :D [19:39] in any case rakudo.js will certainly help targetting wasm [19:40] (just as asm.js helps implementing it I guess) [19:41] *** hotel joined [19:42] *** vaisian_ left [19:43] *** hotel_california left [19:45] ugexe, Any idea what this means?: https://github.com/sergot/openssl/issues/19 [19:45] I'm getting the same error [19:46] *** hotel_california joined [19:48] *** hotel left [19:51] *** hotel joined [19:51] *** hotel_california left [19:55] *** CIAvash left [19:56] Is there an example of overriding gist() in your own class? I'm having trouble getting it right [19:56] m: class A { method gist { "my special own class" } }; say A.new [19:56] rakudo-moar f9db92: OUTPUT«my special own class␤» [19:57] tailgate: the only thing i'd consider of note there is that you just return the gist, and don't try to &say it yourself in the method [19:57] tailgate: what exactly doesn't work for you? [19:58] I think the problem is I typed return $str; rather than just not having "str" [19:58] Basically it's say (Any) rather than what I return [20:01] m: class A { method gist { my $str = "my special own class"; return $str } }; say A.new [20:01] rakudo-moar f9db92: OUTPUT«my special own class␤» [20:01] tailgate: i think actual code would help more to figure out what's wrong with your... actual code :) [20:02] m: class A { method gist { "my special own class" } }; say ~A.new [20:02] rakudo-moar f9db92: OUTPUT«A<62383072>␤» [20:02] m: class A { method gist { "my special own class" }; method Str { self.gist } }; say ~A.new [20:02] rakudo-moar f9db92: OUTPUT«my special own class␤» [20:03] *** yqt joined [20:05] *** pierrot joined [20:06] *** hankache left [20:21] *** zakharyas left [20:31] *** wamba left [20:33] *** BenGoldberg left [20:48] .tell ZoffixWin this \o[001] issue is scary [20:48] AlexDaniel: I'll pass your message to ZoffixWin. [20:50] *** dolmen joined [20:50] *** jjido left [20:51] *** jjido joined [21:08] *** TEttinger joined [21:09] AlexDaniel: why is it scary? [21:09] i don't even know what issue that is [21:10] huggable: hug me [21:10] * huggable hugs m [21:10] e [21:10] huggable: hug me [21:10] * huggable hugs AlexDaniel [21:10] this one [21:10] actually, lots of things are breaking when you do that [21:11] for example, these messages are not logged: http://irclog.perlgeek.de/perl6/2016-05-07#i_12448510 [21:12] yikes [21:12] lizmat: yeah, awful. And scary. [21:13] I'm not sure if you can do something evil with that though, I'm not in the mood today [21:17] hm, actually there is probably no problem with that [21:18] the not being logged bit is something moritz should look at... [21:19] lizmat: https://xkcd.com/1172/ [21:20] :-) [21:25] *** kaare_ joined [21:37] *** vaisian_ joined [21:37] MadcapJake: i finally found a bit of time to look at the shakespearean counter [21:38] *** mr-foobar left [21:38] MadcapJake: my multithreaded version is also slower than your naive version [21:38] um, no, i just read the time output wrong [21:39] *** mr-foobar joined [21:39] 171.21user 0.18system 0:43.72elapsed 391%CPU (0avgtext+0avgdata 210140maxresident)k [21:39] 130.02user 0.09system 2:10.12elapsed 99%CPU (0avgtext+0avgdata 95280maxresident)k [21:39] m: say "multithreaded version took only { 43 / (2 * 60 + 10) }x as much time as naive" [21:39] rakudo-moar e093cc: OUTPUT«multithreaded version took only 0.330769x as much time as naive␤» [21:40] compare 33% as much time with 391% cpu time [21:40] there's noticable overhead, but it ended up faster in the end [21:41] Speaking of speed, using the r* msi vs building saves 22min on appveyor [21:41] *** kaare_ left [21:43] *** vaisian_ left [21:43] MadcapJake: i commented my code into the gist [21:44] *** Emeric1 joined [21:45] *** Emeric left [21:45] *** Emeric1 is now known as Emeric [21:46] *** ZoffixWin joined [21:48] AlexDaniel, yeah, it's actually exploitable by using something that can send \n [21:48] 20:48Z ZoffixWin: this \o[001] issue is scary [21:49] I'm gonna blow up IRC::Client and re-design it from scratch. Current version sucks. I wrote it half drunk when I didn't know any Perl 6. [21:49] ZoffixWin: huh? I don't think that you can send \n [21:49] Hm. I guess you're right, since it'll go via the server. [21:49] Then why is that issue scary? :P [21:50] ZoffixWin: http://irclog.perlgeek.de/perl6/2016-05-07#i_12448525 [21:50] Ah [21:51] ZoffixWin: well, dunno. What happens if you send a really-really long string? [21:51] timotimo: Would be interested to know if you get slightly better results with moar/reframe on that concurrency thing, since one source of contention has been removed [21:52] I have no idea how IRC works by the way [21:52] jnthn: then i'll first have to measure without jit, too [21:52] oh, and i didn't put "combine the numbers" back in [21:52] True :) [21:52] *** huggable left [21:53] *** huggable joined [21:54] huggable: test [21:54] AlexDaniel, foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooz [21:55] AlexDaniel, it'll either disconnect or the response won't be sent, I forget (at least on Freenode) [21:55] That won't work lol. It can only happen with the 'Stored blah as blah', because everything else is shorter than *you* can send :) [21:55] *** AlexDaniel is now known as AlexDanielttttt [21:56] huggable: test [21:56] AlexDanielttttt, trooooloolollllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll [21:56] huggable: t [21:56] AlexDanielttttt, fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooz [21:56] skink: its apparently because p6-find-bundled uses @*INC which hasn't existed for almost a year [21:56] ZoffixWin: not when you add my nickname [21:56] *** AlexDanielttttt is now known as AlexDanieltttttt [21:56] U gyess [21:57] *** huggable left [21:58] *** huggable joined [21:58] huggable, hug trollolo [21:58] * huggable hugs trollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotr [21:58] the fact the current %?RESOURCES implementation can't handle the openssl use case by allowing the author to somehow provide alternatives should suggest it needs to be redone [21:58] * ZoffixWin lols [21:58] ZoffixWin: wait, didn't you write it just couple of months ago? [21:59] *** Emeric left [21:59] Looks like it continues to shove data, so in some way it is exploitable, I guess :) https://gist.github.com/zoffixznet/f9469aa867b6c53c76c701712d5fe5b1 [21:59] *** huggable left [22:00] ugexe, Well, that'd do it :) [22:00] AlexDanieltttttt, no. My first Perl 6 code was App::NoPaste and the two supporting modules, and then I wrote IRC::Client and all its plugins and I did it in December so I could have a new Year IRC party bot. [22:01] it doesnt help that Find::Bundled has no tests so it merrily installs and makes openssl look like the culprit [22:01] oh geez my nickname [22:01] *** AlexDanieltttttt is now known as AlexDaniel [22:01] Actually, after I wrote App::NoPaste I forgot Perl 6 (too much time went by), so IRC::Client can really count as my first Perl 6 project :P [22:01] *** colomon left [22:02] hmmm.. looks like I broke it :/ [22:04] *** jnap_ left [22:05] *** jnap_ joined [22:06] *** unhuggable joined [22:07] unhuggable, hug me [22:07] * unhuggable hugs ZoffixWin [22:07] *** unhuggable left [22:08] oooooh: "* huggable :Nickname is already in use." [22:08] I'm trying to overload the + operator with the following code. https://gist.github.com/ahalbert/b2714e33f15d6e2b3aa9944ef6c1867d It gives a type error when I tried to use it. Could anyone clairfy what it means? [22:09] *** raiph joined [22:09] tailgate, you overloaded with `Unit` but trying to call it with `Units::Unit` [22:09] *** grondilu left [22:10] tailgate, and it's trying to convert it into .Numeric and fails [22:10] *** ZoffixWin is now known as huggable [22:10] m: https://gist.github.com/AlexDaniel/429ed056c3791545824d2a1c139258fe [22:10] rakudo-moar e093cc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bhidKciC4E␤Invalid typename 'Unit' in parameter declaration. Did you mean 'uint', 'Uni'?␤at /tmp/bhidKciC4E:1␤------> 3multi sub infix:<+>(Unit7⏏5 $x, Unit $y) {␤» [22:10] *** huggable is now known as ZoffixWin [22:11] Unit has a member of type Num [22:11] *** verzit left [22:11] tailgate, what's in $a and $b? [22:12] Units::unit I should calirfy, the <+> is copied from the module Units [22:12] *** verzit joined [22:12] tailgate: it would be cool if it was a runnable snippet :) [22:12] m: $*REPO.repo-chain.grep(*.files("libssl.so")).say [22:12] rakudo-moar 626b5a: OUTPUT«Cannot unbox a type object␤ in block at /tmp/Jge8sCDuuw line 1␤␤» [22:12] the type is a Units::unit of $a and $b [22:12] tailgate, Units::Unit is not a Unit [22:12] tailgate, you're trying to match apples to oranges [22:12] m: say Num ~~ Numeric [22:12] rakudo-moar 626b5a: OUTPUT«True␤» [22:14] m: subset literal of Str; my literal $foo = "abc"; say $foo; say $foo.WHAT # literal: "subtype with ... just a different type name" (a subset is, er, literally, a subset so you can't add a method; in this case the subset is semantically equal to the original type except with a different name) [22:14] rakudo-moar 626b5a: OUTPUT«abc␤(Str)␤» [22:14] er, nevermind :( :) [22:16] *** huggable joined [22:16] *** huggable left [22:17] *** huggable joined [22:17] huggable, hug me [22:17] * huggable hugs ZoffixWin [22:17] There! Fixed forever [22:18] huggable, hug tree [22:18] * huggable hugs tree [22:18] huggable++ # loves the environment [22:18] *** verzit left [22:19] *** verzit joined [22:19] *** verzit left [22:19] *** colomon joined [22:20] *** ufobat left [22:22] *** kurahaupo left [22:23] *** dolmen left [22:23] *** kurahaupo joined [22:23] ugexe, I switched it to use resources/libraries instead of Find::Bundled and... [22:23] It works! :D [22:23] Completely, somehow [22:26] it shouldnt [22:27] resources/libraries will mangle the name, and %?RESOURCES gives you no option to supply anything but a single name [22:27] (so first it would only work on EITHER windows or linux) [22:29] OpenSSL::NativeLib uses a sub which returns the bundled dll if $*DISTRO.is-win, else returns the native system lib [22:29] i.e. you cant mangle `ssl` into both libssl.so and ssleay32.dll [22:30] I only changed two lines to get it working. Not the cleanest fix, but all tests pass on both Linux and Windows [22:30] that doesnt install the lib. it sounds like you may just be hard coding an assumed location [22:31] resources/libraries would provide the library through %?RESOURCES or %?RESOURCES [22:33] the only real solution i can see unless %?RESOURCES gets reworked is to install both the .so and .dll on both OS [22:33] and NativeLib.pm6 still has exist to decide to use %?RESOURCES or %?RESOURCES [22:34] There is no .so being installed [22:34] ... i know [22:34] if you were on linux and needed it, then it would be [22:34] m: say $*VM.platform-library-name('ssl'.IO).Str [22:34] rakudo-moar 626b5a: OUTPUT«libssl.so␤» [22:36] on windows that wont generate the correct name. so `resources/libraries` is useless [22:36] *** aries_liuxueyang left [22:37] the original s22 implementation was on the right track in this respect [22:38] *** aries_liuxueyang joined [22:38] if a leaf node is a hash, it represents build time stuff that is meant to be handled by some builder so that those type of name customizations can be made [22:45] .seen sergot [22:45] I saw sergot 9 Feb 2016 15:52Z in #perl6: stmuk_++: merged, thanks a lot! :) [22:49] *** vaisian joined [22:50] *** vaisian left [22:54] *** kurahaupo_ joined [22:56] *** kurahaupo left [22:56] *** mr-foobar left [22:57] *** mr-foobar joined [23:04] *** jjido left [23:04] *** cpage_ joined [23:07] *** cognominal left [23:09] q [23:10] on a positive note this hack removes dependencies on panda, Shell::Command, and File::Bundled [23:13] *** spider-mario left [23:14] *** kurahaupo joined [23:16] *** kurahaupo_ left [23:17] :) [23:18] ugexe, :) [23:19] the drawback is 2 windows dlls get copied to the file system on linux (but never used). an alterntive is to use Build.PM to delete them from the META.info file but that seems even less koscher [23:19] *** firstdayonthejob left [23:21] How can you get the current size of a file referenced by an IO::Handle? [23:21] *** kurahaupo left [23:22] Nevermind IO::Handle::s [23:22] hey Xliff_ [23:22] I will have to write a test to see if a file opened as :w will return the proper size without a .flush/.close. [23:22] \o skink [23:23] * ZoffixWin chuckles at AlexDaniel [23:24] ugexe, My original intent wasn't even to change any code. I just wanted to see if my cross-compiled libs worked. [23:24] did they? [23:24] Yes, thankfully [23:25] http://i.imgur.com/NIuBvh7.png 😂😂😂 [23:25] yeah, I just wrote “hug me” to ZoffixWin… because for some weird reason he changed his nickname from “huggable” to “ZoffixWin”, and I had a private window opened… so I wrote a message to him thinking that I am talking to huggable [23:25] OpenSSL has a CROSS_COMPILE build setting so I expected them to, unlike my past attempts for other libs [23:25] huggable, hug AlexDaniel [23:25] * huggable hugs AlexDaniel [23:27] huggable: hug everyone [23:27] * huggable hugs everyone [23:28] timotimo: cool! afk till tomorrow [23:30] huggable, hug huggable [23:30] * huggable hugs huggable [23:33] m: my %h = (); say "Y" if %y == 'y'; [23:33] rakudo-moar 626b5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7HX92swxKr␤Variable '%y' is not declared␤at /tmp/7HX92swxKr:1␤------> 3my %h = (); say "Y" if 7⏏5%y == 'y';␤» [23:33] m: my %h = (); say "Y" if %h == 'y'; [23:33] rakudo-moar 626b5a: OUTPUT«Use of uninitialized value of type Any in numeric context in block at /tmp/NggOlN0OzO line 1␤Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5y' (indicated by ⏏)␤ in block at /tmp/NggOlN0…» [23:33] m: my %h = (); say "Y" if %h eq 'y'; [23:33] rakudo-moar 626b5a: OUTPUT«Use of uninitialized value %h of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block at /tmp/pnidGaR4NL line 1␤» [23:34] Is there a way to make that test without a call to :exists first? [23:38] So... no streamlined version of this? [23:38] m: my %h = ( y => 1 ); say "Y" if %h:exists && %h eq 'y'; [23:38] rakudo-moar 626b5a: ( no output ) [23:40] m: my %h; say ‘Y’ if (%h // ‘’) eq ‘y’ # :-/ [23:40] rakudo-moar 626b5a: ( no output ) [23:42] m: my %h = ‘y’ => ‘y’; say ‘foo’ if %h:v eq ‘y’ [23:42] rakudo-moar 626b5a: OUTPUT«foo␤» [23:42] m: my %h; say ‘foo’ if %h:v eq ‘y’ [23:42] rakudo-moar 626b5a: ( no output ) [23:42] Xliff_: ↑ that, I guess [23:42] *** rindolf left [23:43] yeah, that [23:44] LOL! Thanks, AlexDaniel! [23:44] Now since you are hear... can you get a filename from an IO::Handle? [23:44] =) [23:44] skink: https://github.com/sergot/openssl/pull/25 i'll try and merge this later if it passes travis, and then i'll test your updated libs and merge those as well [23:45] Somehow I don't think that IO::Handle has to have any associated filename [23:45] :s [23:45] *** grondilu joined [23:45] it's just a handle! [23:45] Means I will have to capture output filename, somehow. [23:46] Thanks. [23:46] I may be wroung though [23:46] you can set the file name anyway if you want [23:46] if you know what it will be and just want something to contain it while you pass around the IO::Handle [23:47] its just called :$path [23:49] m: IO::Handle.new(:path => $*CWD).path.say [23:49] rakudo-moar 626b5a: OUTPUT«IO::Handle is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in method new at src/RESTRICTED.setting line 32␤ in block at /tmp/zxPqGtJxMV line 1␤␤» [23:49] with no path .path will be '-' [23:49] ugexe, Yeah that's way better than my hack [23:49] m: say $*IN.path [23:49] rakudo-moar 626b5a: OUTPUT«IO::Special.new(what => "")␤» [23:50] m: say ~$*IN.path [23:50] rakudo-moar 626b5a: OUTPUT«␤» [23:50] Xliff_: well… :) [23:51] *** kurahaupo joined [23:51] ugexe, This also means issue #19 can be closed [23:53] Also hold off on the libs, OpenSSL 1.0.2h just came out so I might as well build that [23:53] skink: want to redo your PR but change /native-lib to /resources, and attach your app veyor? [23:54] New PR with name change, update libs, and appveyor pointed at master? [23:54] Sound alright? [23:55] yeah [23:55] *** cdg left [23:55] Alright, give me just a bit [23:55] *** kurahaupo left [23:55] *** uruwi joined [23:56] Hrm. [23:56] you should probably bump the version again too [23:56] IO::Handle::path isn't documented, here [23:56] https://doc.perl6.org/type/IO::Handle [23:56] its an attribute, not a method [23:56] *** cdg_ joined [23:57] ugexe: does it mean that we never document attributes? [23:57] i mean i guess that gives it a method by default but ye ah [23:58] huggable: docs [23:58] AlexDaniel, nothing found [23:58] huggable: doc issue [23:58] AlexDaniel, nothing found [23:58] huggable: doc issue :is: https://github.com/perl6/doc/issues/new [23:58] AlexDaniel, Added doc issue as https://github.com/perl6/doc/issues/new [23:59] not usually. they are typically described in the method parameters [23:59] Actually, it's an attribute AND a method! [23:59] IO::Handle::path returns $!path. [23:59] Which looks to be an IO::Path