»ö« 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.
00:01 Mouq left 00:04 firstdayonthejob left
RabidGravy toodles! 00:06
00:08 maybekoo2 left 00:10 Mouq joined 00:11 RabidGravy left
arcetera i still don't get this 00:17
why are variables declared with 'sub'
wait
why are variables declared with 'my'
why are they 'lists' instead of 'arrays' 00:18
why 'subroutines' rather than 'functions'
i don't understand this
ilmari Array is a subclass of List 00:20
'sub' and 'my' come from perl5
jnthn `my` indicates belonging to the current scope, and is short - as something so common should be. Subroutine vs function - different languages have picked differnet names, but not all subroutines fit the math definition of function, so subroutine is perhaps less confusing. 00:25
(function is fair game in functional languages, of course) 00:26
And yeah, lists and arrays ain't the same, then there's also sequences.
Sleep time here...'night, #perl6 00:29
geekosaur and you forgot procedure (surviving as "proc" in some modern languages)
:)
00:31 spider-mario left
ilmari the perl6 docs use "routine" for subs and operators 00:34
and methods
e.g. doc.perl6.org/routine.html 00:35
00:38 BenGoldberg left 00:39 BenGoldberg joined 00:40 perturbation joined 00:42 BenGoldberg left 00:43 BenGoldberg joined 00:56 espadrine left
kalkin- if i have a token name { alex | david } and a token word { \w+ } how can i express, that a the token animal is any word which does not match token name 00:56
01:05 z8 joined 01:06 z8_ joined 01:10 z8 left, z8_ is now known as z8
Juerd kalkin-: token animal { <word> { $<word> !~~ /^<name>/ } } 01:14
01:15 z8 left
Juerd kalkin-: The spec defines an in-regex operator !~~ for it, like "token animal { <word> !~~ [^ <name> $] }", but that is not yet implemented. 01:15
Oh, I forgot the $ anchor after <name> in the working example 01:16
kalkin- Juerd: why can i do <word> { ... } there?
Juerd Also, it needs to be <?{ ... }>. I'm sleepy.
Tested working line: token animal { <word> <?{ $<word> !~~ /^<name>$/ }> }
kalkin- thank you 01:17
Hotkeys m: my regex name { alex | david }; my regex word { \w+ }; my regex animal {<!name> <word>}; say "alex dog cat truck david canada" ~~ m:g/[<name>||<animal>||<word>]/ 01:19
camelia rakudo-moar 735869: OUTPUT«(「alex」␤ name => 「alex」 「dog」␤ animal => 「dog」␤ word => 「dog」 「cat」␤ animal => 「cat」␤ word => 「cat」 「truck」␤ animal => 「truck」␤ word => 「truck」 「david」␤ name => 「david」 「canada」␤ …»
Juerd If there's something that delimits the token, you can do simply: token animal { <!before <name>> <word> }
Hotkeys you can just <!name> 01:20
it's equivalent
Juerd Equivalent to what? <!before <name>>?
Hotkeys yes
Juerd That's nice.
Hotkeys yap
Juerd I wish 'fail' in /{ ... }/ did what I expected: make the regex not match. Instead, it makes the entire regex return failure. 01:21
<?{ ... }> is ugly; I find { fail if ... } easier to read.
Hotkeys I'm alright with <?{ ... }> 01:22
Juerd I think it's a bug, because the spec says that <?{ $0 < 256 }> is similar to { $0 < 256 or fail }
Hotkeys I was going to mention the inline !~~ because I saw in in spec 01:23
but then i tried it and it isn't there yet
Juerd You still mentioned it :)
As did I
Hotkeys shh
01:25 Actualeyes joined 01:34 Mouq left 01:44 labster left, labster joined
kalkin- This looks beautiful: my regex animal {<!name> <word>}; 01:47
m: my regex name { alex | david }; my regex word { \w+ }; my regex animal {<-name> <word>}; say "alex dog cat truck david canada" ~~ m:g/[<name>||<animal>||<word>]/ 01:51
camelia rakudo-moar 735869: OUTPUT«Method 'name' not found for invocant of class 'Cursor'␤ in regex animal at /tmp/na7AM0QuZW line 1␤ in block <unit> at /tmp/na7AM0QuZW line 1␤␤»
01:59 SCHAAP137 left 02:04 kid51 left 02:09 wamba left
arcetera how exactly are you supposed to do an infinite loop in perl6 02:17
02:17 Ben_Goldberg joined
ilmari loop { ... } 02:18
02:18 Ben_Goldberg left
ilmari arcetera: doc.perl6.org/syntax/loop 02:19
arcetera ah
was tryna do 'loop True {'
02:20 BenGoldberg left
TimToady that'd be a 'while' 02:20
02:20 Ben_Goldberg joined
arcetera the stupidest program i've ever written sprunge.us/JhJY 02:23
ilmari instead of " ~ $item ~ "id you can do {$item}id 02:26
02:26 BenGoldberg joined, Ben_Goldberg left
ilmari { } interpolates arbitrary expressions in double-quoted strings 02:27
02:33 BenGoldberg left 02:36 cdg joined 02:38 BenGoldberg joined 02:41 cdg left 02:51 molaf_ joined 02:54 molaf left 02:57 AlexDaniel joined
AlexDaniel m: my $item = ‘squ’; say ‘You're a ’, $item, ‘id now!’; 02:58
camelia rakudo-moar 735869: OUTPUT«You're a squid now!␤»
sortiz m: role Inter { COMPOSE { say "composing" } }; class Foo does Inter { }; Foo.new; # phaser COMPOSE seems NYI. 03:00
camelia ( no output )
AlexDaniel “perl6 is sufficiently different from perl5 that not knowing perl5 should not matter” – except that everything is screaming “that's how you did that in Perl 5, and that's how you do it in Perl 6”. Sometimes even without any other explanation. 03:03
saying that not knowing perl 5 does not matter is a bit unfair 03:04
sortiz Indeed, to be accustomed to Perl5's eclecticism helps. 03:10
03:13 vendethiel joined 03:26 Mouq joined
Hotkeys I never used perl 5 03:32
03:34 lichtkind_ left 03:40 noganex joined 03:43 noganex_ left 03:44 Mouq left 03:51 [particle] joined, [particle]1 left 03:53 AlexDaniel left 03:54 skids joined 04:05 BenGoldberg left 04:06 vendethiel left 04:09 woodruffw left 04:12 wamba joined 04:25 wamba left 04:29 kaare_ joined, tmch left 04:30 yqt left 04:40 woodruffw joined
arcetera how do i get command line args with perl6? 04:41
skids m: @*ARGS.say 04:42
camelia rakudo-moar 735869: OUTPUT«[]␤»
04:44 woodruffw left
skids (or use the sub MAIN sugar) 04:45
arcetera apparently
given @*ARGS { works
is that how to properly(tm) do it? 04:46
i'm entirely new to perl langs as a whole
skids depends on your use case. sub MAIN works for most stuff but has limitations, using @*ARGS is perfectly fine. 04:47
arcetera i mean
what's sub MAIN
hooooo boy
equivalent to int main() { in c? 04:48
skids Like that, but with some added ability to map the signature to commandline args.
arcetera oh
so like 04:49
sub MAIN($opt) {
would result in "opt" being the arguments
skids design.perl6.org/S06.html#Declaring...subroutine
arcetera thanks
04:50 woodruffw joined
arcetera how do i read an environment variable 04:57
skids m: %*ENV.keys.say
camelia rakudo-moar 735869: OUTPUT«(RAKUDO_NO_DEPRECATIONS PERLBREW_VERSION PERLBREW_PERL LANG LC_CTYPE SHELL PERL5LIB SHLVL PERLBREW_PATH PWD PERLBREW_HOME HOME ME MANPATH USER PERLBREW_ROOT PERLBREW_BASHRC_VERSION _ PERLBREW_MANPATH PATH LOGNAME)␤»
arcetera as in the value of one 04:58
llfourn m: say %*ENV<SHELL> 04:59
camelia rakudo-moar 735869: OUTPUT«/bin/bash␤»
arcetera ah
05:01 khw left 05:09 woodruffw left 05:48 Cabanossi left, jack_rabbit joined 05:52 Cabanossi joined
dalek c: 0a5e098 | okaoka++ | doc/Type/Hash.pod:
Add a missing semicolon
06:10
c: dcd7218 | azawawi++ | doc/Type/Hash.pod:
Merge pull request #420 from okaoka/add-semicolon

Add a missing semicolon
06:24 CIAvash joined 06:46 Mouq joined 06:53 Mouq left 07:17 Mouq joined 07:39 adu joined 07:44 skids left 07:45 darutoko joined 07:46 agent008 left 08:03 ajb2000 joined
ajb2000 p6: say 3; 08:04
camelia rakudo-moar 735869: OUTPUT«3␤»
08:11 ajb2000 left 08:15 sjoshi joined 08:24 johndau left 08:29 sjoshi left, sjoshi joined 08:36 darutoko- joined, dj_goku_ joined, vendethiel joined 08:38 dj_goku left, musca left, musca` joined 08:39 darutoko left, integral left, erdic left, integral joined, integral left, integral joined, erdic joined 08:41 maybekoo2 joined 08:45 azawawi joined
azawawi hi 08:45
yoleaux 12 Mar 2016 20:28Z <arnsholt> azawawi: Is there some code I could look at for your NativeCall type mismatch? I didn't manage to reproduce it initially, so I suspect it interacts with something a bit deeper
azawawi .tell arnsholt the problem is here github.com/azawawi/perl6-libzip/bl...ip.pm6#L12 08:46
yoleaux azawawi: I'll pass your message to arnsholt.
azawawi What's the optimal way to convert from a Blob to a CArray? 08:47
CArray[int8] to be exact 08:48
08:49 jack_rabbit left
azawawi .tell arnsholt Pointer works, Pointer[zip] fails 08:49
yoleaux azawawi: I'll pass your message to arnsholt.
sortiz azawawi, See github.com/salortiz/NativeHelpers-Blob ;-)
azawawi sortiz: hey :)
sortiz: perfecto 08:50
azawawi starts testing it
sortiz: gist.github.com/azawawi/7ab6eabf988884ef2a2a # install failure :( 08:52
sortiz: Method 'allocate' not found for invocant of class 'Buf'
sortiz I suspect that your rakudo is old. 08:53
azawawi 2016.02
?
08:54 firstdayonthejob joined
azawawi runs 'rakudobrew build moar' to check 08:54
sortiz Buf.allocate is newer... Do you need support older ones? I have a fix at hand. 08:55
azawawi ofcourse :)
not all people will be running 'latest' 08:56
my policy now is to test on 'latest' and the latest stable
i also test on mac os x, windows and linux 08:57
sortiz Ok, give a minute... 08:58
azawawi sortiz: np, take your time :) 09:00
sortiz: confirmed works on latest 09:02
sortiz Testing the commit... 09:15
09:17 tmch joined
azawawi same here... im depending on NativeHelpers::Blob now :) 09:18
for $zip-archive.add-blob method
github.com/azawawi/perl6-libzip/bl...ve.pl6#L29 09:19
09:20 nowan left
sortiz azawawi, Reading your code, if zip is a CStruct I don't know why you pass Pointer[zip] to your calls, 'zip' itself, when used as an argument in a NC is passed by reference, ie. as a Pointer. 09:24
09:24 nowan joined 09:28 [particle]1 joined, [particle] left
azawawi sortiz: github.com/azawawi/perl6-libzip/bl...l.pm6#L406 09:28
09:28 [particle]1 left
azawawi struct zip * 09:28
it is generated code from App::GPTrixie btw
sortiz That can be "sub zip_open(Str, int32, int32 is rw --> zip) is native(LIB) is export { * }" 09:29
azawawi not familiar with that syntax 09:30
is that new? 09:31
09:31 [particle] joined
sortiz Nop, the '--> zip' part is equivalent to 'returns zip'. 09:31
The code generated by GPTrixie is sub-optimal :-) 09:32
NC explicitly states that when any CStruct or CPointer 09:34
is used as an argument, the call receives a pointer, not the inline struct. So Pointer[Foo] is only needed when the C API require **foo. 09:36
And, in particular, when the C struct are opaque, you can use a CPointer. 09:40
In you case, only zip_stat is really an struct (has members), the other don't need to be. 09:42
s/you/your/
azawawi i knew using gptrixie would fail in the end lol 09:47
sortiz And if 'zip' is a class, all functions that require a 'zip' as its first argument, can be (native) methods of the zip class!!
09:48 RabidGravy joined
sortiz Take a look at github.com/perl6/DBIish/blob/maste...Native.pm6 for an example of "modern" NC usage. 09:48
RabidGravy marning
sortiz \o RabidGravy 09:49
azawawi but returns is cool though... it makes more sense :) 09:52
sortiz I prefer the --> syntax 'cus that way all the signature is maintained inside the ( ) 09:56
09:58 wamba joined
arnsholt azawawi: Cheers! But yeah, sounds like the code generated by gptrixie is wrong and you don't need the additional level of Pointer indirection 10:07
yoleaux 08:46Z <azawawi> arnsholt: the problem is here github.com/azawawi/perl6-libzip/bl...ip.pm6#L12
08:49Z <azawawi> arnsholt: Pointer works, Pointer[zip] fails
10:13 Mouq left
RabidGravy It is fairly tricky to guess the code to be generated for something like "typedef struct Foo;" where the Foo is only every used as Foo * 10:14
my brain tells me that this is better being a class Foo is repr('CPointer') { ... } but sofrware would have to work quite hard to figure that yout 10:15
sortiz Indeed, that can't be automated. 10:16
A simple 'int *' can be an array already allocated or to be allocated, a pointer to a single int, etc. 10:19
10:21 abaugher left 10:22 sjoshi left, abaugher joined, sjoshi joined
azawawi oh well :) 10:23
you cant automate everything yet
arnsholt: but still the bug is still there
10:24 sjoshi left
azawawi arnsholt: Pointer[something] != Pointer[something].new(123) 10:24
arnsholt Yeah, I'm going to see if I can't squash it
But it works fine in the cases I tried last night
sortiz Well Pointer[Foo] is a Type, not an instance! 10:25
arnsholt m: use NativeCall; my Pointer[int32] $x = Pointer[int32].new;
camelia ( no output )
azawawi arnsholt: thanks
RabidGravy It's in type constraints that it works in an inscrutable way
arnsholt So it interacts with some other stuff (module loading, possibly) 10:26
azawawi inside a class that is
arnsholt And it's easier to fix with a test case =)
RabidGravy i.e. it works for variable type constraints but not in a signature
arnsholt Ah, that might be it, yeah! 10:27
sortiz m: my Pointer[int32] $x .= new; dd $x
camelia rakudo-moar 735869: OUTPUT«5===SORRY!5===␤Type 'Pointer' is not declared␤at /tmp/5AoTVnzlb8:1␤------> 3my Pointer7⏏5[int32] $x .= new; dd $x␤Malformed my␤at /tmp/5AoTVnzlb8:1␤------> 3my7⏏5 Pointer[int32] $x .= new; dd $x␤␤»
sortiz m: use NativeCall; my Pointer[int32] $x .= new; dd $x
camelia rakudo-moar 735869: OUTPUT«NativeCall::Types::Pointer[int32] $x = NativeCall::Types::Pointer[int32].new(0)␤»
azawawi sortiz: Thanks. NativeHelpers::Blob is now installing correctly under moar-2016.02 10:28
sortiz++
azawawi goes back to lame android development :) 10:29
doc.perl6.org/language/nativecall#B..._and_Blobs # needs some documentation... TBD 10:30
10:30 vendethiel left
RabidGravy ah yes, specifically it doesn't work at all well on "return constraints" which is most of the places I changed it 10:30
this github.com/jonathanstowe/Audio-Enc...a8d928d034 indicates the places where it did work once and stopped working 10:31
there are probably more
obviously the Audio stuff is rife with numeric CArrays being shovelled around 10:32
10:33 vendethiel joined
azawawi sortiz: i cant find any of the documentation on --> that you told me about in doc.perl6.org/language/nativecall 10:33
RabidGravy it's not nativecall specific
it's just a way of indicating the return type in a signatire 10:34
azawawi so where is that documentation? :)
re "NC explicitly states that when any CStruct or CPointer...", sortiz
sortiz ".. is used as an argument, the call receives a pointer, not the inline struct". 10:35
10:36 adu left
sortiz azawawi, doc.perl6.org/type/Signature#Constr...turn_Types 10:36
azawawi cool 10:37
i liked "returns Something" though :) 10:38
RabidGravy on a somewhat related note, to facilitate "live" audio generation the CArray constructor would need to be an order of magnitude faster
sortiz RabidGravy, Buf can be faster, you really need CArray? 10:40
RabidGravy well I doubt it would be in practice 10:42
I'm not thinking converting some num32s into a Buf is going to be particularly rapid 10:43
10:45 azawawi left
sortiz m: my $b = Buf[num32].allocate(100); 10:46
camelia ( no output )
sortiz m: my $b = Buf[num32].allocate(100000);
camelia ( no output )
sortiz Why "convert"? You can have a Buf of num32s 10:48
RabidGravy, The support is incomplete and I don't know what you need, but for moving data can work. 10:53
10:54 spebern joined, jack_rabbit joined 10:58 xinming left
nine Wow...I've just slept for almost 12 hours. Seems like I was really tired after GPW 10:58
sortiz RabidGravy, And exists the native numarray, same REPRs, Positional, Iterable, and mutable, fully supported. 11:00
11:00 woodruffw joined 11:03 labster left, TEttinger left 11:04 spebern left 11:06 pyrimidi_ left 11:09 xinming joined 11:12 pyrimidine joined 11:16 spider-mario joined 11:17 rindolf joined
[Tux] test 22.023 11:19
test-t 13.943
csv-parser 49.583
nine notices - wearing his manager's hat - that the graph goes up and to the right, so everything must be fine! 11:22
11:23 mr-foobar left
sortiz :-P 11:23
11:23 brrt joined
RabidGravy sortiz, I'm a bit confused, are you saying I can use a Buf[num32] in place of a CArray[num32] for a native sub parameter? 11:24
11:26 SHODAN left, [TuxCM] joined
RabidGravy it appears to fail at the first hurdle for me 11:27
m: my $f = Buf[num32].new; $f[0] = Num(pi)
camelia rakudo-moar 735869: OUTPUT«This type cannot unbox to a native integer␤ in block <unit> at /tmp/E7SU9msvwM line 1␤␤»
sortiz RabidGravy, In general, to *send* data, you can use a Buf[foo] in place of a CArray[foo].
RabidGravy well it looks all kind of broken to me 11:28
m: my $f = Buf[num32].new; $f[0] = 0
camelia rakudo-moar 735869: OUTPUT«MVMArray: bindpos expected num register␤ in block <unit> at /tmp/fBeE8rRkD6 line 1␤␤»
11:28 SHODAN joined
RabidGravy m: my $f = Buf[num32].new; $f[0] = Num(0) 11:28
camelia rakudo-moar 735869: OUTPUT«This type cannot unbox to a native integer␤ in block <unit> at /tmp/ugm8MZ284L line 1␤␤»
RabidGravy m: my $f = Buf[num32].new; $f[0] = num32(0) 11:29
camelia rakudo-moar 735869: OUTPUT«Cannot invoke this object␤ in block <unit> at /tmp/tw6645o_jC line 1␤␤»
sortiz If you need to manipulate the data, a numarray is supported.
RabidGravy a "numarray"?
sortiz m: m
camelia rakudo-moar 735869: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7qBcB2F0_P␤Undeclared routine:␤ m used at line 1␤␤»
sortiz m: my $a = array[num32].new; dd $a; 11:30
camelia rakudo-moar 735869: OUTPUT«array[num32] $a = array[num32].new()␤»
sortiz m: my $a = array[num64].new; dd $a;
camelia rakudo-moar 735869: OUTPUT«array[num64] $a = array[num64].new()␤»
11:31 Begi joined
RabidGravy I'm so glad all this stuff is well documented ;-p 11:31
sortiz Indeed, the main problem I see in the p6 land is the lack of documentation. :-( 11:33
RabidGravy so is "native array" able to be used in place of a CArray? 11:34
sortiz I suppose yes. Is the same REPR than Blob. 11:36
Receive VMArrays are a little trickier, 'cus you need to pre-allocate it, so need to known the size in advance. 11:39
RabidGravy er quite 11:40
I may be mis-representing the CArray constructor somewhat:
m: use NativeCall; my @f = 0e0 xx 512; my $b = now; my $a = CArray[num32].new(@f); say now - $b; say 256/44100
camelia rakudo-moar 735869: OUTPUT«0.00222512␤0.005805␤»
RabidGravy *that* should be quick enough 11:41
sortiz I add the
@arr signature to CArrays a few days ago :-)
RabidGravy yeah, it's handy sortiz++ 11:42
11:43 rindolf left
sortiz RabidGravy, I can not know everything, so I'm dedicating to NC ;-) 11:43
RabidGravy I was wondering however if it could be made even quicker by not being *nice* in the constructor and going straight in with the bindpos rather than invoking the whole AT-POS mechanism and the attendant dispatch, object creation and proxy dispatch 11:44
Begi Is there a way to check if a file exist, no matter the extension ? 11:45
RabidGravy "somefile".IO.e
Begi For example, "file".IO.e will detect "file", but note "file.txt" 11:46
RabidGravy er 11:47
11:47 jack_rabbit left
RabidGravy well they are different files 11:47
11:48 muethos joined
RabidGravy ".".IO.dir(test => /file/) 11:48
or something more complicated with grep 11:49
Woodi notices Lease pattern and MS Dispose thingies are not the same. it was just impression from skimming very tragically translated document...
11:49 muethos left
Woodi so what is state of gptrixie ? usually works ? 11:50
RabidGravy it works yes 11:51
sortiz RabidGravy, A NumTypedCArray don't use proxy dispatch, and can be pre-extended touching the "last" index.
RabidGravy it's very useful for generating the stubs for a large API, of course any expectation that it will generate a sensible Perl6 API would be a mistake
Woodi RabidGravy: thanx, need to try it 11:52
11:53 muethos joined
RabidGravy sortiz, ah I was looking at the general case not the NumTyped 11:53
sortiz RabidGravy, The general case use a slow path, yes. 11:54
11:55 muethos left, muethos joined
RabidGravy but yes I do know about the "pre-extension" thing having used it in a bunch of bindings for Audio:: things in the past year 11:56
11:56 muethos left 11:57 muethos joined, muethos left, muethos joined
RabidGravy right now I'm just concerned with performance because I'm looking at PortAudio and have found that it is really difficult to keep the write buffer filled 11:58
so reading CArrays with Sndfile and sending them to a Portaudio stream is fine, however doing almost anything in straight perl in the "hot loop" results in buffer under runs 12:01
so e.g github.com/jonathanstowe/Audio-Por...ay-wav#L56 works fine
whereas at: github.com/jonathanstowe/Audio-Por...ay-wav#L56 12:02
I had to completely calculate sufficient buffer loads of data to feed the stream as doing even a CArray.new in the loop wasn't working 12:03
sortiz The optimization work in Rakudo is going well. 12:05
need to go o/ 12:06
12:07 muethos left, muethos joined 12:08 muethos left, muethos joined, muethos left, CIAvash left 12:09 brrt left 12:12 [Tux] left 12:14 vendethiel left 12:16 CIAvash joined 12:19 [TuxCM] left 12:20 [Tux] joined 12:21 pRiVi joined 12:23 sortiz left 12:26 kid51 joined 12:28 RabidGravy left
jnthn .tell RabidGravy if you have chance to turn the thing that's too slow for you into a small benchmark, and even better add it to perl6-bench, that'd be useful 12:30
yoleaux jnthn: I'll pass your message to RabidGravy.
12:30 RabidGravy joined
RabidGravy how odd, the display manager completely locked up 12:32
yoleaux 12:30Z <jnthn> RabidGravy: if you have chance to turn the thing that's too slow for you into a small benchmark, and even better add it to perl6-bench, that'd be useful
12:33 Actualeyes left
RabidGravy jnthn, it's tricky as it seems to be some combination of method dispatch and the CArray constructor eats up the cycles I have available to fill the buffer 12:36
12:37 Skarsnik joined
RabidGravy i.e. it needs to do everything in around 5 milliseconds 12:38
[ptc] nine: good answer to the panda --offline discussion! I started implementing what I thought was wanted and then it just got too ugly (even for me!), hence why I asked for clarification of the ticket's requirements
12:42 mr-foobar joined 12:43 Begi left 12:47 Begi joined 12:48 Actualeyes joined 12:52 spebern joined, vendethiel joined 12:53 Begi left 12:55 rindolf joined
Woodi RabidGravy: such problems are real Perl6 progress measurements :) here: things shifted from "NYI or bugged" into "inter language successful cooperation" and even into very small, sub-second (10^-3 s!) interactions ;) 12:56
12:57 maybekoo2 left 12:59 maybekoo2 joined 13:00 spebern left
RabidGravy jnthn, a contrived example of the entire thing 13:02
m: gist.github.com/jonathanstowe/5e43...82c2166a52
camelia rakudo-moar 735869: OUTPUT«0.0273767␤0.01639564␤0.0153173␤0.0227954␤0.0147356␤»
Woodi do /somewhere/share/perl6/site/sources/<sources> need to be SHA1 hashes instead of human friendly (hierarchy of) file names ?
RabidGravy those numbers need to be an order of magnitude smaller for that to work as I'd like ;-) 13:03
13:03 aborazmeh joined, aborazmeh left, aborazmeh joined
Woodi gather/take is fast now ? 13:03
RabidGravy depends what you mean by "fast", that code isn't "fast enough" 13:04
nine Woodi: niner.name/talks/A%20look%20behind%...rl%206.pdf starting at page 20 13:05
RabidGravy and I'm not sure if it is the gather, the rotor or the the CArray constructor
I actually don't care much about unqualified "fast" stuff just has to be quick enough to do what you need with it 13:07
Woodi nine: but I talk just about sources...
nine Woodi: that exact question _is_ answered in the talk
13:08 AlexDaniel joined
Woodi nine: half of long names content can be replaced by using subdirectories (version, autors, api) and Unicode problems can be resolved via utf8 encoding in filenames 13:11
nine Woodi: feel free to propose an implementation 13:12
Woodi nine: I would be happy with proposing one :)
nine Keep in mind that not all file systems are happy with UTF-8 encoded file names 13:13
13:14 vendethiel left
Woodi I thinked just Unicode names in fs are problematic... 13:14
nine Whenever you store Unicode strings, you do so using some encoding. Same as you don't store the abstract idea of the picture of a ping elephant on your disk, but some .jpg or .png or .gif encoded data. 13:16
s/ping/pink/
arnsholt Well, it's not only Unicode. It's also managing several different modules with the same name (but different versions and/or authors) as well 13:18
That said, I think mst++ has some ideas to make it more introspectable, but I'm not sure how far along those ideas are
Woodi arnsholt: versions and autors are not a problem, just use separate subdirectories
nine arnsholt: as Woodi correctly noted, the version/auth issue can be solved by using sub directories. However even auths can and will contain Unicode characters 13:19
arnsholt That's true. But then similarly Unicode can be handled by something like URL encoding =)
nine arnsholt: github.com/rakudo/rakudo/commit/37...a920730d01 13:20
Woodi: ^^^
Woodi I think windows is ok, apple is ok (I think) and with *nixes ppls you deal by note in README: pleas use modern fs :)
nine Woodi: it's not only file systems. On Linux, the expected encoding of file names is per-user (!!) and configured by the LANG environment variable 13:21
arnsholt Yup. Unix file names are blobs of bytes, sadly
Woodi nine: I think thats is: we carry too much... systems are run by admins, admins install things, admins share things for users, if users want thing from system they must accept local rules. works even if admin == user 13:23
nine Sounds like exactly what I need: more users being pissed because we cannot even find the installed modules... 13:25
Woodi nine: sources in visible for is a must, IMO 13:27
nine Woodi: so what's wrong with the commit I pointed out? 13:28
Do we really need more? I'm honestly interested. 13:29
Woodi nine: so now you saying this is already done ? :) 13:31
nine I had hoped that the commit message is clear on what it does 13:33
13:34 CIAvash left
RabidGravy Woodi, my understanding is that you can make your own Compunit::Repository that does whatever you like, you could even make your own FUSE filesystem to store an unambigious representation 13:36
nine Woodi: if the commit message is unclear, please just say so. It's just that I really try hard to write good, understandable commit messages and I would like to know if it works 13:38
RabidGravy so all of this is only a problem if
one doesn't want to pitch and make things that suit one's own requirements 13:39
kalkin- why does perl6 -Ilib does not work with the repl? Is this really a bug or do I do something wrong?
nine kalkin-: could be a bug 13:40
RabidGravy I think it's been like that for ever, "use lib 'lib'" in there works 13:41
kalkin- RabidGravy: thanks
nine I sometimes wonder why the REPL is implemented in NQP instead of Perl6 13:42
13:43 cognominal left 13:44 ufobat joined
RabidGravy I think because it works as a repl for nqp as well :) 13:45
13:45 FROGGS joined
arnsholt The REPL functionality is in HLL::Compiler, which is part of the compiler construction infrastructure provided by NQP 13:46
So more or less what RabidGravy said, yeah
13:46 mr-foobar left
RabidGravy but I actually find the whole repl thing more of a pain than a convenience, I'd rather type code in a file or in the shell 13:46
nine I haven't used the REPL myself really. Although it would get rid of the quoting issues when trying things in the shell 13:48
13:50 maybekoo2 left, mr-foobar joined
ufobat is this the ideomatic way for incrementing values in a array slice or is there something better? -> $_++ for @a[$x..$y] 13:50
13:52 vendethiel joined
FROGGS is that arrow part of the code? 13:57
I'd probably do: @a[$x..$y]».++
14:02 cbk1090 joined
RabidGravy ooh, I just segfaulted 14:03
ufobat the arrow isnt part of it.
14:04 MrHouser joined
RabidGravy it took quite a while, let's see if I can get that in gdb 14:04
14:04 MrHouser left
FROGGS hmm, I thought hyper postfix ops would work this way... 14:06
m: my @a = 1 xx 20; my ($x, $y) = 2..13; @a[$x..$y]».++; say @a
camelia rakudo-moar 735869: OUTPUT«[1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]␤»
FROGGS ohh wait, it does something 14:07
ahh, dang
ufobat your example worked for me, though I dont know what this ».++ part is already doing, where can i read about it?
FROGGS dunno, hyper ops? 14:08
ufobat ahh actually not already
FROGGS m: my @a = 1 xx 20; my ($x, $y) = 2, 13; @a[$x..$y]».++; say @a
camelia rakudo-moar 735869: OUTPUT«[1 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1]␤»
FROGGS there was my typo
ufobat hyper operators, thanks :)
14:09 Begi joined
kalkin- what does the prefix @* mean? Like @*FOO? Why whout i use something like this in a Grammar instead of just @foo? 14:09
14:09 musiKk_ joined
FROGGS kalkin-: it is a dynamix variable with the * twigil 14:10
so it is visible along the call chain
kalkin- s/whout/would/
FROGGS so basically it is a better way of doing global variables 14:11
RabidGravy also referring to an otherwise undefined $*FOO results in a Failure which can be checked rather than a compile time exception
FROGGS m: sub bar { say $*baz }; sub foo { my $*baz = 42; bar() }
camelia ( no output )
FROGGS m: sub bar { say $*baz }; sub foo { my $*baz = 42; bar() }; foo()
camelia rakudo-moar 735869: OUTPUT«42␤»
FROGGS kalkin-: see?
kalkin- I think I understand. 14:12
FROGGS m: sub bar { say $*baz }; sub foo { my $*baz = 42; bar() }; foo(); bar();
camelia rakudo-moar 735869: OUTPUT«42␤Dynamic variable $*baz not found␤ in sub bar at /tmp/j54EIAWNzr line 1␤ in block <unit> at /tmp/j54EIAWNzr line 1␤␤Actually thrown at:␤ in sub bar at /tmp/j54EIAWNzr line 1␤ in block <unit> at /tmp/j54EIAWNzr line 1␤␤»
14:13 patrickz joined
RabidGravy I was just about to say that running this code in gdb wasn't resulting in a segfault and then it did, just took longer 14:13
14:14 vendethiel left
RabidGravy Hmm "0x00007ffff7aeb4ef in MVM_args_slurpy_named ()" 14:15
14:15 cbk1090 left 14:16 vendethiel joined 14:18 aborazmeh left
RabidGravy right, let's RT that 14:19
14:19 musiKk_ left
dalek kudo-star-daily: 9422227 | coke++ | log/ (9 files):
today (automated commit)
14:20
14:20 cbk1090 joined
FROGGS RabidGravy: do you record the entire bt? 14:22
RabidGravy well I have a bt full from the offending thread
FROGGS please attach that 14:24
a single line from gdb isnt that helpful
14:32 RabidGravy left
cbk1090 So I have a Grammar, however I seam to only find the first match in any line, while a second or third gets ignored. can a Perl6 Grammar do this this or do I need to use something like .grep ? 14:34
FROGGS if you do it right you can parse a bunch of lines, yes 14:35
14:35 maybekoo2 joined
moritz cbk1090: a grammar is usually meant to parse a whole string (or at least on the start of a string), but you can use subparse for example to find other matches 14:36
14:37 vendethiel left 14:39 RabidGravy joined
RabidGravy nope still cracking along 14:41
14:43 vendethiel joined 14:51 cdg joined 14:52 cbk1090 left, cbk1090_ joined
cbk1090_ moritz, so something like my $match = Search::myGrammar.subparse($text) would find multiple occurrences of the grammar match in any given line? 14:52
14:55 lizmat joined
RabidGravy it just doesn't have to match the whole string 14:55
cbk1090_ RabidGravy, Oh ok. 14:56
RabidGravy so if you have some matching rules within the string you will get some matches
arnsholt subparse finds the first match, anywhere in the string. But the returned match object contains the start and end positions
TimToady subparse doesn't scan
arnsholt You can then find further matches by searching again, starting at the position after the end position
cbk1090_ So maybe for what I want I should use .grep 14:57
arnsholt, sorry, but how do I do that?
TimToady you still have to write your pattern to skip
if you want multiple entries per string
or use m:g
grammars never scan, you have to do something like .*? somewhere 14:58
RabidGravy ah, so I can make it segv at the next level of simplification up
TimToady well, if you use :c it might scan
cbk1090_ TimToady, Ok think I got it. will try it out when I get home. (At work now)
Thanks guys 14:59
TimToady off to go play drums at church :) &
RabidGravy TimToady++ # drums 15:01
cbk1090_ TimToday++ # Church 15:02
RabidGravy I can lend you a drum machine, so much less effort
15:02 acrussell left
awwaiid harder to get a feel for the rythm though 15:03
15:03 cdg left 15:05 vendethiel left
RabidGravy Oh I dunno, I've got two devices with sequencers designed by Roger Linn, sometimes feel more human than some real drummers I've played with :) 15:05
15:07 vendethiel joined 15:10 cbk1090_ left 15:15 CIAvash joined 15:18 jellyfish joined, jellyfish left 15:20 placeboPenguin joined
RabidGravy so removing the gather it doesn't segfault either 15:21
arcetera sigh
placeboPenguin `rakudobrew build jvm` => `Makefile:376: recipe for target 'blib/Perl6/World.jar` failed and `Missing or wrong version of dependency 'gen/jvm/stage2/QRegex.nqp'` ?
arcetera i learned perl 6 now i don't have any ideas as to what to do with it
RabidGravy arcetera, github.com/perl6/perl6-most-wanted...modules.md pick one, implement, repeat 15:22
placeboPenguin Anyone else experience this, or know how to fix it? 15:23
RabidGravy never even tried to build for jvm I'm afraid 15:28
15:28 vendethiel left, nowan left
lizmat brrt-to-the-future.blogspot.nl/2016...uture.html # brrt++ 15:29
15:31 SCHAAP137 joined 15:42 araujo left, TEttinger joined 15:46 nowan joined 15:50 rvchangue left 15:53 xinming left, vendethiel joined 15:55 xinming joined 15:56 zakharyas joined
RabidGravy so anyway it does appear that the rt.perl.org/Ticket/Display.html?id=127700 is in some combination of gather/take -> rotor -> Channel.send, can't make it do the segv without all three elements 16:04
16:09 Begi left 16:12 khw joined 16:13 vendethiel left 16:16 musiKk_ joined 16:23 lizmat left 16:26 lizmat joined 16:33 vendethiel joined
nadim ow do I declare a hash in a hash? my %h = <a 1 b 2>, sub_hash => < a 1 b 2>; ? 16:37
dalek c/pipeline-operators: 775f029 | (Brock Wilcox)++ | doc/Language/operators.pod:
Add documentation for pipeline operators

I left out ==>> and <<== since they are not implemented in Rakudo.
jnthn nadim: sub_hash => { <a 1 b 2> } 16:38
AlexDaniel nadim: by the way, did you notice my note? irclog.perlgeek.de/perl6/2016-03-12#i_12173860 16:39
16:39 skids joined
nadim jnthn: meh!, I said .Block, I did try that first as it comes naturally fromP5, OK, I try again :) 16:40
AlexDaniel: no, I'll look at it now :)
jnthn Oh, wait, that one may come out as a block... 16:43
m: say { <a 1 b 2> }.WHaT
camelia rakudo-moar 735869: OUTPUT«Method 'WHaT' not found for invocant of class 'Block'␤ in block <unit> at /tmp/zOWyRTdqfo line 1␤␤»
jnthn m: say { <a 1 b 2> }.WHAT
camelia rakudo-moar 735869: OUTPUT«(Block)␤»
16:43 kaare_ left
jnthn Yeah, it needs to have a pair in there 16:43
m: say ( hash <a 1 b 2> ).WHAT 16:44
camelia rakudo-moar 735869: OUTPUT«(Hash)␤»
jnthn There's one way
m: say %(<a 1 b 2>).WHAT
camelia rakudo-moar 735869: OUTPUT«(Hash)␤»
16:44 kaare_ joined
jnthn Another :) 16:44
nadim imgur.com/ECG2njs, I was getting confused 16:45
jnthn: and even more confusing when I post an image of two dumps one after the other ;) 16:48
jnthn RabidGravy: Thanks, will stick that through the profiler next week and see what I can figure out. 16:50
RabidGravy the segfault was quite unexpected though in my attempt to decouple the generation and consumption with a channel 16:52
nadim m: my %df2 = < a 1 b 2 c 3 d 4>, s => %(< a 1 b 2 c 3 d 4>) ; %df2.perl.say ; 16:53
camelia rakudo-moar 735869: OUTPUT«{"a 1 b 2 c 3 d 4" => :s({:a(IntStr.new(1, "1")), :b(IntStr.new(2, "2")), :c(IntStr.new(3, "3")), :d(IntStr.new(4, "4"))})}␤»
nadim jnthn: stillnot it it seems ^^
16:54 travis-ci joined
travis-ci Doc build passed. Brock Wilcox 'Add documentation for pipeline operators 16:54
travis-ci.org/perl6/doc/builds/115690724 github.com/perl6/doc/commit/775f0298021f
16:54 travis-ci left, vendethiel left
jnthn nadim: You're expecting for flattening than you're gonna get :) 16:55
m: my %df2 = flat < a 1 b 2 c 3 d 4>, s => %(< a 1 b 2 c 3 d 4>); %df2.perl.say
camelia rakudo-moar 735869: OUTPUT«Unexpected named parameter 's' passed␤ in block <unit> at /tmp/AQ_ygcswph line 1␤␤»
jnthn heh 16:56
m: my %df2 = hash < a 1 b 2 c 3 d 4>, s => %(< a 1 b 2 c 3 d 4>); %df2.perl.say
camelia rakudo-moar 735869: OUTPUT«{:a(IntStr.new(1, "1")), :b(IntStr.new(2, "2")), :c(IntStr.new(3, "3")), :d(IntStr.new(4, "4")), :s(${:a(IntStr.new(1, "1")), :b(IntStr.new(2, "2")), :c(IntStr.new(3, "3")), :d(IntStr.new(4, "4"))})}␤»
jnthn There we go
dalek c: 775f029 | (Brock Wilcox)++ | doc/Language/operators.pod:
Add documentation for pipeline operators

