»ö« 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
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
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
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
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
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!
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
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 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"))'
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
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
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+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
*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