»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
Xliff ZoffixWin, for this task it's worlds better than gvim. 00:01
I will go back when I am actually working in P6 instead of gptrixie'd files. 00:02
ZoffixWin :)
Xliff What took me an hour in gvim I just finished in 5 minutes with Sublime.
Xliff ♥s Sublime.
gvim is muscle memory.
00:02 khisanth_ joined
Xliff skink, OK. will retest in a sec. 00:02
Commit f333b99 - Still getting 0xc1 error 00:04
00:04 ocbtec left
Xliff 38328 bytes - crypt_blowfish.dll 00:05
Correction 38382 bytes - crypt_blowfish.dll
Damned dyslexia!!! o(≧o≦)o 00:06
skink acj
ack*
Xliff int64_t vs int64 00:08
Xliff shakes fist at gptrixie. 00:09
*sigh* -- now to figure out test cases for libogg....
skink Can anyone familiar with cross-compiling figure out how to make a shared Windows lib out of this? 00:16
www.openwall.com/crypt/crypt_blowfish-1.3.tar.gz
00:17 ilbelkyr joined
skink Or if someone trusted just wants to build it and submit a PR 00:17
00:20 mcsnolte left 00:31 sortiz joined 00:37 spider-mario left 00:42 ParsonsNose joined
Xliff Visual Studio is such a cranky piece of shit. 00:43
ugexe Xliff: skink: i think that "cannot find native library" is a rakudo bug. it just so happens i think i addressed it in this open pr: github.com/rakudo/rakudo/pull/730/...2eefc15L56 00:45
the highlighted line shows the use of .dirname, which as i mentioned earlier would lose the volume if you try to recreate a path with it (which it does) 00:46
orbus I like atom, but it's too slow 00:52
haven't tried sublime
vi is generally fine anyway
Xliff orbus: Sublime is a better editor, overall. 00:56
Nothing wrong with vi. It's a classic.
However I can do things 10x faster in Sublime than I can in vi 00:57
orbus hmmm, depends - vi has a ton of shortcuts for things most editors don't
the downside is, you have to learn and remember them all
Xliff Exactly. 00:58
orbus but it can do some pretty nifty things
Xliff ugexe: How can I merge that PR with my rakudo repository?
orbus my big gripe with atom is, at least one windows it's a big memory hog, and if you leave it open, windows will decide to page it out 00:59
and then it takes foreeeeever to come back
skink ugexe++ # Making me feel less incompetent 01:07
Xliff ugexe: Rebuilding. 01:09
I'll then run the test suite
then I'll try and install Crypt::Bcrypt again
Tests passed/ 01:14
ugexe eh it actually worked?
oh the tests suite 01:15
Xliff Yeah.
Same failure. Same code.
01:16 astj joined
ugexe the good news is i feel slightly incompetent now too 01:16
Xliff Nooot reeeeeaallly.
01:21 yqt left 01:28 molaf left
sortiz \o #perl6 01:31
01:34 ryand joined 01:41 molaf joined 01:45 ilbot3 left 01:47 ilbot3 joined
awwaiid Is there a way to #! a specific rakudobrew perl6 version? 01:50
as in, I have several installed but want to have a script call a specific one that might not be the current one 01:51
01:52 djbkd joined
Xliff awwaiid, you'd have to have each p6 binary named properly. Symlink the current one to "perl6" and then #! the specific one you want. 01:56
awwaiid ah. so no current out-of-the-box way then
Xliff That is if I understand what you are asking, correctly.
Please do not assume that my answer is authoritative. =) 01:57
awwaiid good enough for now, I'm just making some slides of examples -- I'll just go with '#!/usr/bin/env perl6' and not worry about it
02:02 _nadim joined 02:06 cpage_ left 02:08 kid51 left 02:09 _28_ria joined
ugexe something like `rakudobrew --with moar-xxxxx <cmd>` (like perlbrew) would be nice 02:10
_28_ria skink: Yes, why do you ask? 02:12
skink You lost connection a lot of times
02:15 noganex joined 02:16 ggoebel18 joined
_28_ria skink: :) I leave on the starting edge of the world. ISPs often forget about us. We have a very flaky internet connection. And our only internet trunk is satellite. We don't have any fiber optic coming here, only within the region (internal fiber, for quicker intranet :), but everything, considering the outside world is very flaky and slow. 02:16
02:17 ggoebel17 left 02:18 noganex_ left 02:23 _nadim left, _nadim joined 02:25 BenGoldberg joined 02:46 _28_ria left 02:47 _28_ria joined, _28_ria left 02:54 _28_ria joined 03:03 _28_ria left, kjk_ joined
kjk_ how do you split a string from the right, only once. I.e., is there something like 'a,b,c,d'.rsplit(',', 2) which would give me ('a,b,c', 'd') ? 03:06
skink m: 'a,b,c,d'.split(',')[*-1] 03:11
camelia ( no output )
skink m: say 'a,b,c,d'.split(',')[*-1]
camelia rakudo-moar 40a953: OUTPUT«d␤»
skink @ kjk_
Not the most efficient but it works 03:12
skids kjk_: What's the "2" supposed to do?
kjk_ skids: thanks. 2 should limit the split to 2 segments 03:13
i'm actaully trying to get 'a,b,c' and 'd' without writing too many steps, but can't think of a shorter way 03:14
Xliff is learning Test.pm 03:15
If I do "use-ok" is the module actually loaded?
kjk_ p6: my ($h, $t) = 'a,b,c,d'.split(',')[^(*-1), *-1]; $h.join(',').say; $t.join(',').say 03:16
camelia rakudo-moar 40a953: OUTPUT«a,b,c␤d␤»
skids m: say ("a,b,c,d" ~~ /(.*)","(.*)/)[*] 03:17
camelia rakudo-moar 40a953: OUTPUT«(「a,b,c」 「d」)␤»
astj Xliff: As long as I know, `use-ok` just checks whether loaded, doesn't load 03:18
kjk_ skids: nice, that's what i wanted! thanks
Xliff astj: Thanks. 03:19
skids kjk_: Just be aware those are Match objects not Str, in case it matters.
m: (.Str for "a,b,c,d" ~~ /(.*)","(.*)/).perl.say # in case it matters 03:20
camelia rakudo-moar 40a953: OUTPUT«("a,b,c", "d")␤»
kjk_ p6: ('a,b,c,d' ~~ /(.*)','(.*)/)>>.Str 03:21
camelia ( no output )
kjk_ p6: ('a,b,c,d' ~~ /(.*)','(.*)/)>>.Str.say 03:22
camelia rakudo-moar 40a953: OUTPUT«(a,b,c d)␤»
kjk_ got it, thanks, skids
skids Yeah, you could do >>. too. Actually I think that is now optimized not to prematurely thread, even. I just got into the habit of avoiding it ack when it was slow.
skink skids, Completely random: do you know much about building dynamic libs on Windows? 03:23
er, shared libs
skids No, I only use Windows at work, and only for dealing with apps that only run there. 03:24
skink mk nvm 03:27
Xliff Argh! Here's a thought. How do you not leak char * pointers returned by a nativelib? 03:30
skids Well, brute force, copy them to a buf and free them in a wrapper function 03:31
03:31 TEttinger joined
skids But I hope we can do better than that :-) 03:31
03:33 _nadim left
Xliff skids: Yeek! I guess I can do "native_free() is native('c') is symbol('free') is export {}" ? 03:36
Er...
skids I think "is native" may default to libc. 03:37
Or, any library already loaded maybe, which libc will be.
Also, why export it?
Xliff skids: Yeek! I guess I can do "sub native_free() is native is symbol('free') {}" ?
LOL. I'm lazy.
skink is native(Str) is what you want
for stdlib stuff 03:38
Xliff *sigh*
skink: "sub native_free() is native(Str) is symbol('free') {}" ?
skink { ... } or { * }
Xliff kk 03:39
skink not actually sure of the difference of those two
Xliff Can I make a conditional check to see if it already exists before redefining it?
skink also you'll want to pass it {C}Pointer for its argument
skids ... is stub code. You'd want *.
skink if defined symbol or something like that 03:40
skids m: use NativeCall; sub malloc(int64) is native is symbol("malloc") returns Pointer { * }; sub free(Pointer) is native is symbol("free") { * }; free(malloc(32)) 03:45
camelia ( no output )
skink is symbol is redundant if your sub name and the symbol name are the same 03:46
skids oh cool. 03:47
skink I _think_ just 'is native' will do C stdlib, and 'is native(Str)' will be any C lib currently loaded, including stdlib 03:51
Docs aren't fully clear
m: use NativeCall; sub malloc(uint64) returns Pointer is native { * }; say malloc(32); 03:52
camelia rakudo-moar 40a953: OUTPUT«NativeCall::Types::Pointer<0x5c55220>␤»
sortiz skink, is native; and is native(Str) do the same thing. Search the symbol in any already loaded lib. 03:53
skink That's what I first thought
sortiz In linux dlopen(3) and dlsym(3) are used. 03:55
skink Yay you can double-free and segfault your script :) 03:57
sortiz yep 03:58
skink Xliff, Docs have what is basically a CPointer class with a free() method 03:59
doc.perl6.org/language/nativecall#B...f_Pointers
Xliff Thanks.
04:00 skink left
sortiz Btw, for unversiones libs a 'is native(('foo', False))' or 'is native(('foo', Version)) do the trick, the warning was removed in 2016.02 04:02
So now an 'is native("foo")' suffice. 04:05
04:13 liztormato joined 04:14 liztormato left, geekosaur left 04:16 geekosaur joined 04:21 Cabanossi left 04:22 Cabanossi joined 04:32 lizmat joined
lizmat waves from the Irish Sea 04:33
sortiz \o lizmat 04:34
lizmat sortiz o/
04:35 kjk_ left
lizmat commute further& 04:36
04:36 lizmat left 04:41 khw left 04:42 khw joined 04:46 matiaslina joined, BenGoldberg left 04:48 molaf left 04:55 matiaslina left, matiaslina joined 05:01 khw left 05:02 skids left 05:05 _28_ria joined 05:10 dysfun left
Xliff Hrm, 05:12
How do I handle a situation where a nativelib wants to pass a pointer to a buffer and have Perl6 properly interract with that buffer?
I know there is Buf, but the nativelib is expecting char *. 05:13
05:14 djbkd left 05:15 djbkd joined
Xliff And I'm getting this weird error on and off, even if I haven't changed the script. 05:19
Malformed UTF-8 at line 1 col 4
in method CALL-ME at sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 301
05:20 djbkd left 05:23 CIAvash joined 05:24 djbkd joined 05:30 rindolf joined
Xliff m: my @a = <a b c>; for @a.kv -> $k, $v { say "$k/$v"; } 05:32
camelia rakudo-moar 40a953: OUTPUT«0/a␤1/b␤2/c␤»
05:46 perlawhirl joined 05:55 geekosaur left 05:56 geekosaur joined
psch m: say so Same 06:03
camelia rakudo-moar 40a953: OUTPUT«False␤»
06:04 Relsak left
psch m: say so $_ cmp 1 for ^3; 06:04
camelia rakudo-moar 40a953: OUTPUT«True␤False␤True␤»
psch that did surprise me, but Order being an enum with the values -1, 0, 1 as is customary for comparisons does explain it easily 06:05
Xliff: "passing a pointer to a buffer"? as in, your native function takes a char * and you want to do other things to that after the function returns? 06:08
Xliff psch: as in the native function returns a pointer to a buffer and I want to write into it, rather than reassigning it. 06:10
psch ah, i see
Xliff if $b is the buffer, I can't lose that. Other subsequent functions will try to write to it and fail. 06:11
I think I've solved it by changing the return type from Str to CArray[uint8]. However I'm still getting failures in my tests. 06:12
I'll probably gist it, tomorrow. Getting a little tired, now.
psch t/04-nativecall/15-rw-args.{t,c} seem related
i don't really know NC particularly well... :)
Xliff Yeah. I'll look into that. Probably similar to what I'm doing now: 06:13
my $data = $fh.read(4096);
for $data.subbuf(0).kv -> $i, $c {
$b[$i] = $c;
}
Still wish there were a cleaner way to do it.
06:16 sjoshi joined
psch m: sub prefix:<C>(Int $x?) { 0 + $x * 12 }; sub foo(:$root) { say "got $root" }; foo C4; foo C 06:23
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/djtD2Xa5kU␤Prefix C requires an argument, but no valid term found␤at /tmp/djtD2Xa5kU:1␤------> 3root) { say "got $root" }; foo C4; foo C7⏏5<EOL>␤ expecting any of:␤ prefix␤»
psch heh, optional arguments on prefixes probably isn't a great idea anyway :S 06:24
m: enum <C D E>; sub prefix:<C>(Int $x) { 0 + $x * 12 }; say C4 06:25
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3nJXQrRqxs␤Undeclared name:␤ C4 used at line 1␤␤»
psch m: enum <C D E>; sub prefix:<C>(Int $x) { 0 + $x * 12 }; say C 4
camelia rakudo-moar 40a953: OUTPUT«48␤»
psch m: sub prefix:<C>(Int $x) { 0 + $x * 12 }; say C4
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ypyRcn2hop␤Undeclared name:␤ C4 used at line 1␤␤»
psch right, <ident> 06:26
06:30 nakiro joined
psch needing the space definitely is somewhat inconvenient 06:31
'cause i don't really want an enum with 88 members
although between those options i'd probably pick that because it's faster too
06:38 _mg_ joined 06:46 matiaslina left
psch m: my %m = a => 1, b => 2; subset MStr of Str where * eq any %m.keys; say 'a' ~~ MStr # works 06:47
camelia rakudo-moar 40a953: OUTPUT«True␤»
psch m: class C { my %m = a => 1, b => 2; subset MStr of Str where * eq any %m.keys; method m(MStr $x) { say "ok" } }; C.m('a') # doesn't?
camelia rakudo-moar 40a953: OUTPUT«Constraint type check failed for parameter '$x'␤ in method m at /tmp/sjyEAAwMyE line 1␤ in block <unit> at /tmp/sjyEAAwMyE line 1␤␤»
06:50 espadrine joined 06:53 zoofood joined 06:58 zoofood left
MadcapJake what's this error mean: "Bytecode validation error at offset 158, instruction 25: operand type 32 does not match register type 24" 07:05
in NativeCall code
psch m: class A { has uint8 $.x; submethod BUILD(uint8 :$!x) { } }; A.new(:x(5)).perl.say 07:09
camelia rakudo-moar 40a953: OUTPUT«Bytecode validation error at offset 102, instruction 16:␤operand type 160 does not match register type 136␤ in block <unit> at /tmp/lnnvsI6cVQ line 1␤␤»
psch hm, similar but not the same
MadcapJake: well, it is a type mismatch
psch checks which types
07:09 wamba joined 07:10 Jonis left 07:11 Jonis joined
psch hmm, i'm not seeing a register typ 24 07:12
+e
07:13 djbkd left
psch MadcapJake: i'd guess it got an int64 but expected int32 07:13
MadcapJake: that's at least what MoarVM/src/core/interp.h leads me to believe :)
MadcapJake ok, thanks!
psch MadcapJake: i'm not completely sure that's somewhere in your control, though, because the byte code validation happens after p6-level type checks afaik 07:14
MadcapJake: in any case, checking for an existing ticket on the moarvm github or bugging jnthn about it might be a good idea 07:15
07:15 zakharyas joined
sortiz MadcapJake, RT#127813 07:21
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127813
masak good morning, #perl6 07:22
psch sortiz++
sortiz \o masak
MadcapJake sortiz, psch: thanks! I was just fiddling with the types and hit that one, I've since corrected my mistake :D
psch seems related to #127845
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127845
psch o/ masak
07:23 domidumont joined 07:28 domidumont left
sortiz psch, Yep, a simple native type as a named argument in *any* method trigger the problem. 07:28
07:28 domidumont joined 07:29 fireartist joined 07:31 abraxxa joined 07:33 vendethiel left 07:34 cpage_ joined 07:37 perlawhirl left
masak I had some more time to develop that heroku web app this weekend 07:37
I was struck by not just how wide apart the database world is from the server backend world, but also how wide apart the server frontend world is from the server backend world 07:38
it's like you're writing three separate things, and making them interoperate
I almost feel like writing a blog post about that
s/it's like // 07:39
07:40 abraxxa left 07:41 abraxxa joined, sortiz left
psch m: my &x = -> uint8 $x { } 07:44
camelia ( no output )
psch m: my &x = -> uint8 $x { }; &x(4)
camelia ( no output )
psch m: my &x = -> uint8 $x { say $x.WHAT }; &x(4)
camelia rakudo-moar 40a953: OUTPUT«(Int)␤»
moritz masak: re blog, please do :-) 07:45
psch m: my &x = -> uint8 $x { say $x.WHAT }; &x("foo")
camelia rakudo-moar 40a953: OUTPUT«This type cannot unbox to a native integer␤ in block <unit> at /tmp/ueVk8OhwqC line 1␤␤»
psch *that* is interesting...
so native types work for pointy block but nothing deeper in the Code hierarchy..?
moritz psch: they don't work as named arguments 07:46
psch oh of course, duh 07:47
moritz psch: they seem to work fine as positionals for every possible type
psch moritz: yeah, thanks for the hint. i apparently wasn't paying enough attention once again :)
masak moritz: the architect/developer in me wants to "unify" those three domains, but at the same time, the three things I'm writing are related but very different; not copies of each other
psch m: my &x = -> uint8 :$x { say $x.WHAT }; &x(:2x) # yeah... 07:48
camelia rakudo-moar 40a953: OUTPUT«Bytecode validation error at offset 40, instruction 6:␤operand type 160 does not match register type 136␤ in block <unit> at /tmp/w7jpbpoVC8 line 1␤␤»
masak moritz: learning from 007, what I probably should aim for is really good consistency tests establishing constraints across the three domains
07:49 vendethiel joined 07:52 polyfloyd left 07:54 polyfloyd joined 08:06 labster left 08:10 dakkar joined 08:11 vendethiel left 08:12 ocbtec joined 08:14 darutoko joined 08:17 pRiVi left 08:19 RabidGravy joined 08:23 _mg_ left 08:24 pRiVi joined 08:26 [particle] left, [particle] joined 08:33 g4 joined, g4 left, g4 joined
RabidGravy boom 08:37
masak shaka laka
Xliff Fucking christ, why do I plague myself with NativeCall?! 08:38
psch: Fixed it. Using wrong var! :P
masak ponders whether to ask for more civil language, or at least language proportional to the occasion 08:41
Xliff is properly chagrined. 08:42
masak: If you've spent the last 6 hours trying to fix a single bug, what language would you use?
masak COBOL. 08:43
ufobat morning perl6 :)
masak Xliff: you may not know me very well, but I do spend 6 consecutive hours fixing a single bug quite frequently... :)
Xliff: be that as it may. "we're all adults here", and I'm trying hard not to police people. just reminding kindly that we're trying to be inclusive enough that people should feel fine to send 8-year-olds in here if they want. 08:44
Hotkeys Mornin 08:47
RabidGravy yeah, anyone who knows me would confirm that I use language appropriate to a rather outraged docker most of the time and even *I* tone it down here 08:48
masak .oO( using docker is another reason to use extreme language ) 08:49
RabidGravy speaking of which www.youtube.com/watch?v=PivpCKEiQOQ - which is definitely not safe for work, minors or the sensitive 08:51
Xliff Ah. I avoided docker, today!
\o/
08:51 _mg_ joined
masak RabidGravy: watched that one this morning :) probably was at the back of my mind when I thought the above :P 08:51
08:53 bjz joined
RabidGravy :) 08:54
08:55 _mg__ joined 08:57 bjz_ joined, _mg_ left, _mg__ is now known as _mg_, Actualeyes left, bjz left 08:59 sue_ joined
Xliff YESS!!! 09:00
\(◦'⌣'◦)/ 09:01
Finally got a proper ogg read loop that fills the ogg_page. 09:02
RabidGravy cool
09:02 araujo joined
Xliff All this to test the ogg container functions. 09:04
I may test stream read functions, but this is a good stopping point for the night.
Now I feel better. :p
'night #perl6 09:05
o7
09:05 Xliff is now known as Xliff_Zzzzz
masak 'night, Xliff_Zzzzz 09:06
09:15 araujo left, bjz_ left 09:20 espadrine left 09:30 sue_ left, araujo joined 09:34 vendethiel joined
RabidGravy wonders idly how many shift register parts he has in the house 09:35
that is those that are not already in something, I had a quite amusing idea involving an ATTiny85 and a shift register last night 09:39
I mean all this making drum beats with software is fine but, well, it's just not hardware 09:40
09:47 diakopter joined 09:51 sue joined 09:55 vendethiel left 09:59 espadrine joined, nolaan joined 10:05 bjz joined 10:06 perlawhirl joined 10:07 kaare_ joined 10:12 kid51 joined 10:17 zakharyas left 10:19 TEttinger left
shadowpaste0 "nolaan" at 217.168.150.38 pasted "no output" (1 line) at fpaste.scsys.co.uk/510089 10:19
10:20 zakharyas joined 10:22 nolaan left 10:31 vendethiel joined 10:37 AlexDaniel left 10:50 sue left 10:51 smls joined, sue joined 10:52 vendethiel left
smls Has anyone else experience on creating a Grammar for an INI-like format where the allowed keys and values should be hard-coded and validated directly in the grammar? 10:52
I tried to abstract the key-value lines using a parameterized token 10:53
multi token field ($key, $value)
And it parses fine, but then I can't get at the AST that was .made by the $value sub-regex 10:54
(full golfed code: gist.github.com/smls/551c805ea1e85...6e81e012f)
(This is also the context of RT 127872 which I reported yesterday.)
10:56 dvinciguerra_ joined 10:57 vendethiel joined
smls Is there a completely different approach to this kind of problem that I should try? 10:57
10:58 s_kilk joined, s_kilk left
psch m: my token foo($x) { <$x> } 11:00
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MacO6H3SBb␤Variable '$x' is not declared␤at /tmp/MacO6H3SBb:1␤------> 3my token foo($x) { <7⏏5$x> }␤»
psch m: grammar G { token foo($x) { <$x> } }
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/V7PFfdhhmM␤Variable '$x' is not declared␤at /tmp/V7PFfdhhmM:1␤------> 3grammar G { token foo($x) { <7⏏5$x> } }␤»
smls Yeah I tried those too ;) 11:04
m: my token foo($value) { $<value>=$value }
camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤Cannot find method 'rxtype'␤»
smls And that one
psch i think we do something like that in Perl6::Grammar or HLL::Grammar
ah, but as methods 11:05
not sure what exactly you have to do inside the method to let it match or not 11:08
m: grammar G { method foo($x) { my $srule = /<$x>/; self.CALL_SUBRULE($srule) } }; say G.parse("foo", rule => 'foo', args => "foo") 11:12
camelia ( no output )
psch hrm
$ ./perl6-m -e'grammar G { method foo($x) { my $srule = /<$x>/; self.CALL_SUBRULE($srule) } }; say G.parse("foo", rule => "foo", args => \("foo"))'
「foo」
smls: ^^^ that might help
the various Grammar.nqp throught rakudo and nqp probably have more extensive examples 11:13
smls neat, I'll have a look
psch ...i do suspect there's a less internals-heavy way, though 11:17
and maybe if what you have/had parses but just lost a .made somewhere that should be ticketed
11:19 adhoc joined
smls Well it's not that it 'looses' the .made, but that when you call a subregex with the $foo syntax it does not become a capture of the current regex like it would for <&foo>. 11:20
11:20 s_kilk joined 11:21 vendethiel left
jnthn It woudln't for <&foo> 11:21
smls Why not? 11:22
psch ah, that's the rxtype error above
jnthn You have to write <foo=&foo>
smls Ah, right
jnthn smls: Nothing that is < followed by some non-alpha captures.
Seen another way, <foo> is really cute for <foo=.foo> :)
(Didn't read the whole discussion fwiw, just spotted this last bit while on my way to lunch :)) 11:24
smls np
psch hm, but normal args to a rule is apparently broken 11:25
RabidGravy downloads some frankly scary mellotron samples (which is kind of meta as the mellotron itself was a primordial "sampler")
psch i wasn't sure that was allowed, but i did write code that uses it somewhat over a year ago
which suggests we don't test that sufficiently, if at all 11:26
well, or it got tossed :)
hm, no, there is a test 11:31
oh
isn't it just the way < > do lookup inside a grammar
m: my token foo($x) { $x };
camelia ( no output )
smls m: my token foo { :my &a = /a/; <&a> } 11:32
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CJBNMdW8Y7␤Undeclared routine:␤ a used at line 1␤␤»
smls psh: It's not just with args; lexicals defined inside the regex don;t work either. ^^
m: my &a = /a/; my token foo { <&a> } 11:34
camelia ( no output )
smls ^^ It seems the <&foo> syntax only likes lexicals that were declared *outside* of the regex.
psch it's something like that, afair 11:35
$ ./perl6-m -e'grammar G { constant $x = "foo"; token TOP($x) { $x <$x> } }; G.parse("barfoo", args => \("bar")).say' 11:38
Nil
this feels like it should match
(i don't trust camelia at the moment :P )
mind, there's probably something i'm misunderstanding, so there :) 11:39
smls: it makes sense though, considering that inside a Grammar when you write <foo> (which means <foo=.foo>, as jnthn++ pointed out) you don't want $current-rule.foo, but $grammar.foo 11:40
smls psch: It does match if you say &x and <&x>
psch ah, interesting
smls psch: Yeah, but that's for <foo>. Isn't <&foo> specifically meant to look up foo from the lexical scope. 11:41
psch smls: the one that the current rule lives in, is my understanding. not the one inside the current rule
smls Why not though? 11:42
(Also, <$foo> does EVAL-interpolation, I think, so that's why it needs to be <&foo> in you last example.)
psch ...i'm not the right person to talk about any of the whys behind the design :) 11:43
11:49 kid51 left 11:54 sjoshi left 11:56 telex left 11:58 telex joined 11:59 _mg_ left 12:09 Actualeyes joined 12:11 _mg_ joined 12:13 Sgeo left 12:15 pmurias joined
nine .uni download 12:18
.u download
yoleaux No characters found
nine .u print 12:19
yoleaux U+2399 PRINT SCREEN SYMBOL [So] (⎙)
U+329E CIRCLED IDEOGRAPH PRINT [So] (㊞)
U+1F43E PAW PRINTS [So] (🐾)
12:22 dvinciguerra_ left
[Coke] masak: irclog.perlgeek.de/perl6/2016-04-11#i_12316661 - this reads like you discovered a 3-tier web app. 12:24
12:24 adhoc left
masak [Coke]: you mean irclog.perlgeek.de/perl6/2016-04-11#i_12316609 ? yes, I suppose it does. 12:26
I mean, I've been aware of the UI/business/DB separation for a long time
but I don't think I've felt it as strongly as I do in this case, when what I have is a really small thing and I just want it to work as one unit
masak reads up on the Three-tier Application Model 12:27
maybe my feeling can be expressed as an urge to make my application one-tier, even when I know that's Wrong and/or Impossible 12:28
12:28 zakharyas left
[Coke] I'm so used to working on something that doesn't have full control over all the tiers; Or does, but doesn't have the freedom to make them all work together. It's just a cost of doing business, usually. 12:30
12:30 zakharyas joined
moritz it's also often the cost of a big(ger) business 12:30
especially if things become so big that separate teams are responsible for the separate layers 12:32
jnthn Splitting layers over teams is probably a great SRP violation at the human level :) 12:34
[Coke] Here's its that we don't have a clean separation of concerns. So we have 100 apps that may interaction with each other; but some do it at the DB level, some do it at a REST API level... might have 2 front ends to the same DB backend, some of the apps are 10+ years old, don't always have time to do things right, rarely have time to redo them right. Your standard mess.
*may have some interaction…
moritz [Coke]: ugh. Interaction at the DB level are the worst, usually. 12:36
12:36 g4 left
[Coke] checks his mail and finds that someone was working on RT this weekend! 12:37
12:37 dvinciguerra joined
[Coke] moritz: esp. if it's "oh, just let me see this table" instead of "give me a stored proc I can call and get a result set from" 12:37
jnthn Yeah, I've seen my share of DB-level integration. And it's nearly always against tables directly, not SPs.
Though time and time again I see teams utterly fail to think about namespaces and loose coupling in databases.
Leading to 1000-table monsters all tightly coupled together with primary keys. 12:38
uh
*foregin* keys
That combined with the thing being used for integration is an utter "oh crap..." 12:39
moritz well, if you don't use foreign keys, you can put it into a different database to start with :-)
jnthn I'm not saying "don't use foreign keys", more "don't have 1000 tables in the same database" ;) 12:40
masak I make this point in many of our courses 12:41
jnthn Finding boundaries in the domain though (bounded contexts, in DDD lingo) is pretty hard though.
You have to undertand the business. And think. Lots.
masak we've have the Structured Programming revolution in programming-land, followed on by even nicer things like OOP and FP 12:42
all there to help you modularize and "contain the damage" of code sprawl
jnthn Micro-services may help but only if people do the thinking part. :)
masak but we've never really had something like that for database-land
not on the same scale, at least. microservices might be the closest we've had to it
but I think DDD's "bounded contexts" are a much closer match 12:43
and that's definitely not common knowledge in the industry
jnthn Aye
masak people simply don't view "lots of foreign keys" as a cost/load
jnthn remembers a recent discussion with some folks who were thinking of doing microservices but not doing the bit where you have independent persistence per service 12:44
Arghh. :P
So yeah, in a few years we'll be talking about how microservices "didn't help" and be on to the next thing that'll save the world. 12:46
:P
12:46 vendethiel joined
masak "programming is pop culture" -- Alan Kay 12:47
moritz jnthn: well, if you do that (microservices without bounded contexts), you're basically just adding RPC inside a single application. Fun. 12:48
masak that's one way to view it, yes
nine But what about consistency and transactions when your database is split?
jnthn moritz: Yup
masak nine: well, there's 2PC and 3PC... :(
jnthn nine: That's why you have to look at the problem domain. To figure out where the *business* is non-transaction and eventually consistent. 12:49
(Any large organization will have a bunch of those places, because you can't scale n-to-n communication with people.)
moritz nine: often you want to heavily denormalize anyway. For example if a customer orders something, copy the shipping address and prices over to the order 12:50
masak jnthn: are you telling me I cannot simply apply cookie-cutter solutions to every new problem domain I encounter? I have to think every time? :P
timotimo ⅠPC, ⅡPC, and ⅢPC? :)
moritz nine: so that when a product price changes between order and shipment, the customer still pays what he ordered
nine: or that the shipment goes out the address it was meant to, not re-changed etc. 12:51
perlawhirl hi perlers
jnthn masak: Just get a "Think really hard"-shaped cookie cutter :)
nine moritz: that's not even denormalization if you think about it. Because in one place you're storing the customers current business address while in the other you're storing the shipping address for an order. They may read the same but are semantically different.
moritz nine: so there's no need to have transactions that span orders and products, for example :-)
masak moritz: yeah, thinking in terms of aggregates told me to value copying in many places where I had previously valued live-linking
perlawhirl i was asking about this gotcha with sort last night, i put it up in a gist: gist.github.com/0racle/134921795a6...554492d824 12:52
nine moritz: and even for the product price it's the "current product price" vs. "the product price at the time of order" which are close but not the same.
masak this is not really a concession to bounded contexts -- more like, the bounded contexts are already there, and you're discovering that you shouldn't couple them
perlawhirl jnthn: ^^ just wanted your opinion on whether this is something that needs to be addressed and if so, the best way to solve it... then maybe i could start working on a PR 12:53
pmurias re separate things, with rakudo-js targeting the frontend part, rakudo-moar the backend part, the interesting question is will we have anything targeting the db part
moritz nine: but if you implement it with copying, you can get rid of a transaction spanning all those things 12:54
masak perlawhirl: we might be able to accept both a positional and a named :&by parameter
perlawhirl: but it's an API change, so we have to be cautious about it
moritz pmurias: maybe rakudo-pg, which implements Perl 6 in Postgres?
pmurias: not compilation to postgres, but offers Perl 6 stored procedures :-)
perlawhirl yeah i know... don't wanna break sort(*.chars) so can't just change it to :&by... so what's the answer?
masak perlawhirl: I can see two possible fixes 12:55
perlawhirl: (a) make :&by work just like the positional 12:56
perlawhirl: (b) accept :&by, but die at runtime with an error saying to use the positional
jnthn Not b, because we as a rule don't complain about unknown names passed to methods
(Interface consistency) 12:57
Doing (a) could perhaps be reasonable
masak ISTR we already have a :&by for the sub form, is that correct?
jnthn I don't know how it'd cause a bug to "sneak it". It'd just have never worked in the first place
masak that would suggest that (a) is even more desirable
jnthn: yeah, it seems fairly risk-free when I think about it 12:58
basically a non-invasive API addition
nine moritz: ah, just write those stored procedures with Inline::Perl6 ;) PostgreSQL doesn't need to know about it...
moritz nine: :-)
perlawhirl jnthn: if the data happens to sort alphabetically in the same order as the :by would have sorted it, then it may go unnoticed... until it doesn't
masak maybe if someone has subclassed Positional somewhere and added their own :&by to .sort in the ecosystem -- but I think we can safely rule that out
not even in the darkpan
jnthn perlawhirl: Time to write more tests! ;) 12:59
13:04 cdg joined 13:05 michel_mno joined
michel_mno Hi there, I do not know anything about nqp, hope this is the correct channel. There is a test error while make check is done on nqp on PowerPC ppc64 bigendian archi as per build.opensuse.org/package/live_bu...dard/ppc64 it is about t/nqp/59-nqpop.t reported failure, Is is a known problem ? and if not what is suggestion for investigation ? 13:11
13:12 wamba left
timotimo can you manually run t/nqp/59-nqpop.t with nqp-m and see what the exact output is? 13:12
masak that is, `nqp-m t/nqp/59-nqpop.t` 13:13
13:14 wamba joined
timotimo yeah 13:14
nine Intriguing...it's the sha1 test 13:15
timotimo huh? but we use third-party code for that! 13:16
and third-party code is always correct, isn't it?
13:19 _nadim joined
masak m: macro swap($a, $b) { quasi { ({{{$a}}}, {{{$b}}}) = {{{$b}}}, {{{$a}}} } }; my $w = 5; my $z = 10; swap $w, $z; say [$w, $z].perl 13:24
camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CD2CZgHkAk␤Use of macros is experimental; please 'use experimental :macros'␤at /tmp/CD2CZgHkAk:1␤------> 3macro7⏏5 swap($a, $b) { quasi { ({{{$a}}}, {{{$b»
13:24 cschwenz joined
masak m: use experimental :macros; macro swap($a, $b) { quasi { ({{{$a}}}, {{{$b}}}) = {{{$b}}}, {{{$a}}} } }; my $w = 5; my $z = 10; swap $w, $z; say [$w, $z].perl 13:24
camelia ( no output )
masak hruh.
timotimo is camelia's output module still acting strange?
m: say "hello, i'm fine"
camelia ( no output )
masak it only outputs errors? :(
timotimo perhaps :(
nine m: say "hello" 13:25
camelia rakudo-moar 40a953: OUTPUT«hello␤»
nine It still likes me 13:26
13:26 CIAvash left
cschwenz (backstory: i found $foo.chars() which returns the number of graphemes in string $foo.) and now for what i'm really looking for: how do i go about finding the byte length of string $foo? 13:26
nine cschwenz: strings do not have a byte length. Byte buffers that contain string data in some encoding do. So you really want to ask "what's the byte count of this UTF-8 encoded string data?" 13:27
cschwenz yes, exactly that :-)
nine cschwenz: So you just need to translate this more precise question to Perl 6 ;)
13:28 s_kilk left
cschwenz nine: would i create a Buf object for that? 13:28
timotimo you don't have to do it manually, perl6 can do it for you 13:30
cschwenz how so? 13:31
timotimo try the "encode" method on a Str object
cschwenz i've been spelunking through doc.perl6.org and it's entirely non-obvious how to go about getting the byte length of an UTF-8 encoded string. :-( 13:32
Juerd If it's utf-8 encoded, it's a blob or a buf, and the number of elements is the number of bytes.
If it's a str, it's not encoded (conceptually). 13:33
timotimo that's right
cschwenz m: my $foo = "asdf→zxcv"; $foo.encode("raw"); say $foo.chars(); 13:35
camelia rakudo-moar 40a953: OUTPUT«Unknown string encoding: 'raw'␤ in block <unit> at /tmp/cxgph8nELy line 1␤␤»
timotimo "raw"?
cschwenz m: my $foo = "asdf→zxcv"; $foo.encode("ascii"); say $foo.chars();
camelia ( no output )
smls m: say "äâá".encode("UTF-8").bytes
camelia ( no output )
timotimo well, camelia is currently broken when it comes to outputting stuff
smls ^ prints 6 locally
Juerd cschwenz: Note that .encode *returns* the encoded string 13:36
cschwenz i tried "raw" as there is an overwhelming abundance of documentation around what constitutes a valid encoding
13:36 g4 joined
Juerd cschwenz: It doesn't change the type from str (unencoded) to buf or bool (encoded) on the original object 13:36
cschwenz m: my $foo = "asdf→zxcv"; say $foo.encode("ascii").chars(); 13:37
camelia rakudo-moar 40a953: OUTPUT«Error encoding ASCII string: could not encode codepoint 8594␤ in block <unit> at /tmp/ylOekpX82T line 1␤␤»
Juerd cschwenz: $encoded = $unencoded.encode(...); or $foo.=encode(...);
ASCII doesn't support →
cschwenz okay, back to the original question: how do i get perl6 to tell me how many bytes long a string is? 13:38
m: my $foo = "asdf→zxcv"; say $foo.encode("utf-8").chars();
camelia rakudo-moar 40a953: OUTPUT«Cannot use a Buf as a string, but you called the chars method on it␤ in block <unit> at /tmp/GZptMtEiPa line 1␤␤»
jnthn m: my $foo = "asdf→zxcv"; say $foo.encode("utf-8").bytes
camelia rakudo-moar 40a953: OUTPUT«11␤»
smls cschwenz: Use the .bytes method on the encoded buf, not .chars
cschwenz aha! thanks! :-)
timotimo .chars will turn the buffer into its string representation and give you the number of characters it takes for that 13:39
yoleaux No characters found
cschwenz ah, enlightenment++
timotimo oh, interesting
13:40 sue left
timotimo the .Str on a utf8 object actually spits out the utf8-encoded result directly 13:40
and .chars will helpfully tell you "Cannot use a Buf as a string, but you called the chars method on it"
nine m: my $foo = "asdf→zxcv"; say $foo.encode.bytes # even shorter 13:41
camelia rakudo-moar 40a953: OUTPUT«11␤»
13:46 RabidGravy left 13:50 RabidGravy joined
teatime timotimo: 'long double' perhaps 13:54
13:56 mcsnolte joined 13:57 skids joined, ptolemarch joined 14:02 cschwenz left 14:06 chrisdotcode left 14:08 sue joined 14:11 khisanth_ left 14:16 tharkun left 14:18 tharkun joined, g4 left
RabidGravy boom 14:22
hoelzro o/ #perl6
14:25 khisanth_ joined 14:41 telex left, fireartist left 14:42 telex joined 14:59 Begi joined, khw joined 15:05 vendethiel left
hoelzro so it seems that &EXPORT can't override behavior for tags; is that something that could change in 6.d? 15:16
15:16 nakiro left, tharkun left, tharkun joined
hoelzro I ask because I was working on a Fcntl module on Saturday, and I would really like for users of that module to be able to specify which spec or non-portable extensions they need (ex. `use Fcntl :posix`, `use Fcntl :linux<4.0.0>`) 15:17
15:18 kurahaupo joined
RabidGravy hoelzro++ # Fcntl 15:19
jnthn hoelzro: And you can't just export the stuff you want to under those tags? 15:21
(With is export...)
hoelzro jnthn: well, I was hoping to offer some more intelligent feedback to the user if their request isn't possible
ex. if `use Fcntl :linux` is used on OS X 15:22
jnthn Maybe something like EXPORT.WHO does { method AT-KEY($key) { ...error detection...; nextsame() }
hoelzro ah, good suggestion! thanks! 15:23
15:37 perlawhirl left, kurahaupo left 15:52 pmurias_ joined 15:53 abraxxa left 15:55 pmurias left
dogbert2 Hi #perl6 15:57
Begi dogbert2: hi !
15:57 smls_ joined
dogbert2 What do you do if you've found an error in the Perl6 documentation, report it here? 15:57
timotimo either here or file an issue in the repository; the bottom of the documentation has a link to the right repository
15:58 smls left
dogbert2 I guess that entails creating a github account? 15:58
timotimo yeah, if you don't have one, just report it here in the chat
15:59 _mg_ left
dogbert2 with a pastebin? 15:59
Begi and someone will report in GH
dogbert2: what's the error ?
dogbert2 cool, one sec
timotimo any pastebin you like will be fine
teatime reads the topic, thinks 'UTF-8 is our Ýäfriend' or something would be funnier. 16:01
also apparently the postal system comprehends mojibake?
dogbert2 gist.github.com/anonymous/f50b01c0...372bf8f75c 16:02
16:02 sue left
dogbert2 Not the biggest error ever :) 16:02
16:04 vendethiel joined 16:06 Xliff_Zzzzz left
Begi dogbert2: you're right, thanks ! 16:08
and to correct it : github.com/perl6/doc/pull/447 16:09
dogbert2 Thx, Begi++
16:10 domidumont left, zakharyas left
dalek c: ba48ee7 | Emeric54++ | doc/Type/Cool.pod:
Update Cool.pod (#447)
16:11
Begi nice, dalek if faster than the GH's mails 16:12
timotimo probably only a matter of "github invokes the http hooks earlier than sending out emails" 16:13
dogbert2 Impressive
timotimo or maybe because the http hook that invokes dalek hangs off of the repository itself, whereas you getting the mail depends on "who is the owner of this issue?" 16:17
16:20 smls_ left 16:24 gorgor left
dogbert2 so, what to do with the profiler bug which I failed to report to [email@hidden.address] (it never showed up) a few days ago? 16:34
16:35 Azry left
dogbert2 golf ([Coke]++) perl6 --profile -e 'my @m[5]' 16:35
16:36 Azry joined 16:42 dakkar left
hoelzro jnthn: hmm...it seems that idea won't work; nqp::existskey is used to check for the tag, and that doesn't seem to call EXISTS-KEY (not in my experiment, at least) 16:42
16:55 xchg_ left 16:56 pmurias_ left 17:03 domidumont joined 17:04 dha joined 17:08 CIAvash joined
timotimo yeah, nqp::existskey directly involves the underlying repr 17:08
we might want to fall back to the EXISTS-KEY method for a second opinion 17:09
psch i'd almost say do it the other way around
timotimo depends on if it's on a hot path or not
psch as in, do EXISTS-KEY first if it exists on EXPORT.WHO
well, but if the key exists on EXPORT and we find it with nqp::existskey we don't know if we need to go via EXISTS-KEY 17:10
whereas when it doesn't exist we only waste a look into the method cache
of course this is local to the importing code 17:11
17:12 michel_mno is now known as michel_mno_afk 17:16 dbohdan joined
psch timotimo: maybe i misunderstand, but finding the key with nqp::existskey and then asking EXISTS-KEY if it exists (and running it in case it does extra magic like hoelzro needs) seems always slower than checking if EXISTS-KEY exists, running it if does and falling back to nqp::existskey if it doesn't 17:16
i mean, from a purely "what gets called" perspective. i didn't measure, obviously... :) 17:17
17:22 dbohdan left, spider-mario joined 17:23 dbohdan joined 17:27 dbohdan left 17:29 dbohdan joined
timotimo running the exists key method is an invocation, whereas nqp::existskey is just a c function being executed 17:30
17:30 vendethiel left
timotimo the difference in speed is gigantic 17:30
17:32 bjz left
psch oh, Stash is Hash 17:32
yeah, that's what i was missing
EXPORT is a Stash, which means it always has an EXISTS-KEY
17:33 vendethiel joined
psch so yeah, i agree :) 17:34
17:34 hankache joined 17:35 erdic joined 17:37 mephinet joined
hankache hello * 17:38
psch i guess that means EXISTS-KEY is not really the right tool there... 17:41
17:46 bjz joined 17:47 mephinet left 17:49 mephinet joined
psch m: use Test; Test::EXPORT::.WHAT.say 17:52
camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤Could not map file '/home/camelia/.perl6/precomp/A1D20F7149E8A97341C8BBB59F89F128BA0382C8.1460121023.85513/C7/C712FE6969F786C9380D643DF17E85D06868219E' into memory: FIXME␤»
psch ...neat?
17:53 firstdayonthejob joined, molaf joined 17:55 sortiz joined
sortiz \o #perl6 17:55
timotimo hello sortiz 17:56
hankache yo 17:58
18:04 CIAvash left 18:06 hankache_ joined 18:09 hankache left 18:16 nige1 joined 18:21 hankache_ left
nige1 hi - just wanted to pop in to make a little announcement 18:23
18:23 _mg_ joined
nige1 a while back - I mooted the idea of "SixFix" - a dose of Perl 6 over email 18:23
i've finished the first series and it goes for 7 weeks 18:24
18:24 Xliff joined
nige1 you get one SixFix per week (provided you answer the question each week) 18:24
perlpilot nige1: where do I get my SixFix? ;) 18:25
nige1 :-)
you can sign up here: sixfix.nigelhamilton.com
Xliff \o #perl6
What is a SixFix? 18:26
perlpilot Visit the URL
nige1 a week Perl 6 question and small coding challenge
weekly
perlpilot nige1: Are you going to advertise heavily?
Xliff Hmm.... signed up.
nige1 was hoping people could share the link -
cool :-) 18:27
dha Eep. building rakudo from the git repo, and I'm getting a failing test. who should I yell at? :-)
Xliff Now if I get spammed, I know where to redirect them to.
Eh, nige1?
^_^
perlpilot nige1: I don't know if it's a good idea to start off with an easter egg though. :) 18:28
nige1 yes - it's tricky - just wanted them to do something to install rakudo 18:29
and get something up and running
18:30 espadrine left
dha WTF? I just ran the tests again and now they're passing. :-/ I think I will give up trying to make sense of anything now. 18:31
timotimo some times are "flappy" sometimes ;( 18:32
perlpilot dha: some of the async tests are known to be flappy. Was it one of those?
dha it was t/04-nativecall/13-union.t - said it declared 28 tests but only ran 26. But now, for some reason, it's happy. *shrug* 18:33
RabidGravy cosmic rays 18:36
perlpilot nige1: the more I think about it, the more of a mistake it seems to start of with an easter egg. Yes, we should have a sense of humor, but no, it's not the best way to introduce people to the language. SixFix could be a great way to get people started, but it could also alienate people if done poorly. 18:38
nige1 ok - I'm hearing you - it might help to see it in the context of the rest of the questions/challenges 18:41
the first week is really to get people up and running with rakudo 18:42
18:44 cdg left
RabidGravy oh github, are you playing up again 18:49
dha So, if I'm panda installing Task::Star, is there a known reason why DBIish would be failing? 18:53
stmuk dha: I think it's a recent change which broke DBIish 18:54
dha Aha. So, is there a recommended way around that? (for installing Task::Star, not fixing DBIish, which I assume is a more complicated problem) 18:55
18:55 Sqirrel joined
stmuk DBIish @ 09835a3 should work 18:55
checkout that version from github and install and then reinstall Task::Star 18:56
dha I will now figure out how to do that. :-) Thanks. 18:59
19:01 domidumont left
Xliff nige1, FWIW I agree with perlpilot. You might want to play that first question straight and offer up the easter egg as a "try this cool thing, next". 19:12
19:12 _nadim left
nige1 ok - any suggestions for a play it straight question? 19:13
19:17 ZoffixW joined
ZoffixW is it at all correct to call "is export" a *role* rather than a trait? sub foo is export {...} 19:17
hoelzro ZoffixW: traits are roles applied at compile time 19:18
ZoffixW Ah
Thanks.
19:21 hankache joined 19:22 ParsonsNose left
masak I've now read slightly too many documents about three-tier systems. 19:23
they're all quite boring, and they agree on too many things :)
vendethiel :P 19:24
masak mostly they go on about how the separation of the three tiers is so good -- bla bla, re-use, scalability, flexibility
19:24 yqt joined
vendethiel wrong documents then 19:24
masak that separation is what made me wake up and want something better in the first place
19:25 pdcawley_ left, pdcawley joined
masak the three tiers, at least in my case, run in not just three different languages but three different environments/runloops 19:25
who designed this and then sat back and said "mm, nice"? 19:26
:P
hankache what's wrong with monoliths 19:27
?
;)
Woodi hankache: usually nothing is 100% perfect :) 19:28
masak Woodi: except regular dodecahedra. they're perfect.
hankache: from the perspective of my code being consistent across all the three tiers forced on me, a monolith is what I would like to have. 19:29
19:30 lucasb joined
masak I'm gradually coming to the realization that achieving this consists of writing thorough tests for the interfaces between the tiers. 19:30
lucasb in the REPL, if I type 'sub f { 42 }; f', it outputs 42 19:34
but if I type 'sub f { say 'hi'; 42 }; f'; it only says 'hi', omitting the 42
19:35 ZoffixW left
lucasb did this behaviour changed? 19:35
(damn, I need to leave now. I'll come back later :) 19:36
19:36 lucasb left
hankache m: sub f { say 'hi'; 42 }; f 19:36
camelia rakudo-moar 40a953: OUTPUT«hi␤»
hankache m: sub f { say 'hi'; 42 }; say f
camelia rakudo-moar 40a953: OUTPUT«hi␤42␤»
hankache lucasb ^^
sortiz dha, What is the problem you see with DBIish? 19:37
dha Damn good question. Not sure if I can find it now that I've installed the earlier version. 19:39
Woodi I want to scream when I see what *micro*-services become. probably becouse I initially imagined them as business entity, a micro-*service*, not an architecture... eg. buying tickets via SMS on the bus or buying/selling mp3 (temporary ownership (EVIL thing!)). or textures in Steam :) a "modern" internet - something more granular then monthly subscriptions... 19:41
Xliff nige1, Hmmm.... good question! =) 19:42
dha sortiz - attempting to recreate the issue now. Let me see if can make it spit at me.
sortiz dha Thank you. The latest DBIish should work with latest Rakudo Star, otherwise I would like to know. 19:43
dha sortiz - FWIW, I'm using the rakudo from github, not star.
nige1 ideally something that shows something interesting about Perl6 - but not too complex as it's the first thing they may type into it
Xliff nige1, What does «perl6 -e "say 'This is a dog'.WHAT"» output? 19:44
sortiz dha, well, better then.
Xliff A variationof what you already had, except the straight answer is "(Any)"
dha Do we have a paste application for this channel?
Xliff Then on the answer page you can say your original question and mention that perl6 has a sense of humor.
Play the easter egg off of the straight question.
That way you still get to reuse content. 19:45
nige1 yes - that's a good suggestion
Xliff m: say 42.WHY
camelia rakudo-moar 40a953: OUTPUT«(Any)␤»
Xliff m: say 42.WHAT
camelia rakudo-moar 40a953: OUTPUT«(Int)␤»
Xliff It would be nice if the easter egg worked in both directions, but I digress. 19:46
19:46 _nadim joined
shadowpaste0 "dha" at 217.168.150.38 pasted "DBIish Failure Summary" (127 lines) at fpaste.scsys.co.uk/510157 19:47
dha sortiz - there's the output from panda.
Xliff Ooh! fpaste? 19:48
dha apparently, yes. :-) 19:49
RabidGravy I'm guessing that it's not deealling very well with the inability to find the mysql client libraries 19:50
19:50 molaf left, Kroc joined
Kroc Good day. Would there be anybody to answer some noob questions please? 19:51
dha And possibly others. 19:52
hankache hi Kroc 19:53
masak hello Kroc -- fire away :)
Kroc Goo day. I am a competant enough programmer, but the Perl6 documentation is thin, and even googling draws a blank -- how do I read binary files in Perl6? I.e. extract Longs, Ints, Doubles &c. 19:54
masak oh, we should have a good go-to example of that, agreed.
Kroc: so, you have a binary file in some specified binary format, and you want to turn all those bytes into a data structure? 19:55
Kroc I have a binary file open -- `my $ioHandle = open( $ioPath, :bin );` but from that point I can't find any examples.
Yes, that's a good way to put it masak.
sortiz dha, Seems that somehow the recently added automatic library version detection for mysql is broken in you machine. 19:56
dha If you say so :-)
FWIW, OS X 10.10.5 19:57
sortiz In fact that was added for OS X, that uses a more recent version of mysql :-) 19:58
masak Kroc: perl6 -e 'my $fh = open("README.md", :bin); say $fh.read(1000)' 19:59
Kroc: that will read the first 1000 bytes into a so-called Buf.
Kroc: maybe there is a module to further process that Buf into your longs, ints, doubles, etc. but if so, I'm not aware of it. maybe others know. 20:00
but at worst, you'll be able to do that parsing yourself.
Kroc @masak Oh, so there's not a way to cast some bytes into other types? 20:01
RabidGravy the Buf has .unpack method
masak oh, right
what RabidGravy said.
Kroc I checked unpack -- but it seems incomplete. I don't see any signed, or floating point support.
masak it's incomplete, yes
RabidGravy doc.perl6.org/routine/unpack#role_Blob
dha sortiz - haven't really done much database stuff recently, so I don't know what to tell you. :-) At the moment, my main goal in getting DBIsh installed was to get Task::Star to complete installing. :-) 20:02
ugexe also github.com/lizmat/PackUnpack
dha Nevertheless, I suppose someone may come across this problem who might actually car.
care, even.
ugexe dha: maybe you can just --force install DBIish, then retry install Task::Star 20:03
RabidGravy Kroc, it is of course possible to recombine the bytes in the Buf anyway you choose
sortiz dha, thanks. The paste is useful.
dha ugexe - an earlier commit was suggested, and that managed to work. So, (my) problem solved. :-)
sortiz - glad to be of help.
ugexe or you can --notests like it does for its CI testing...
dha ugexe - indeed, those are probably both reasonable solutions. If I run into similar problems again, I may try one of them. 20:04
Kroc @ugexe That appears not to provide single/double floats 20:06
So, am I to understand that it's not currently possible to read floats from binary files in Perl6? :'( 20:07
dogbert2 This description of the 'ord' method feels a bit strange
Coerces the invocant (or in sub form, its argument) to Str, and returns the Unicode code point number of the code point.
It seems to return the code point of the first character in the string 20:08
Kroc I selected Perl6 because it looked best suited to writing a Z80 assembler; though to begin with I want to be able to convert binary object files from another assembler (WLA DX) into my own linker format.
dogbert2 The code example is incorrect as well .. 20:10
dha dogbert2 - hm. I guess one doesn't usually think of someone using ord on more than a single character. Which document are you getting that from?
dogbert2 Cool.pod
RabidGravy Kroc, as I said before you are entirely free to handle the bytes in the Buf as you wish, it's just a matter of picking the bytes you want and shifting and oring them as required 20:11
examples abound
Kroc @RabidGravy It's this I don't understand. How to convert Buf bytes into a native type. 20:12
dha Damn. must have confused 'a' with 'A'
Thanks for catching that.
dogbert2 glad to be able to help out a little bit 20:13
RabidGravy Kroc, how would you convert 4 bytes into a 32 bit integer in, say C or Assembler? 20:14
Kroc Pointer abuse. However in other languages, one doesn't need to and can just read a native type from the file. 20:15
dalek c: 91226c1 | (David H. Adler)++ | doc/Type/Cool.pod:
Fixed example for ord, so that 'a'.ord is shown to be 97, not 65.
20:18 cdg joined, cdg left 20:19 cdg joined
RabidGravy Kroc, if it helps unpack is made in Perl 6 github.com/rakudo/rakudo/blob/nom/...uf.pm#L211 examine and use as an example to unpack any types you wish 20:20
dha So, before I put in a pull request to change the documentation of C<ord> in Cool.pod, is it *supposed* to produce a result for the first character of its invocant/argument, or is it supposed to only work on single characters? 20:21
Kroc @RabidGravy I don't see the ability to use Single/Double floats in there, unless I'm missing some understanding
dha I. e. AmIBugOrNot?
jnthn dha: ord actually gives the number of the first *codepoint* 20:24
20:24 darutoko left
jnthn dha: And a character may consist of multiple codepoints 20:24
(Though of course, when you're in the boring old ASCII range, nothing like that ever happens :)) 20:25
dha: Anyway, not a bug that it operators on many-char strings
dha Ah. so, perhaps all that needs to be done is to add the word "first" to the doc.
[Coke] dha: rt.perl.org/rt3/Ticket/Display.html?id=127750
dha i. e. "Coerces the invocant (or in sub form, its argument) to Str, and returns the Unicode code point, number of the first code point. 20:26
jnthn That's accurate
Though stray , after point
dha [Coke] - *nod*
20:26 b2gills left
RabidGravy Kroc, they aren't in there, but that shows how say an long is unpacked, you use your knowledge of how the bytes are laid out in your data to unpack to any type you want 20:27
dha jnthn - yes, comma out as well.
dha rewrites
Kroc @RabidGravy ah, okay, I see. Thank you, it's some direction at least, but dissapointing that Perl6 lacks this out of the box. Thanks kindly for the help 20:28
RabidGravy of course a patch to implement would be gratefully received
or indeed release as a module 20:29
[Coke] .tell lucasb the REPL prints the return value if and only if you didn't print anything.
yoleaux [Coke]: I'll pass your message to lucasb.
Kroc RabidGravy Do you know what this strange opperator sequence is? `>>%>>` 20:31
RabidGravy never seen it before :-O 20:32
dha ok, pull request submitted.
Yay! I changed a word in the docs!
:-)
Kroc Ah, I think it means modulo 255 for all elements 20:33
20:33 hankache left
RabidGravy it does modulus for the elements on the LHS yes 20:33
m: say <1 2 3 4> >>%>> 2 20:34
camelia rakudo-moar 40a953: OUTPUT«(1 0 1 0)␤»
RabidGravy I kind of guessed
Kroc Cool 20:35
dogbert2 Thx for the quick fix, dha++ 20:37
20:38 dha left
RabidGravy It's actually, sort of three operators a 'hyper' a modulus, and another hyper 20:38
timotimo i wouldn't really call it three
since any two of them won't be able to stand on their own 20:39
Kroc gtg, thanks 20:40
20:40 dha joined 20:41 b2gills joined
RabidGravy timotimo, no, but it "looks" like that, which makes it easy to guess what it does 20:41
timotimo like [+]? :P 20:43
20:44 Kroc left
masak weak references and finalization proposed for JS: ponyfoo.com/articles/weakref 20:46
20:47 wilcov joined
timotimo FWIW, i'd like to see weak references in moar, too ... :( 20:47
masak when reading that article, it's not clear to me that those finalizers would be any more useful than in other languages (that is, not very useful/reliable at all)
20:50 sue joined 20:54 spider-mario left, nige1 left 20:56 bjz left
timotimo dha: you still around? 20:57
dha yep
timotimo dha: your pull request seems to contain a bunch of commits that have nothing to do with what the pull request was supposed to do
like multiple merges of master into your local repository
dha looks
timotimo i suppose you had some commits unpushed locally and "git pull"'d multiple times
20:58 kaare_ left
timotimo personally, i'd note down the sha1 of the commit you want to push upstream, git checkout -b my_fancy_patch, git reset --hard origin/master (this will discard any local changes that "git diff" would report, so be careful, of course), git cherry-pick the_sha1_you_noted_down 20:58
and then you can push that to your fork overwriting the branch you've pull-requested from 20:59
20:59 pmurias joined
pmurias masak: weak references are useful 20:59
timotimo github will then automatically update the pull request accordingly
dha yeah... weird. I just used the web interface on github to create a pull request, and it seems to have taken everything I've done in my repo lately and dumped them in.
timotimo oh, that's annoying
dha It's possible I do not understand the pull request function on the website fully. Or it may just suck. 21:00
timotimo i'd say it's probably bugged :)
dha Sorry about that.
21:00 skids left
timotimo no worries :) 21:01
RabidGravy I think it just creates a patch with the commits not in the target repo
21:02 _mg_ left
RabidGravy which is dumb but probably not bugged 21:02
timotimo huh. even when you just edit a file in the original repo with the "edit this file" button?
i suppose it's at least counter-intuitive
dha It's software. Ergo, it sucks. 21:03
21:05 espadrine joined 21:09 wilcov left
dalek Iish: aa5252e | (Salvador Ortiz)++ | / (5 files):
Oracle: Add DATE and TIMESTAMP support