I left out ==>> and <<== since they are not implemented in Rakudo.
c: 2807db5 | (Brock Wilcox)++ | doc/Language/operators.pod:
Merge pull request #421 from perl6/pipeline-operators

Add documentation for pipeline operators
nadim AlexDaniel: thanks for the S/// construct. I'll go change my code I prefere this one to substr. 16:57
jnthn: if you don't get it from the first shot ... then I feel less dumb :) 16:58
16:59 wamba left
jnthn blames the amount of wine in the soup he made for lunch... :) 16:59
RabidGravy perfectly valid excuse
17:00 vendethiel joined
llfourn blames the lack of wine in the soup he had today... not sure what for 17:00
timotimo llfourn: lack of creativity, obviously 17:01
llfourn ah yes that's it! 17:03
nadim I blame timotimo, because I wouldn't be doint any of this if he did not say that he found it nice. 17:07
17:08 wamba joined
FROGGS *g* 17:08
nadim "Cannot coerce to Hash with named arguments" this is going to be a long evening!
timotimo wait, i found what nice? 17:09
nadim the output of DDT 17:10
timotimo oh
yeah, well, that's because it is nice
nadim I have implemented a diff, you give it two data structures and it dsplays them side by side, I am testing it right now 17:11
timotimo it looks pleasing and it allows you to grok the basic structure of some data more easily than other methods would
ugexe what is the reason slurp positional params don't support type constraints?
timotimo ugexe: because they could be lazy, among other things
llfourn slurpy positionals can be lazy? is there a gold example of this?
golf*** 17:12
nadim timotimo: it's when one gets to filtering away stuff that is not needed that it shines. I think I may need to make some blog entry, maybe you cna help timotimo
ugexe m: sub foo(*@a) { @a.map: {.say} }; foo(1,2,3,4)[0]
camelia rakudo-moar 735869: OUTPUT«1␤»
ugexe i think anyway
probably the map itself in that example :x 17:13
llfourn m: my @fib = 0,1,*+* ... *; -> *@a { }.(@fib) # will this terminate?
camelia ( no output )
llfourn hmm
dalek kudo/nom: 43e7638 | lizmat++ | src/core/List.pm:
Annotate List!ensure-allocated to return Nil
llfourn m: my @fib = 0,1,*+* ... *; -> *@a { say @a[^5] }.(@fib) # will this terminate?
camelia rakudo-moar 735869: OUTPUT«(0 1 1 2 3)␤»
llfourn I see.
cool feature. rakudo++ 17:14
but I do find myself reaching for a type on slurpies every so often
RabidGravy yeah, same here 17:15
timotimo nadim: no clue if i could help; i still haven't gotten around to making the QAST output machine-readable, for example 17:16
ugexe it'd be slick if you could somehow have multi dispatch based on the types of the slurpy themselves
timotimo where on your priority list is making an interactive html front-end for DDT?
17:16 geekosaur left
llfourn m: my @fib = 0,1,*+* ... *; -> *@a where { all(@a) ~~ Int } { say @a[^5] }.(@fib) # is this even the right what to do it? 17:16
timotimo for/based on/compatible with/inspired by
17:16 geekosaur joined
camelia rakudo-moar 735869: OUTPUT«Memory allocation failed; could not allocate 182096 bytes␤» 17:16
llfourn I guess it was... 17:17
m: my @fib = 0,1,*+* ... *>20; -> *@a where *.all ~~ Int { say @a[^5] }.(@fib) # apparently there is .all 17:18
camelia rakudo-moar 735869: OUTPUT«Constraint type check failed for parameter '@a'␤ in block <unit> at /tmp/h2_aDHWsjq line 1␤␤»
llfourn :S 17:19
RabidGravy Anyway I think the problem I am having with reading from a jack source with portaudio is largely down to having to use the same buffer size as the jackd is using and there being no way of getting that information from portaudio :-(
llfourn m: say (0,1,*+* ... *>20).all ~~ Int # but this works 17:20
camelia rakudo-moar 735869: OUTPUT«True␤»
nadim timotimo: output it injson, or whatnot that has a parser, and I''l help with the filtering, if any is needed.
RabidGravy which completely sucks as it makes one of my prime use cases really rather difficult
ugexe .all acts different from all() ? 17:21
17:22 vendethiel left
llfourn ugexe: does it? 17:22
17:22 musiKk_ left
llfourn m: say (0,1,*+* ... *>20).all.perl 17:22
camelia rakudo-moar 735869: OUTPUT«all(0, 1, 1, 2, 3, 5, 8, 13, 21)␤»
ugexe i thought you were pointing that out
llfourn ugexe: no I thought they were the same but I dunno why *.all ~~ Int doesn't work in the where 17:23
17:23 istarosel joined
llfourn m: -> *@a where *.all ~~ Int { say @a[^5] }.(0,1,*+* ... *>20) 17:24
camelia rakudo-moar 735869: OUTPUT«Constraint type check failed for parameter '@a'␤ in block <unit> at /tmp/FiSd1hHwo2 line 1␤␤»
ugexe m: my @fib = 0,1,*+* ... *>20; -> *@a where {.all ~~ Int} { say @a[^5] }.(@fib)
camelia rakudo-moar 735869: OUTPUT«(0 1 1 2 3)␤»
llfourn m: -> *@a { say @a.perl }.(0,1,*+* ... *>20)
camelia rakudo-moar 735869: OUTPUT«[0, 1, 1, 2, 3, 5, 8, 13, 21]␤»
ugexe using a where block seems to change it
17:25 istarosel left
llfourn yes. I wonder if *.all ~~ Int is innapropriate for some reason 17:25
m: my &call = *.all ~~ Int; say call([1,2,3]);
camelia rakudo-moar 735869: OUTPUT«Type check failed in assignment to &call; expected Callable but got Bool (Bool::False)␤ in block <unit> at /tmp/lbDrPWLutw line 1␤␤»
llfourn o.o 17:26
I always thought that worked
m: my &call = *.all.ACCEPTS(Int); say call([1,2,3]);
camelia rakudo-moar 735869: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in block <unit> at /tmp/pzK2HzCzqL line 1␤␤»
llfourn eh that's the wrong way arround 17:27
m: my &call = *.all.&[~~](Int); say call([1,2,3]);
camelia rakudo-moar 735869: OUTPUT«True␤»
llfourn I guess that's the way to do it
ugexe line noise shmine noise 17:29
nadim given two objet reference, they can be the same object, have the same value, not have the same value. same object is with infix<===>, but how do I get if they have the same value? 17:30
moritz nadim: infix:<eqv>
nadim oki 17:31
moritz: ay "funny sigil for that?
ugexe the class needs to implement eqv i believe 17:33
llfourn nadim: nope just eqv I think
dalek ast: 9cf4992 | FROGGS++ | S02-literals/allomorphic.t:
test the allomorphness of ENV
17:34
ugexe m: class A { has $.a; }; say A.new(a => 5) eqv A.new(a => 5); # i'm wrong... the docs say this returns False though 17:36
camelia rakudo-moar 43e763: OUTPUT«True␤»
nadim ugexe: that sounds plosible. 17:37
llfourn: scandal! ;)
FROGGS jnthn: if rt.perl.org/Ticket/Display.html?id=127671 also a case where utf8-c8 would help? 17:39
is* 17:40
jnthn FROGGS: Yes but we already should be using it there... 17:42
FROGGS ohh
jnthn FROGGS: Maybe I missed a place when switching lots of things over to utf8-c8 though
FROGGS okay, try to get behind it then...
17:42 sena_kun joined
FROGGS k 17:42
thanks :o)
hoelzro nine: regarding the REPL being implementing in NQP rather than Perl 6 - I'm working on a branch to change that
jnthn FROGGS: I'd just check the code in question for reading directories and see if I just missed changing it over :) 17:43
hoelzro (well, that's a lie - the REPL still is in NQP, but the more advanced logic will live in Perl 6 land instead)
FROGGS ha! MVM_encoding_type_utf8 17:44
jnthn: the directory name is utf8-c8, the listing isnt
three character fix, in case it works :o)
ha, works! \o/ 17:45
sena_kun Hi all. Returned to perl6 for a classes task. How can I "lazily" declare class? I have two classes which are depend on one another, so I need to firstly declare about "There are class A declared below", use some class A features(type at least) in class B and then declare class A. What form is the most convinient to do so? 17:46
llfourn class A {...} 17:47
moritz sena_kun: class A { ... }; class B { use A here }; class A { define it here }
literal ... pre-declares a class
sena_kun llfourn++
moritz++
moritz both classes need to be in the same file
Skarsnik does not work with different file
sena_kun Back to coding then... 17:48
dalek osystem: a044821 | okaoka++ | META.list:
Add Algorithm::MinMaxHeap to ecosystem

See github.com/okaoka/p6-Algorithm-MinMaxHeap
osystem: f32443a | (Zoffix Znet)++ | META.list:
Merge pull request #169 from okaoka/add-minmaxheap

Add Algorithm::MinMaxHeap to ecosystem
llfourn I often wish there *was* a way stub a class and say that some other module I load will implement it 17:49
though I understand it would be hairy to implement it
dalek p: 95b9baf | FROGGS++ | tools/build/MOAR_REVISION:
bump moar for dir() encoding fix
17:50
FROGGS llfourn: that should work, no?
llfourn FROGGS: I never tried it but I always assumed it didn't
FROGGS stub the class, then use the module that finalizes it
llfourn it would be amazing if it did
llfourn goes to try it 17:51
wait no yes that will work... but what I want it is for them to do it to *eachother*
arcetera so if I had a line in a text file 17:52
that had a '+' before it
how do I store the content after the + in a variable
regexes?
dalek kudo/nom: 374fdd5 | FROGGS++ | tools/build/NQP_REVISION:
bump nqp/moar for dir() encoding fix
sena_kun arcetera, just remove first character using slices?
llfourn mutual-use Foo; # then in foo mutual-use Bar
17:52 TreyHarris left
llfourn I'm not even sure I understand what I am suggesting 17:52
Hotkeys ayy 17:53
17:53 vendethiel joined
arcetera but like if I had a text file that contained 17:53
+ foo
1/12
bar
3/5
and I wanted to get a variable with 'foo'
17:54 ufobat left
Hotkeys Could probably just use a regex for that 17:54
Not sure if you'd even need that 17:55
arcetera idk I'm new to the lang so
perl in general
sena_kun arcetera, ah, like that. Then yes, you need a regex for it. Go over every line with regex and load result in a variable on success.
arcetera as currently I have 17:56
hold on
p.iotek.org/e63
just a snipet 17:57
snippet*
"err" is just a subroutine that pretty prints an error
Hotkeys Why not just use warn
arcetera pretty printing(tm)
RabidGravy OoooOOOooh 17:59
skids m: my $lock = Lock.new; $lock.protect: { 42.say; X::AdHoc.new(:payload(43)).throw; 44.say }; CATCH { when X::AdHoc { $_.message.say; $_.resume } } # bug? 18:00
camelia rakudo-moar 43e763: OUTPUT«42␤43␤Trying to unwind over wrong handler␤»
18:00 wamba left
RabidGravy I've got a "signal(SIGINT).tap({ ... })" if I hit a really quick loop on a whenever it takes ages to fire the tap 18:01
18:01 Sgeo_ joined 18:02 Begi joined
RabidGravy (and yes it has to be done in a separate tap because RT #127428) 18:02
18:03 sjoshi joined
skids "loop on a whenever"? 18:03
18:04 Sgeo left
RabidGravy well "react { whenever $channel { .... } }" where the channel is being fed at around the 10 millisec mark 18:04
unless you want to play at home you don't want the whole story 18:05
skids The SIGINT tap would not by chance be closing the channel? 18:08
RabidGravy no, it keeps a promise that stops the both the reader and writer 18:09
18:09 domidumont joined, domidumont left
skids Oh, was wondering if you were running into RT#123461 18:10
RabidGravy but it doesn't get to the tap at all for some seconds
18:10 domidumont joined
RabidGravy on the face of it that would seem un-related 18:11
18:14 vendethiel left, domidumont left 18:15 kalkin-_ joined
RabidGravy if I halve the rate at which I'm sending to the channel it works better 18:15
18:15 vendethiel joined, domidumont joined, cognominal joined
skids woders what $*SCHEDULER's queuing algorithm looks like. 18:15
Maye I will make that my "light reading" for the night heheh. 18:16
RabidGravy :-O 18:17
18:18 kalkin- left 18:19 ufobat joined
ufobat if you have a array like in that example, how to handle it propperly that there are undefined values somewhere across it: my Int @i; @i[10] = 1; say @i.grep({$_==1}, :k) 18:21
skids m: my Int @i; @i[10] = 1; @i.perl.say 18:22
camelia rakudo-moar 374fdd: OUTPUT«Array[Int].new(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, 1)␤»
skids Undefined values default to the type's default value. 18:23
m: my int @i; @i[10] = 1; @i.perl.say
camelia rakudo-moar 374fdd: OUTPUT«array[int].new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)␤»
ufobat right
but the grep throws a warning: Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?
skids Ah. Because ==. 18:24
m: say Int == 1
camelia rakudo-moar 374fdd: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in block <unit> at /tmp/1lOAo4Ross line 1␤␤»
RabidGravy well then you;d go with something .grep( { $_.defined && $_ == 1 })
skids m: say Int eqv 1 18:25
camelia rakudo-moar 374fdd: OUTPUT«False␤»
RabidGravy or eqv
ufobat what is the differnece between Int and int then? 18:26
skids int is a native
ufobat because my int @i seems to result in easy readable code
18:27 bazzaar joined
RabidGravy you probably don't want to use "int" unless you properly understand the implications 18:27
timotimo m: my Int @i; @i[10] = 1; @i.grep(1, :k).perl.say
camelia rakudo-moar 374fdd: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in block <unit> at /tmp/xgnoE2wbS5 line 1␤␤»
bazzaar \o
RabidGravy or "str", "num" or any of thos
timotimo i wonder what it's good for to throw the warning even in an ACCEPTS like that
FROGGS timotimo: that might be something for you :o) - rt.perl.org/Ticket/Display.html?id=127395 18:30
timotimo right
we'd have to be a bit careful here, because objects are free to do whatever they want when they are asked for existence of methods or lists of methods 18:31
if we notice the HOW is just the regular ClassHOW without special changes applied, we could probably probe it for a list of methods, though
so, can we get our makefiles up to speed with accidentally supplied -j options? 18:33
that would have made arcetera's life so much easier
moritz iirc it's only star that doesn't support -j 18:34
rakudo and nqp should be fine
timotimo oh
moritz I use them regularly
timotimo do we know what exactly in star makes things blow up?
moritz not exactly
timotimo i myself have nearly no clue about proper makefil hygiene 18:35
moritz I have a suspicion that module installation doesn't wait for the compiler, or something
timotimo isn't there some flag to make to output the dependency as a tree that graphviz can render or something?
clearly, we're not the first project in the world to have trouble with -j doing naughty things, so there must be some tooling out there?
bazzaar Hi, I'm seeing a different results between ...... say "$/[0]--$/[1]" and ..... say "$0--$1" for the same regex captures, .... wondering if it's a bug 18:37
moritz might be related to the interpolation rules 18:38
which state that if an expression inside a double-qutoed string starts with a sigil and ends with a postcircumfix, it's actually evaluted
which allows you interpolate things like @array.end() into a string 18:39
18:40 mohae left
timotimo moritz: you mean it would interpret the - as code? i don't think so, though 18:40
but the -- does confuse the parser, it seems like 18:41
18:41 tmch left
moritz m: '5x3' ~~ /(.)x(.)/ and say "$/[0]--$/[1]" 18:41
camelia rakudo-moar 374fdd: OUTPUT«5x3[0]--3␤»
timotimo the AST it outputs is just concatenating the value of $/ with "[0]--" and then the value of $/[1]
moritz yes, that looks like a bug 18:42
timotimo i'd say this is a bug. it should see that the [0] is a successful postcircumfix parse, and ignore the -- after it
bazzaar: so, thank you for finding this bug :) 18:43
bazzaar yes that's the kind of result I got, $0--$1 works fine
timotimo who wants to rakudobug@ it? i'll be AFK for a little bit
moritz Illdo
bazzaar moritz++, timotimo++ 18:44
moritz m: '5x3' ~~ /(.)x(.)/ and say "$/[0]--" 18:45
camelia rakudo-moar 374fdd: OUTPUT«5x3[0]--␤»
moritz m: '5x3' ~~ /(.)x(.)/ and say "$/[0]-"
camelia rakudo-moar 374fdd: OUTPUT«5-␤»
RabidGravy what larks 18:47
18:47 sena_kun left
moritz timotimo: it seems that module-install-{m,j} does not declare a dependency on the installed rakudo 18:49
18:49 arcetera left
moritz timotimo: testing a partial fix now 18:50
18:51 arc__ joined, arc__ is now known as arcetera, arcetera left, arcetera joined 18:52 prammer joined
moritz I guess it needs to depend on rakudo-install even 18:55
18:56 sjoshi left 18:57 shlomif joined, rindolf left 18:58 shlomif is now known as rindolf
dalek kudo/nom: b6f3ecd | lizmat++ | src/core/List.pm:
Make List.join about 20% faster

  - presize memory and bind string values rather than pushing
  - tighten str copy loop