Closes #41
21:13
21:16 TEttinger joined 21:17 lizmat joined
lizmat waves from the beautiful County Clare 21:18
will now start on finishing this week's P6W.... let me know if you have something to tell!
timotimo lizmat: skarsnik had a blog post that he wanted to have mentioned in the weekly last week 21:20
Xliff How do I get fpaste to link into here?
21:20 TEttinger left 21:21 TEttinger joined
lizmat timotimo: found it, adding it... 21:22
timotimo excellent
masak 'night, #perl6 21:24
jnthn lizmat: Sadly, lacked energy to finish my blog post in time for this week...though I did one last week :)
Xliff Heads up, #perl6 21:25
gist.github.com/Xliff/9f451357e875...32cd30bc9f
Let me know if more information is needed, or if this is just a result of bad library bindings.
Thanks.
teatime don't be mad at me, but I just ran across this: classicprogrammerpaintings.tumblr.c...ted_post=1
tadzik oh gods
dha That doesn't really look like Larry. 21:26
teatime would it be more accurate if it was a painting of lazarus or mary magdalene at jesus' tomb? :)
timotimo that'd be more appropriate for something about emacs 21:27
tadzik Xliff: from the looks of it it's probably an internal moarvm bug 21:28
steps to achieve a similar crash would definitely help a lot :) 21:29
Xliff tadzik: It's intermittent, but I will keep updating the gist as I find out more.
And is anyone bothered that the "perl6" in question is a corpse?
ZoffixWin corpse? 21:30
tadzik it's an ex-parrot
tadzik hides
ZoffixWin ah
teatime Xliff: I beleive that was the joke :(
Xliff (ha ha) @GClaramunt
teatime: It's a bad thing when the so-called joke does not illicit any laughs.
teatime bah, it's healthy to be able to laugh at yourself. 21:31
ZoffixWin lizmat, for P6W: Perl 6 is now available on glot.io/ so users can run some code in browser.
Xliff teatime: But of course! If it's funny.
timotimo i can't laugh at myself when i'm dead
lizmat ZoffixWin: already meantioned :-)
Xliff Now if the corpse was in fact a dead parrot. Then it would be funny!
ZoffixWin \o/
Xliff hides behind tadzik 21:32
lizmat jnthn: yeah, already mentioned... keep up the good work! There'll be another weekly :-)
jnthn Xliff: The reason for "sometimes fails, sometimes not" is almost certainly ASLR (your OS randomizing the details of memory layout from run to run) 21:34
Xliff: I think the best bit is to run it with valgrind
21:35 Begi left
jnthn Xliff: There's even a perl6-valigrind-m that you can run it with 21:35
Xliff: It's very possibly a bindings bug; valgrind will give some insight
21:35 Begi joined
Xliff jnthn, Thanks for the suggestion! I will try that. 21:36
Running now. 21:37
jnthn Yeah. Valgrind pro tip: be patient. ;)
(It's great but...slow :)) 21:38
timotimo yes. even when you already expect it to be dog slow, it ends up being about 3x slower than you anticipated
jnthn Yeah. But it's fine. 'cus the correct thing to measure it against is often "how long would it take me to find this bug without valgrind", and then it comes out like 10x faster :P 21:39
Xliff LOL
jnthn++
Updating gist with perl6-valgrind-m output.
Updated. 21:40
jnthn Nice 21:41
==1861== Invalid write of size 4
==1861== at 0x7F487D7: ogg_stream_init (in /usr/lib/i386-linux-gnu/libogg.so.0.8.2)
There's where it gets interesting
Xliff Yeah.
jnthn So, very likely something with the binding
Xliff It's probably in the struct signature. I will have to look at that.
Thanks again for the suggestion, jnthn!! 21:42
21:42 Begi left
jnthn Yeah, it'll be somewhere downstream of ogg_stream_state.new I guess 21:42
Xliff Most likely something in class ogg_stream_state() 21:43
Or could be something with the serial number passed to ogg_stream_init. 21:44
I will need to work with my C test harness for comparison.
Of course... that is later... Must. Leave. House!
21:48 adrusi left
jnthn :) 21:51
And rest time for me
'night, #perl6
21:51 Sgeo joined
timotimo gnite jnthn! 21:51
ZoffixWin lizmat++ good weekly 21:59
lizmat p6weekly.wordpress.com/2016/04/11/...wow-blogs/
gnight jnthn 22:00
lizmat is also tired, so wishes #perl6 a good night 22:01
timotimo gnite lizmat
22:03 dvinciguerra_ joined, lizmat left 22:06 firstdayonthejob left 22:07 dvinciguerra left 22:13 wamba left
dalek osystem: daf02b4 | (Martin Barth)++ | META.list:
Update META.list
22:15
osystem: 9d6a7c6 | (Zoffix Znet)++ | META.list:
Merge pull request #193 from ufobat/patch-1