18:59
19:05 dbohdan joined 19:06 Actualeyes left 19:08 themonkeybob11 joined 19:09 zakharyas left 19:10 themonkeybob11 left
FROGGS huh, t/spec/S10-packages/precompilation.rakudo.moar fails now 19:16
RabidGravy oook, I may *almost* have input from a jack source working properly
FROGGS RabidGravy: you are talking about line-in? 19:17
RabidGravy no, that worked fine already, I'm talking about (in this case) input from another program that is outputting audio via the "jack audio connection kit" 19:18
lizmat FROGGS: you mean, after my commit ?
FROGGS ahh, didnt know that such a thing existed 19:19
RabidGravy it could equally be a sound card or something else
FROGGS lizmat: no, before
lizmat ah, fwiw, I didn't see any spectest issues before or after
FROGGS lizmat: I reverted my local changes now... perhaps these are to blame
19:20 sftp left, bazzaar left
FROGGS no, I still get: 19:22
Missing serialize REPR function for REPR NativeRef
in block <unit> at t/spec/S10-packages/precompilation.rakudo.moar line 185
19:22 sftp joined
RabidGravy FROGGS, what I found was that it was using a version literal in "class Foo:ver<v0.1> { }" that was causing it 19:23
FROGGS $ perl6 -It/spec/packages -e '$*REPO.need(CompUnit::DependencySpecification.new(:short-name<RT125090>))' 19:27
===SORRY!===
Missing serialize REPR function for REPR NativeRef
19:27 sftp left
FROGGS and that RT125090.pm only consists of: 19:28
use v6;
BEGIN $*KERNEL;
BEGIN $*DISTRO;
and the last line causes it
lizmat I guess the problem goes away of you don't use the BEGIN right ?
19:28 tmch joined
FROGGS lizmat: yes 19:28
RabidGravy ah, the $*DiSTRO versionifies the OS version 19:29
19:29 bazzaar joined
bazzaar \o 19:29
timotimo i can have a look at the serialization code to see if we have any kind of context we could output along with the error 19:30
lizmat FROGGS: could you try losing the "once" in Version to see if that fixes it ?
alternately, making the int -> Int, and str -> Str ? 19:31
in the Version attributes
FROGGS tries 19:32
timotimo oh
looks like objects are just pushed onto a "todo" list and when an object that landed in that list is then serialized, the exception flies
19:34 sftp joined
FROGGS lizmat: its not the onces 19:34
lizmat could be both 19:35
bazzaar moritz: rakudobug#127701, parsing bug, not limited to '--' after postfix, '++' exhibits same behaviour.
FROGGS lizmat: yes, I changed the attrs now additionally
timotimo bazzaar: are you interested in fuzzing what kinds of text cause the problem?
FROGGS though what I really wanna do is improve that bloody message: Missing serialize REPR function for REPR NativeRef
timotimo lizmat++ # joining strings made faster 19:36
FROGGS lists*
Hotkeys m: my &f = { say @_ }; my &g = { say $_ }; say f(zip 0..4, 5..9); say g(zip 0..4, 5..9)
camelia rakudo-moar b6f3ec: OUTPUT«[0 5 1 6 2 7 3 8 4 9]␤True␤((0 5) (1 6) (2 7) (3 8) (4 9))␤True␤»
Hotkeys why does this happen?
FROGGS lizmat: no, it is also not about the attrs 19:37
Hotkeys: what do you mean?
lizmat ok, dann bin ich überfragt
Hotkeys why does the first one flatten
I'd think it would be a positional of pairs
like the second
do Seqs flatten when put in an array var? 19:38
FROGGS assignment to array does perhaps
m: my $a = zip 0..4, 5..9; say $a
camelia rakudo-moar b6f3ec: OUTPUT«((0 5) (1 6) (2 7) (3 8) (4 9))␤»
FROGGS m: my @a = zip 0..4, 5..9; say @a
camelia rakudo-moar b6f3ec: OUTPUT«[(0 5) (1 6) (2 7) (3 8) (4 9)]␤»
FROGGS hmmm
Hotkeys spooky 19:39
FROGGS m: my &f = { say @_ }; my &g = { say $_ }; say &f.signature; say &g.signature
camelia rakudo-moar b6f3ec: OUTPUT«(*@_)␤(;; $_? is raw)␤»
FROGGS that's the difference
Hotkeys m: sub f (@foo) { say @foo }; f(zip 0..4, 5..9)
camelia rakudo-moar b6f3ec: OUTPUT«((0 5) (1 6) (2 7) (3 8) (4 9))␤»
bazzaar timotimo: yes, would be happy to help in my limited way
Hotkeys ah
strange
FROGGS yes, but intended
Hotkeys I didn't realize it would slurpy
so I should explicitly name the var then 19:40
timotimo bazzaar: like, is it only symbols like + and -, or is it also letters that can cause this? what about other unicode characters?
FROGGS m: my &f = { say @^a }; say &f.signature
camelia rakudo-moar b6f3ec: OUTPUT«(@a)␤»
Hotkeys right 19:41
FROGGS m: my &f = { say @^a }; my &g = { say $_ }; say f(zip 0..4, 5..9); say g(zip 0..4, 5..9)
camelia rakudo-moar b6f3ec: OUTPUT«((0 5) (1 6) (2 7) (3 8) (4 9))␤True␤((0 5) (1 6) (2 7) (3 8) (4 9))␤True␤»
FROGGS or use a placeholder...
dunno
maybe a proper signature states better what you are after
RabidGravy well that was interesting I just had an unexpected coughing fit with a mouthful of blackcurrant juice
bazzaar timotimo: I already checked '**', '****', '//' ... they all seem ok
RabidGravy the computer needed a clean anyway
FROGGS *g* 19:43
bazzaar timotimo: also '-+-' works fine too
timotimo bazzaar: so maybe it's only valid postfix operators that will cause a misparse? 19:45
RabidGravy right let's take this test to the next level
timotimo m: say CORE::.keys.grep(*.name ~~ /post/).map(*.name).say
camelia rakudo-moar b6f3ec: OUTPUT«WhateverCode object coerced to string (please use .gist or .perl to do that) in block <unit> at /tmp/6PE7tTH1Mi line 1␤()␤True␤»
timotimo oops
m: say CORE::.keys.grep({$_.name ~~ /post/)).map(*.name).say
camelia rakudo-moar b6f3ec: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oLv5kzqZLO␤Missing block␤at /tmp/oLv5kzqZLO:1␤------> 3say CORE::.keys.grep({$_.name ~~ /post/7⏏5)).map(*.name).say␤ expecting any of:␤ statement end␤ statement modifier␤ …»
timotimo m: say CORE::.keys.grep({$_.name ~~ /post/}).map(*.name).say
camelia rakudo-moar b6f3ec: OUTPUT«Method 'name' not found for invocant of class 'Str'␤ in block <unit> at /tmp/SvUqPCrdAQ line 1␤␤»
timotimo m: say CORE::.keys.grep(/post/) 19:46
camelia rakudo-moar b6f3ec: OUTPUT«(&postcircumfix:<{ }> &postfix:<i> &postcircumfix:<[ ]> &postfix:<--> &postcircumfix:<[; ]> &postfix:<ⁿ> &postcircumfix:<{; }> &postfix:<++>)␤»
timotimo huh, that's really not a lot
how about defining a new postfix operator; does that change the behavior?
m: sub postfix:<foo>($a){}; say "$[0]foo$[1]" 19:47
camelia rakudo-moar b6f3ec: OUTPUT«0foo1␤»
timotimo m: sub postfix:<foo>($a){}; say "$/[0]foo$/[1]"
camelia rakudo-moar b6f3ec: OUTPUT«Use of Nil in string context in block <unit> at /tmp/owf8xK7heV line 1␤Use of Nil in string context in block <unit> at /tmp/owf8xK7heV line 1␤[0]foo␤»
timotimo m: say "$/[0]foo$/[1]"
camelia rakudo-moar b6f3ec: OUTPUT«Use of Nil in string context in block <unit> at /tmp/8EP00ZoVAq line 1␤Use of Nil in string context in block <unit> at /tmp/8EP00ZoVAq line 1␤foo␤»
timotimo in one it's [0]foo, in the other it's just foo
so the presence of a postfix operator impacts this
we probably do not want this 19:48
19:48 YUAAJF1A joined
FROGGS aha! 19:53
$ perl6 --target=ast --output=/dev/null t/spec/packages/RT125090.pm
===SORRY!===
cannot stringify this
19:53 yqt joined 19:54 renormalist joined
timotimo uh oh, something improper is landing in the ast? 19:54
FROGGS seems like
19:55 brrt joined
FROGGS but I can run it 19:55
ahh no 19:56
--output makes no sense there and throws that message
bazzaar timotimo: seems to just be the autoincrement postfix operators '++' and '--' where the problem occurs [I think?]
timotimo: aaah, but I now see you have identified another way of creating the issue ... 19:59
dalek ar: 41981e7 | moritz++ | tools/build/Makefile.in:
Attempt to fix Makefile when installed with -j4
20:01
20:02 renormalist left
timotimo FROGGS: in general, our argument parsing can cause problems. i've gotten a cryptic error from using more than one --optimize flag by accident 20:02
i *think* it was also a "cannot stringify this"
when trying to compare the option set for "optimize" against "off" with eq 20:03
FROGGS because it got an MVMArray probably
20:04 renormalist joined
FROGGS I'm bisecting my problem now 20:04
jnthn bazzaar, timotimo: We check "is this an OK postcircumfix to interpolate" by looking if we end the sequence of them with a closing bracket of some kind: github.com/rakudo/rakudo/blob/nom/....nqp#L3751 is in Rakudo's grammar, but the standard grammar also would seem to come out with the same, see github.com/perl6/std/blob/master/STD.pm6#L2107
timotimo jnthn: thing is, the only place we do backtracking in our grammar is exactly this place 20:05
jnthn timotimo: True, though it's not really connected to that :)
timotimo oh? dunno
i haven't actually looked at the code itself 20:06
timotimo is currently headachy
jnthn :)
Yeah, just throwing out the appropriate bit in the grammar for if somebody does want to experiment a bit. :)
It's porbably something we can improve on, but for now I suggest to work around it with just using curlies around the bit that should be interpolated 20:07
timotimo of course that works
jnthn Maybe moving the lookbehind inside the quantified thingy would help 20:08
Begi In this page, the link to Module::Skeleton is dead : doc.perl6.org/language/modules-extra 20:10
and I haven't found any "Module::Skeleton" module
timotimo github.com/perl6/ecosystem/pull/130 20:11
brrt jnthn: gist.github.com/bdw/a2851e0697cd38388478
is your list :-)
brane has found no way to 'fix' it yet, beyond the pragmatic approach outlined earlier 20:12
FROGGS timotimo: umm, he has moved his stuff to bitbucket 20:13
timotimo oh, is that what happened!
FROGGS Begi: so it is here now: bitbucket.org/rightfold/module-skeleton
Begi timotimo : the module doesn't exist anymore
Ah, thanks !
jnthn brrt: Hm, thanks :) 20:14
geekosaur rightfold distrusts github, iirc
brrt well, i don't expect a fix, because it isn't broken per se... it's just suboptimal
and inelegant and difficult-to-maintain because it subtly depends on ordering
in implicit ways
jnthn *nod*
Yeah, it's easy in a lego JIT :) 20:15
brrt yeah :-) 20:16
jnthn brrt: How nasty is it to walk the stack to find the pushed stack base pointer on a call? ;)
brrt not very nasty from the perspective of an assembly programmer 20:17
it's literally the top of the stack on function entry
20:17 sftp left, darutoko- left
brrt but that's not the most common use, though 20:17
jnthn Oh? 20:18
20:18 abaugher left
brrt well, in most cases... 20:18
ehm
letme think about that for a bit
jnthn I thought in most cases we're in a C function when we need to know what the JIT code's PC is?
Well, in all cases
brrt yep
20:18 abaugher joined
dalek osystem: 7da2d92 | RabidGravy++ | META.list:
Let's fix that last entry
20:19
20:19 sftp joined
brrt but, due to trampolining, in most cases the c function will not be stack-downward from the jit code 20:19
jnthn So if we're currently running that bit of JITted code wehn we call that C function then the JIT code is on the system stack, and if it's not the current one then we will have saved the label so we can re-enter it at the right point?
brrt yes 20:20
correct
which is why it is so puzzling why that wasn't enough
FROGGS lizmat: I bisected it to 02122e5e67d0c9738c81b5986394681b96982b1d
trying to get any clues out of that now
jnthn brrt: Maybe 'cus today we only do the second part of it?
brrt hmm 20:21
decent enough point
cognominal Hi. I am looking at nqp-js and I see a lot of node stuff so the following question. Does nqp-js generated code can run in a browser, that is without node?
RabidGravy goes to show how many people use my modules 20:22
brrt basically, if we could limit saving the pc to those routines were we needed to, then we could skip the dynamic-comtrol-label insertion
jnthn iiuc, we end up updating jit_entry_label in a bunch more places than invokish things for the times when it's the currently executing bit of JIT code
And we need to know our position accurately
RabidGravy the META.list entry for Audio::Encode::LameMP3 was broken for two weeks and no-one noticed :-\
brrt uhuh... one of the difficulties, i think, is adhoc throwing, which may happen anywhere 20:23
lizmat cognominal: I think the answer to your question is: no
brrt so you need to know your exact position in a lot more cases than you'd expect
jnthn brrt: Yeah, which is why I was wondering if we can find the pushed stack pointer :)
bazzaar jnthn: thanks for providing the links to the relevant code lines in the rakudo/std grammars, ... helpful for a newbie like what I am :)
jnthn brrt: 'cus part of the C calling conventions involve saving that, iirc?
brrt yes
all call conventions do 20:24
jnthn Right, so the address we want *is* available, if only we can find the darn thing :)
brrt lemmesee if i can hack up an example
jnthn wonders if we're scaring the inhabitants of #perl6 with assembly fun on purpose rather than discussing it on #moarvm :P 20:25
RabidGravy doesn't scare me, if you don't mind me rambling on about some audio stuff later ;-)
dalek c: 9538b1e | Emeric54++ | doc/Language/modules-extra.pod:
new link
c: 4db9cef | FROGGS++ | doc/Language/modules-extra.pod:
Merge pull request #422 from Emeric54/patch-1

Replace a dead link
cognominal thx lizmat++. Too bad. Perl 6, even in a restricted form, need to run on a browser to get acceptance. 20:26
jnthn brrt: Going for a short walk; bbi10 :)
RabidGravy oh, and if anyone is bored I found another case where code members in a CStruct would be used 20:27
brrt ok, i'll have it hacked up then :-)
lizmat cognominal: but what is the problem of the node.js dependency in the browser then ?
cognominal nodejs is a server side things 20:28
20:28 musiKk_ joined
RabidGravy but it uses the same JS engine as e.g. Chrome right? 20:28
timotimo cognominal: nqp-js is supposed to run in a browser, too
lizmat cognominal: it is ??? it's been a while since I did JS, but I distinctly remember using Node.js in the browser 20:29
timotimo just needs a bit of work before it does
lizmat: you can doctor code that's meant for nodejs to run in the browser, but a big amount of stuff is unavailable to you in the browser that node.js code normally relies upon
cognominal lizmat, good to know. Apparently I have been out of touch
lizmat need to commute for a bit& 20:30
20:30 lizmat left 20:31 rindolf left, rindolf joined
FROGGS RabidGravy: do tell 20:31
cognominal ok, I thougt node and node.js were the same thing. So node.js indeed is node on the browser while node is the original thing server side only. 20:32
timotimo uh, wait, what?
20:32 domidumont left
RabidGravy the LADSPA (and indeed LV2) plugin framework hands you a struct with the pointers to the functions in the plugin to start/stop/send data/read data 20:32
timotimo since when ?!?! 20:33
cognominal did I got the things right?
timotimo where did you find that node.js?
because i've never heard of node.js boing something different from node
20:34 bazzaar left
RabidGravy there may however be a library to allow the node code to run unaltered on the browser with some shim or polyfill or whatever they call it now 20:34
it would have to fake up some of the IO stuff 20:35
cognominal ok, then. We are back to my original question. if node[.js]? is serverside, how can nqp-js runtime can run in a browser?
dalek c/feed-operators: c06a01e | (Brock Wilcox)++ | doc/Language/operators.pod:
Pipeline is something I hallucinated -- should be feed
20:36
cognominal RabidGravy, that would be that browserify thing?
RabidGravy node.js is only a javascript rumtime that replaces the browser specific stuff with some server specific stuff that it can do 20:37
cognominal but browserify seem just a hack for requireing modules
RabidGravy the language is the same
yeah a good body of javascript code will run in the browser or in node 20:38
I've got a test harness somewhere here that tests a node server by pretending to be a browser in another node script 20:39
cognominal I guess IO and process relative stuff is the problem because browser is a restricted environment
RabidGravy all the basic language is identical, just node supplies some additional objects for IO and stuff 20:40
timotimo neatly packed away in modules, usually
when and where will yapc::europe 2016 happen? 20:41
RabidGravy in my front room in a couple of days? 20:42
cognominal For exemple, in vm/js/npq-runtime/io.js I see a lot of stuff I suspect won't run in a brwoser.
timotimo i've been told where, but i've forgotten
20:42 pmurias joined
timotimo and i've also been told where gpw2017 will happen, but i also forgot 20:42
20:42 bazzaar joined
pmurias backlogs nqp-js stuff... 20:42
RabidGravy cognominal, yeah you would have to polyfill those in the browser
but the way that JS works you can just supply another thing for it and as long as it has the right interface it will "work" 20:43
pmurias cognominal: to run code emitted by nqp-js I use webpack, so that require('module') works
FROGGS YAPC Europe
August 24 - 26, 2016
Cluj-Napoca, Romania
garu tadzik: whenever you feel like it, could you give me feedback on github.com/tadzik/rakudobrew/pull/84 please? 20:44
FROGGS timotimo: ^^
pmurias cognominal: some stuff will be replaced by browser running versions, other modules (for IO stuff) are replaced by placeholders that fails on use
timotimo FROGGS: i seem to recall it was supposed to be in switzerland or in austria? or was that next year's yapc::europe?
cognominal pmurias, that makes sense. 20:45
brrt .tell jnthn: it is no more than this
yoleaux brrt: What kind of a name is "jnthn:"?!
cognominal Do you have any documentation about using nqp-js runtime on the browser ?
brrt .tell jnthn github.com/bdw/lab/blob/master/asm/cont.s
yoleaux brrt: I'll pass your message to jnthn.
pmurias there is an example in examples/webpacked 20:46
cognominal pmurias++
FROGGS timotimo: dunno, not heard yet of the yapc 2017, usually it is announced when the current yapc closes
timotimo ah
hm. i wonder what i've mistaken it with/for, then
FROGGS timotimo: alpine perl workshop 2016? 20:47
which is spw + apw
cognominal example/webpacked is probably answering most of my questions.
timotimo maybe. when's that? 20:48
20:51 lizmat joined
cognominal pmurias, indeed I see in webpack.js that many modules are resolved to the empty-module 20:52
jnthn brrt: Hm, and where'd we put that? 20:53
yoleaux 20:45Z <brrt> jnthn: github.com/bdw/lab/blob/master/asm/cont.s
stmuk_ timotimo: I think its early Sept but forget the exact date
20:55 labster joined
cognominal boy, that p5.js name. Yet another potential source of confusion for old timers. 20:55
20:55 SCHAAP137 left
bazzaar timotimo: further update re. parsing bug [#127701], the strings '---', '----', '-----', ...etc, and '+++', '++++', '+++++', ...etc, also highlight the problematic parse code 20:56
timotimo stmuk_: thanks d)
:)
cognominal p5.js seems a d3 sort of thing. 20:57
I am ranting about that github.com/perl6/nqp/blob/master/e...ex.html#L7 :) 20:58
20:58 travis-ci joined
travis-ci Doc build passed. Brock Wilcox 'Pipeline is something I hallucinated -- should be feed' 20:58
travis-ci.org/perl6/doc/builds/115723788 github.com/perl6/doc/commit/c06a01e5d5f0
20:58 travis-ci left
brrt we could do a pre-call-wrapper 20:58
e.g. pass the function-to-call in a register (what happens currently), call the wrapper, pass the cc as an argument 20:59
but that would require modifying all callee's...
20:59 CIAvash left
cognominal probably nqp-js on the browser is more or less like a restricted Perl 6 setting 20:59
vendethiel that makes sense 21:00
lizmat FROGGS: do you have a golf for the problem you found? so I could also look at it? 21:01
brrt is still dreaming about a module to build arbitrary process pipelines
vendethiel hah, for a moment, I thought p5js was perl 5 in the browser and felt very confused :P
21:02 bazzaar left
cognominal vendethiel, same here 21:02
dalek c: c06a01e | (Brock Wilcox)++ | doc/Language/operators.pod:
Pipeline is something I hallucinated -- should be feed
21:05
c: 5ac95ba | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Language/operators.pod:
Merge pull request #423 from perl6/feed-operators

  “Feed” instead of “Pipeline”