taking project ownership of bailador
ZoffixWin tries to spot the "Squash and merge" button GitHub advertized recently. 22:17
22:17 kid51 joined
timotimo the "accept pull request" button has a little downward arrow button next to it 22:20
22:20 skids joined 22:24 Actualeyes left
ZoffixWin tries to spot the "accept pull request" button :) 22:25
It appears there may be a problem with this PR, so I'll leave it and try to find the elusive button later :) 22:26
22:28 BenGoldberg joined 22:36 espadrine left 22:44 dha left 22:45 dwarring joined, Actualeyes joined 22:48 BenGoldberg left
Xliff unsigned char header[282]; <- How would I convert that to NativeCall rep? 22:49
22:49 BenGoldberg joined 22:50 skids left
timotimo is that part of a struct? 22:51
Xliff Yeah 22:53
timotimo i'm not sure we actually support that yet ... finally :\ 22:54
however, you can do pointer magic manually :(
Xliff Oh?
timotimo like, build a CArray[uint8].new and resize it to how big it has to be for the whole struct
Xliff Ooo...
However!
timotimo and by casting it to a CPointer, add the 282 and nativecast that to a CStruct of the rest you're interested in 22:55
Xliff And this is what I am worried about....that will affect the overall size of the struct.
timotimo that's basically the worst thing ever.
yeha, that's why you'd have to do manual memory management :|
Xliff timotimo, Aaiee! How would that look? Is there an example somewhere I can look at?
Coz that part of the struct looks like this: 22:56
unsigned char header[282]; /* working space for header encode */
int header_fill;
timotimo not aware of one, but it'd basically be how i described it up there :P
22:56 pmurias left
Xliff So header_fill is 282 bites out from "header" char pointer. 22:56
timotimo can you nopaste the rest of the whole struct? or give a link otherwise? 22:57
Xliff And THAT is probably why I am getting "==1861== Invalid write of size 4" when I am using it.
timotimo: Yeah.I will pastebin. Or would you prefer fpaste?
timotimo don't care either way :) 22:58
Xliff pastebin.com/jS13fHRA
timotimo hum. CArray doesn't actually have the methods for creating one with a given size 22:59
ugh, there's lots of interesting stuff after it, too :\
do you need access to all those fields?
m: say 282 / 64 23:00
camelia rakudo-moar 40a953: OUTPUT«4.40625␤»
timotimo m: say 282 - 4 * 64
camelia rakudo-moar 40a953: OUTPUT«26␤»
timotimo m: say 26 - 16 - 8
camelia rakudo-moar 40a953: OUTPUT«2␤»
timotimo what you can do is give your struct these fields:
wait, i made a mistake 23:01
Xliff I don't, but I'm pretty sure the C libs are expecting something of the proper size.
timotimo m: say 282 / 8
camelia rakudo-moar 40a953: OUTPUT«35.25␤»
timotimo you just need 35 int64 fields and one int8 field 23:02
Xliff LOL!
I was wondering if that's where you were going with that.
timotimo :)
Xliff It would be an interesting experiment! That's for sure.
timotimo m: use NativeCall; my $right_sized_thing = CArray[uint8].new(0 xx 400);
camelia ( no output )
timotimo this is how you can get a carray of the right size
Xliff Maybe I could have a specialized new() for that class to do the proper thing with CArray? 23:03
timotimo then you can nativecast(TheRightTypeOfThing, $right_sized_thing)
Xliff And not spam my class with numerous attributes.
sortiz Xliff, You need to pass an allocated pointer or receiving one for that struct? 23:04
Xliff So $.header = CArray[uint8].new(0 xx 282);
sortiz: No. Need to define struct as I will be passing it to C routines via nativelib. 23:05
timotimo sorry, that won't work
Xliff Eh. KNEW it wouldn't be that simple.
timotimo you'll have to have the right number of bytes for the whole thing
Xliff OOOOO!
timotimo then you have an opaque blob of memory that is the right size for anything that expects an ogg_stream_state
Xliff Gotcha. 23:06
timotimo you can have a CStruct for everything before that header field and nativecast to that to get the fields accessed properly if you want
if you want the fields after that header piece, you can nativecast the CArray to a CPointer[uint8], add the offset to header_fill (or maybe e_o_s?) and nativecast that to a CStruct that represents everything in the tail of the ogg_stream_state struct 23:08
Xliff my $ss = CArray[uint8].new(0 xx 360); $ss = nativecast(ogg_stream_state, $ss); 23:09
timotimo i think recently someone worked on making it possible to have a CArray inside a CStruct with a number of slots, but i don't think it got finished
Xliff Rather than do that, I could do that in class ogg_stream_state { sub new () { } }
Lemme try that and see if it makes valgrind happy. 23:10
timotimo hm, may need to be a bit more careful
Xliff Howso?
timotimo as the class ogg_stream_state must still be the right kind of repr for the nativecast to work
OpaquePointer would be enough for your purposes, i believe
Xliff yeah.
repr('CStruct')
Crap. It needs to be OpaquePointer? I still haven't wrapped my head around that one, yet. 23:11
timotimo doesn't have to be
CStruct would be fine, since you're not relying on the .bless function you've got for free from NativeCall
if someone ends up trying to .bless or go via the derived constructor, it'll end up being too small and libogg would asplode when using it 23:12
Xliff Yeah. I don't expect that and will make a note in the docs... 'Don't. Do. Dat!" 23:14
Good stuff!
timotimo you can then build some methods that'll do the nativecast into CStruct and allow access to the attributes dance 23:15
that might be a bit wordy, though
we really just want to have sized CArray support inside CStruct
sortiz And mutable Pointer inside CStruct, btw 23:18
Xliff timotimo: Wait. So you are saying I need a separate class that has the attributes? 23:19
Xliff patiently waits for valgrind.
Still reporting "==2196== Invalid write of size 4" in valgrind. 23:20
23:21 _nadim left
Xliff makes note to try a wrapper class with repr('OpaquePointer') and an access class defined as normal. 23:21
I'm thinking I might just have to have that wordy struct for $.header. 23:22
And just have a method using pack() to get at it. 23:23
(Or is it unpack().... I can never get those right)
sortiz Xliff, OpaquePointer isn't a REPR. 23:25
dalek Iish: 376663c | (Salvador Ortiz)++ | / (5 files):
Workaround for "Cannot invoke this object"

Somehow we can't die inside our closure so let the caller die for us.
  dha++ for report.
  + Tests for missing libraries
23:26
timotimo oh, it used to be called OpaquePointer, but now it's just called CPointer, is it? 23:28
BenGoldberg That's horribly biased. What if I got a pointer from, say, fortran?
Xliff sortiz: Not a REPR, but just a NativeCall type, then? 23:29
Well, next step is to go the specialized struct of 282 bytes. 23:30
timotimo if you do build that struct with the 35-and-a-quarter int64 objects, you can just include it with "HAS" instead of "has" 23:31
Xliff Right 23:32
dalek osystem: 6df5770 | RabidGravy++ | META.list:
Add Lumberjack::Application

See github.com/jonathanstowe/Lumberjack-Application
23:42
23:42 yqt left 23:43 rindolf left 23:47 Actualeyes left, jack_rabbit joined
RabidGravy Now I can get back to finishing Sofa 23:48
23:49 Actualeyes joined
RabidGravy anyway now to bed. Toodles 23:51
ZoffixWin night 23:54
23:57 RabidGravy left 23:59 Azry_ joined, TEttinger left