21:11 pmqs joined
FROGGS lizmat: perl6 --target=mbc --output=/dev/null t/spec/packages/RT125090.pm 21:11
lizmat FROGGS: thanks 21:12
FROGGS I still dont know what of your patch is to blame 21:13
21:13 olpery joined
olpery hey ho 21:13
Begi hey
FROGGS hi olpery
olpery how come 0.1 + 0.2 = 0.3 in perl6? that's impressive :) does it convert to rationals internally?
Begi How can I check if my input is Ctrl+D for example ?
timotimo olpery: yeah, we turn 0.1 and such into Rat objects when parsing 21:14
m: say 0.1.WHAT
camelia rakudo-moar b6f3ec: OUTPUT«(Rat)␤»
FROGGS m: say 0.1.WHAT # olpery
camelia rakudo-moar b6f3ec: OUTPUT«(Rat)␤»
timotimo m: say 0.1e0.WHAT
camelia rakudo-moar b6f3ec: OUTPUT«(Num)␤»
timotimo m: say 0.1234567890123456789.WHAT
camelia rakudo-moar b6f3ec: OUTPUT«(Rat)␤»
timotimo m: say 0.1234567890123456789999999999999999999999.WHAT
camelia rakudo-moar b6f3ec: OUTPUT«(Rat)␤»
timotimo m: say 0.1234567890123456789999999999999999999999.perl
camelia rakudo-moar b6f3ec: OUTPUT«<1234567890123456789999999999999999999999/10000000000000000303786028427003666890752>␤»
timotimo m: say 0.12345678901234567899999999999999999999999999999999999999999.perl
camelia rakudo-moar b6f3ec: OUTPUT«<4115226300411522633333333333333333333333333333333333333333/33333333333333332389596016520154733616645442788725719302144>␤»
olpery clever. i wonder if i can do the same with GMP in my own lame language 21:15
FROGGS m: say 0.1234567890123456789.nude
camelia rakudo-moar b6f3ec: OUTPUT«(1234567890123456789 10000000000000000000)␤»
timotimo this is probably already a FatRat?
olpery: for our big integers we use libtommath rather than GMP
it seemed like GMP was extremely difficult to integrate with what we had, so we went with tommath for that
olpery i actually use MPIR, but same same :)
timotimo: i'll take a look
FROGGS olpery: have a look at src/core/Rat.pm 21:16
olpery thanks
FROGGS (in the rakudo repo)
timotimo our Rat objects are 100% implemented in pure perl6
olpery looking 21:17
Begi How can I check if my input is Ctrl+D for example ?
timotimo well, in the case of ctrl-d, you'd check if stdin got closed/eof-d
pmurias cognominal: it's very likely there might be a special browser rakudo-js setting that will warn you that something is unsupported in the browser
RabidGravy close but no banana with my next step toward world domination 21:19
timotimo no ban! 21:20
olpery so Rat computes fractions using, well, continued fractions?
RabidGravy not *quite* fast enough to read a portaudio source, encode it to MP3 and then stream to an icecast mount
olpery i understand Stern-Brocot trees is another way 21:21
not sure what Rat does
21:22 travis-ci joined
travis-ci Doc build failed. Aleks-Daniel Jakimenko-Aleksejev 'Merge pull request #423 from perl6/feed-operators 21:22
travis-ci.org/perl6/doc/builds/115727685 github.com/perl6/doc/compare/4db9c...c95bafe537
21:22 travis-ci left
timotimo olpery: i think it's simpler than that 21:22
olpery yeah? 21:23
21:23 placeboPenguin left
timotimo gimme a sec. 21:23
i'll find the code that turns parsed numbers into rats
olpery awesome 21:24
RabidGravy it's in the ball park though
FROGGS rakudo/src/Perl6/Actions.nqp:7129: } else { # wants a Rat
timotimo: ^^ ?
timotimo ah, you were faster than me
thanks
FROGGS so it is token/method dec_number
cognominal pmurias, thx for your answers 21:25
21:25 kaare_ left
olpery ok, so it's that magical nqp::fromnum_I 21:26
FROGGS lizmat: method new seems to be at fault
olpery so i need to figure out what fromnum_I does
nadim Hi all. I se a little problem and I though I would ball it a bit to see if other can see the same behavior. I have seen this problem back and forth quite a few times since I started with P6. since it is intermittent I did think that I was sing things. till today.
lizmat FROGGS: do you know which candidate ? 21:27
FROGGS lizmat: not yet
dalek p: cf7fe9c | timotimo++ | src/vm/moar/profiler/template.html:
unbreak names of allocated things in profiler html app
21:29
21:29 geraud joined
nadim the dumper I have looks at $x.WHERE toknow if the element has beendisplayed before. I am now working on a diff functionality. The diff, after the dump has been made, removes color codes and then displayed. the code that removes the colors is far away from the rendering code. 21:29
jnthn nadim: Use .WHICH, not .WHERE, for that
nadim: Objects move during their lifetime, and so .WHERE can change.
nadim Good to know 21:30
FROGGS lizmat: the third (biggest)... when I replace it with the following line it works: nqp::create(self)!SET-SELF(nqp::list("42"),0,"42")
timotimo .WHICH will automatically use our "persistent object id" mechanism?
nadim the surprising thing is this, depending on the diff code, far away, the rendering is different brecause the objects don't get the same address. 21:31
RabidGravy yeah
jnthn timotimo: yeah
nadim: Yeah, they potentially move whenever GC runs
nadim I'd be OK with that but from the second run of the same code, the address is correct and doesn't change anymore
jnthn nadim: Which can be at any point in time
And easily affected by stuff like whether we already have precompilations cached or not 21:32
Basically, anything that changes the number of memory allocations can influence it.
nadim I buy all the address moing, GC, and so on. but why is the first run different from all the other runs?
jnthn On the first run after you change the module in some way? 21:33
Probably because the first run has to pre-compile the module, and the second run just uses that.
FROGGS lizmat: it is the "something sensible given" branch
lizmat FROGGS: I only just got around to trying your golf, but that doesn't fail for me :-( 21:34
nadim jnthn: IMHO, it would be good if the code run the first time is the same as the other times.
21:34 brrt left
FROGGS lizmat: well, it does not fail for you with a clean rakudo anyway, no? 21:34
nadim But I'll use WHICH and see if this happens again. 21:35
lizmat FROGGS: indeed, no failures whatsoever in spectest
jnthn nadim: Then stick "no precompilation;" in your code and enjoy the slowness and repeatability :P
nadim Anyway, it's good that my gut feeling was right andthat I wasn't totally paranoid
jnthn: hell no! but I'd stick to slower precompilation, then the pre-compiled code being the one used at the first run too. 21:36
Thanks for the feedback, I'll do some changes now.
21:37 olpery left
FROGGS lizmat: well, then you cant hunt that bug :o) 21:37
lizmat FROGGS: 'fraid so :-(
jnthn nadim: I rather suspect the logic to do that would also allocate and put us back at square one anyway :)
21:37 olpery joined 21:38 olpery is now known as Guest44552 21:40 tmch left
nadim jnthn: seems that WHICH can't really replace WHERE. Cannot call Numeric(ObjAt: ); none of these signatures match: (Mu:U \v: *%_) 21:40
We don't like"squae one" ;)
jnthn nadim: Is there any reason you're not doing a my %stuff{Mu}; object hash? 21:41
And using that for your seen hash?
21:42 musiKk_ left 21:43 espadrine joined, wamba joined
nadim I am not doing any Mu monkey business, I havetwo references and I call .WHICH on them, the dumper knows nothing about them 21:46
patrickz I'm currently trying to track #123934 down (Regex LTM + backtracking + ratchet failure). From what the debugger tells me it's failing to backtrack into LTM alternations where it should. 21:47
21:47 Guest44552 left
dalek kudo/nom: 24d42d1 | lizmat++ | src/core/Map.pm:
Streamline Map.STORE: making it 10% faster
21:47
patrickz I'm now looking at nqp/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp:300. Is that roughly the right place?
21:57 Skarsnik left
jnthn This week's report: 6guts.wordpress.com/2016/03/13/can...ry-issues/ 22:04
22:04 Begi left
jnthn patrickz: Well, it's at least a relevant place :) 22:04
patrickz Ok then I'll look deeper in that part of the code. Thx. Is there an NQP debugger that allows debugging these compilation steps? 22:06
these = NQP parts 22:07
jnthn No
patrickz printftw!
jnthn Though you can look at the generated code by compiling to a moarvm file and then moar --dump foo.moarvm
timotimo jnthn: nice autopun in the title
jnthn ;) 22:08
22:10 olpery_ joined, olpery_ is now known as Guest44432
lizmat jnthn: "instropsecting" 22:13
jnthn lol
fixed, thanks 22:14
lizmat jnthn: "becuase"
jnthn: "unlikely,though" (space missing)
22:15 nowan left
dalek kudo/nom: a3422a0 | lizmat++ | src/ (2 files):
Make "use lib" error more awesome

  $ 6 'use lib'
  ===SORRY!=== Error while compiling -e
Must specify at least one repository. Did you mean 'use lib "lib"' ?
22:17
22:19 lizmat_ joined, ufobat left, MilkmanDan left, Sgeo__ joined
jnthn lizmat: Those too, thanks :) 22:19
22:20 lizmat left, lizmat_ is now known as lizmat, Sgeo_ left
lizmat jnthn: you're welcome :-) 22:20
22:21 pmurias left 22:24 nowan joined
lizmat good night, #perl6! 22:26
timotimo gnite lizmat
good work today :)
22:26 Guest44432 left, lizmat left
RabidGravy Hmm this is quite odd, recording from a jack source is kinda sorta okay, but adding the encode and stream it goes really quite wonky 22:27
22:28 rindolf left
RabidGravy I'm wondering if I need to copy the values in the array 22:28
22:28 maybekoo2 left
RabidGravy which is less than ideal 22:29
timotimo you're rpobably not meeting its realtime requirements?
22:30 telex left
RabidGravy weeeelll all the parts seem to work with reasonable throughput 22:30
22:30 rindolf joined
RabidGravy i.e. PortAudio -> Sndfile to record 22:31
timotimo ok
RabidGravy and Sndfile -> LameMP3 -> Libshout works fine at a higher rate even
but PortAudio -> LameMP3 -> Libshout is going weird 22:32
22:32 telex joined
RabidGravy it's possible that I am violating one or more of those expectations of const-ness 22:33
FROGGS yay, finally got a fix for that t/spec/S10-packages/precompilation.rakudo.moar fail 22:37
RabidGravy FROGGS++ 22:38
groovetastic
FROGGS hehe
22:40 vendethiel left
FROGGS will push tomorrow... computer can spectest while I sleep 22:40
gnight &
timotimo gnite FROGGS 22:41
RabidGravy If I copy the elements of CArray to another array of some description they are no longer bound to the original CArray right?
timotimo CArray cannot hold scalars, so they can't be bound to something else, i don't think.
RabidGravy so the original source can do what it wants with the CArray afterwards and all will be good 22:42
timotimo you can nativecast the CArray to a Pointer and get its memory address; its .WHICH or .WHERE may also give you that 22:44
RabidGravy or it can get GCd even, which is possible explanation as it seems to go wonky after a biit which seems to be a function of the number of iterations
actually the more I think about it that is a likely explanation as the liblame must keep at least some of the input around so it can produce a complete frame between an unknown amount of input data and the possible result of compression 22:49
timotimo could be, yeah 22:50
RabidGravy so if the "cached" input starts going away or being replaced under it then it won't be able to produce complete frames 22:51
will try this hypothesis in the morning 22:52
of course it hinges on whether the copy can be done quick enough 22:53
skids Or you could hold onto the CArray until you're sure it is not being accessed anymore. 22:56
arcetera so 22:58
hmm 22:59
22:59 kid51 left
RabidGravy unfortunately I'm not sure you can know that without trying to guess what the mp3 encoder is going to do with the input 22:59
23:00 vendethiel joined, kid51 joined
arcetera anyone here familiar with Net::Curl? 23:00
if so
if I had a curl command that was "curl --silent -F key=shblah -F file=@/tmp/scrot.png -F method="son" oops.moe/upload.php" 23:01
how would I do that with Net::Curl and libcurl? can't find the docs for it
skids RabdGravy: Well, The API should say who is responsible for alloc/dealloc and if it's the app, offer a way to tell. If the API says it wil free the buffer, you probably don't want to feed a rakudo-managed CArray in. 23:02
arcetera I mean I can find plenty of docs for libcurl 23:05
but not for Net::Curl
RabidGravy well, it does seem to be a bit sparse on documentation 23:07
skids arcetera: Loos like Net::Curl is currently only at the point of supporting the "Easy" libcurl interface. It's probably a pretty straight mapping to the C API from the look of it. 23:08
RabidGravy azawawi isn't here right now but maybe in the morning (wherever he lives) 23:09
23:09 espadrine left
dalek p: 43a819e | timotimo++ | src/vm/moar/HLL/Backend.nqp:
make profile a tiny bit smaller still

by remapping IDs (which are usually 8 digits long) to the value of a counter that starts at 0.
23:13
arcetera how do I use forms with Net::Curl 23:15
23:16 MilkmanDan joined, jolts joined
dalek p: 2138e0e | timotimo++ | src/vm/moar/profiler/template.html:
set up "type" property unconditionally in profiler's allocs.
23:18
skids arcetera: probably through CURLOPT_POSTFIELDS curl.haxx.se/libcurl/c/CURLOPT_POSTFIELDS.html
arcetera so like 23:19
curl_easy_setopt($curl, CURLOPT_POSTFIELDS, key=shblah); 23:20
?
timotimo that's not valid syntax. it probably wants a string as the third option?
skids The last parm needs to be a string.
arcetera so quote "key=shblah"
as what I'm tryna do is accomplish
curl -F key=shblah -F file=@/tmp/somefile.png -F method="json" oops.moe/upload.php 23:21
where shblah is stored in a variable $oopskey
and file is the argument passed to the program
RabidGravy right, 23:22
23:23 vendethiel left
arcetera can someone look over my code so far 23:24
kinda a mess but hey
sprunge.us/YMaV
oopsrc is just a file containing a very long string of text which i can't share
the documentation for the site i'm tryna upload to is here oops.moe/ 23:25
RabidGravy looks plausible
arcetera but how do i use oops.moe/upload.php not oops.moe 23:26
if not changing CURLOPT_URL
this is a learning experience wow
maybe after this i'll actually understand the lang hehe 23:27
oh hm
RabidGravy er, I'm not sure this is a language thing
arcetera more curl
RabidGravy I haven't the faintest about curl, libcurl 23:28
arcetera same
aight 23:29
changed the code a bit and here's the problem
RabidGravy however you appear to want do make an HTTP POST with multipart form data which includes a file
arcetera sprunge.us/YPRF error
sprunge.us/XRcD half-baked code
this happens when i run it with an arg 23:30
RabidGravy right, that's just telling you you haven't got the arguments right, in lieu of documentation I'd look at the code of the module 23:32
or ask the author when he is next around 23:33
skids Yeah I don't know what's hanging up NC MMD here. using uint16.new(CURLOPT_URL) doesn't work either. Hmm maybe there's an example in the tests. 23:34
arcetera I like Perl 6 so far as a lang but the lack of documentation bothers me :L 23:35
RabidGravy I think there's a possibility that's afflicted by the "too specific NC type constraint" thing
arcetera, the language is fairly well documented, modules in the ecosystem vary 23:36
timotimo which reminds me i ought to write a bunch of documentation about/for SDL2::Raw
23:36 notbenh joined
RabidGravy I keep meaning to take a look at that 23:37
timotimo it has nice little examples 23:38
two of those use Cairo in addition
(to render sprite sheets on the fly)
RabidGravy I find in general that it takes me about a day to make the documentation for a reasonable sized module 23:40
23:46 tmch joined 23:47 b777 joined
AlexDaniel “the language is fairly well documented” – except for certain things that are completely missing. If you stumble upon those, please submit an issue: github.com/perl6/doc/issues/new 23:47
23:47 tmch left
RabidGravy well yes 23:48
23:48 tmch joined
skids Yeah I think Net::Curl must be bitrotted. Net::Curl::Easy's download runs into the same error. 23:49
RabidGravy it's catch azawawi in the morning then :)
anyway off to sleep now, toodles
23:53 patrickz left 23:54 b777 left, RabidGravy left, rr joined, rr left 23:57 autarch1 joined 23:58 firstdayonthejob left, autarch left