»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
johnjohn101 about time for the yearly checkin on this board 00:00
soon?
sorear huh? 00:03
what are you talking about?
johnjohn101 is this finished yet? 00:04
sorear is what finished yet
johnjohn101 perl 6?
sorear perl 6 will never be finished, that's a stupid question
TimToady perl 5 isn't finished yet
sorear it's like asking when the us gov't will finish paving our highways 00:05
masak johnjohn101: is there anything special you'd like us to work on?
johnjohn101 i was just curious if odbc and/or json is working with the current version 00:06
TimToady jnthn++ gave a talk on json yesterday
masak as far as I know, the JSON::Tiny module is working. 00:07
sorear thank you, that'as a much better question.
johnjohn101 anything that I can look at?
sorear json is well supported
odbc, not so much
we do have a couple database access modules
TimToady there's DBIish so far
sorear but I don't think any of them support the Open Database Connector 00:08
masak how does Niecza do on databases?
felher pmichaud: nope, >>This is perl6 version 2012.09.1 built on parrot 4.8.0 revision RELEASE_4_8_0-83-g2922c18<< has not fixed my '$*IN.get' problem :)
sorear masak: there's no special support but you can use one of the fifteen million .net database libs if you want
pmichaud felher: okay, that's about what I expected. Thanks for the test, it's very helpful.
felher pmichaud: np :)
pmichaud (you can go back to --gen-parrot=RELEASE_4_7_0 now :)
masak sorear: ah. that should work.
johnjohn101 will i have to be running perl 6 on linux or is there any for win32? 00:09
TimToady jnthn++ was demoing on Windows
sorear there is a rakudo core dev (jnthn) on Windows
felher pmichaud: kk. Let me know if you need some other tests :)
masak TimToady: am I to understand you're in Tokyo?
sorear rakudo star makes MSIs, right? 00:10
TimToady well, I'm about 250 feet above Tokyo
masak 's powers of deduction still seem to work at 2 o'clock in the night
sorear TimToady: is that a building or a plane? 00:11
felher oh, yeah, 2 o'clock. good point. Good night, folks :) 00:12
TimToady 24th floor of a 40 story building, where the Pauley's live
johnjohn101 do you have any quick links to any perl 6 vids on the next? 00:15
jnthn morning, #perl6
johnjohn101 how soon to production ready?
jnthn sorear: If the plane is only 250ft above Tokyo, I really don't wanna be on it! :P
masak johnjohn101: production ready isn't an absolute. as for me, it was two years ago. 00:16
TimToady please define "production"; ready for some things, enough to have 450 working rosettacode.org examples
masak 'night, #perl6
jnthn bah, these people who go to bed when I'm getting up :P 00:18
johnjohn101 I'm still running a lot of perl 5 stuff including countless win32 services and scheduled processes in win32 and linux. Not really sure where/when I want to start messing with perl 6. all is working fantastic now. 00:21
jnthn johnjohn101: Somewhere that Perl 6 makes things easier.
sorear jnthn: when planes are landing, I prefer their altitude to be a continuous function of time, it's really disconcerting to go directly from 251 to 249 00:24
also that can get you in trouble with special relativiity 00:25
mikemol TimToady: I think the recent change to documenting breaking changes will go a long way to making people more comfortable to use it in production. And if breaking changes can be warned of in advance, it'll go further. I think what's really being looked for is easily measurable evidence that breaking changes happen farther and farther apart. 00:31
mikemol struggles over 'farther' vs 'further'
TimToady heads toward venue where he can only read IRC, not write it... 00:50
sorear read-only irc? 00:51
why would they do such a thing
diakopter TimToady: :P use webchat.freenode.net/?channels=perl...imToady___ 00:53
sorear huh, I thought we banned freenode webchat 00:55
diakopter I hope not 00:55
diakopter___ o hai 00:55
sorear o/ anuby 01:03
diakopter sorear: the reason I say I hope not is the prominent link to it on perl6.org and that we do get visitors from there somewhat regularly 01:04
shachaf I've been in situations where my connection to the server that runs my IRC client became read-only. 01:11
Incoming packets only, not outgoing. 01:12
sorear shachaf: PONG
you cannot have a one-way irc connection 01:13
unless there's deep packet butchering going on to allow PONG but remove PRIVMSG
shachaf sorear: Not my IRC connection, my connection to the server that ran my IRC client.
(It also prevents switching windows in irssi.)
sorear were you still able to send ACK packets? what happens with the TCP window fills up? 01:14
shachaf I don't remember the exact situation but it's possible I was using mosh, whih uses UDP? 01:15
jnthn pmichaud: Discovered a regex compiler bug while working on p5regex, it seems 01:24
r: say 'abcde' ~~ /$<x>=[<?>]de/
p6eval rakudo 7d227d: OUTPUT«#<failed match>␤»
jnthn pmichaud: An empty subcapture busts scanning 01:25
pmichaud: I don't immediately see why; any suggestions welcome :)
dalek p: 9c348a6 | jonathan++ | src/QRegex/P5Regex/ (2 files):
Support empty positional captures.
01:29
p: e579e8e | jonathan++ | t/p5regex/rx_captures:
Test empty captures in p5regex.

Includes a failing test for when one is at the start, which breaks scanning.
jnthn heading to conf venue & 02:01
ZhiweiChen anybody here? 02:12
Timbus ehhh, rakudo is doing funny stuff w/r/t strings pulled from a socket again 04:21
my $line = $conn.get.encode('utf-8').decode('utf8') is currently needed to not crash my bot 04:22
running 'lc $line' without the encode+decode results in parrot spitting an error: Invalid operation on binary string 04:23
just thought id let someone know 04:24
sorear Timbus: I think it's pretty well known at this point that sockets are borken in rakudo 04:38
Timbus yes :/
moritz arnsholt: zavolaj tests fail on linux :( 06:37
t/04-pointers.t ........ Cannot locate native library './04-pointers'
same for all the tests
it doesn't seem to append the .so properly
but nativecall does work for installed .so files
moritz no, I retract that statement 06:40
ok 2 - MiniDBD::Pg version 0.01 06:41
# Connect failed with error Cannot locate native library 'libpq'
dalek Iish: c3ef1ca | moritz++ | lib/DBDish/Pg.pm6:
[Pg] escape connection params
06:43
Iish: 86e1381 | moritz++ | lib/DBDish/Pg.pm6:
[Pg] factor out library name into a constant
dalek Iish: 6efd237 | moritz++ | Makefile:
unbust installation with current rakudo
06:52
dalek Iish: 44c09e2 | moritz++ | lib/DBDish/Pg.pm6:
[Pg] make lib a lexical constant

also changed it to libpq.so for now, becaues that works on my system
06:54
dalek Iish: 1cb4082 | moritz++ | lib/DBDish (2 files):
quote-identifier
07:25
tadzik good morning 07:34
moritz good morning tadzik 07:35
my micro ORM now supports inserting an object :-)
tadzik nice :) 07:36
moritz and insertion already limits it to postgres (or firebird) 07:39
because I do the INSERT INTO table (...) VALUES (...) RETURING id; stunt
\o/ updating works too 07:40
but I guess that selecting is the hard part 07:42
sorear greetings, TimToady___ 07:53
TimToady___ nr: my $x = 12345; sprintf "%02d:%02d:%02d", (($x,$x,$x Z/ 3600,60,1) X% 60);
sorear my, Larry, what a huge tail you have!
p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: index out of range␤ at /home/p6eval/niecza/lib/CORE.setting line 1303 (sprintf @ 4) ␤ at /tmp/X5RpaYg1y_ line 1 (mainline @ 6) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting …
..rakudo 7d227d: ( no output )
TimToady___ nr: my $x = 12345; say sprintf "%02d:%02d:%02d", (($x,$x,$x Z/ 3600,60,1) X% 60); 07:54
p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: index out of range␤ at /home/p6eval/niecza/lib/CORE.setting line 1303 (sprintf @ 4) ␤ at /tmp/OQUAGD8JgD line 1 (mainline @ 6) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting …
..rakudo 7d227d: OUTPUT«03:25:45␤»
TimToady___ nieczabug
nr: my $x = 12345; say sprintf "%02d:%02d:%02d", |(($x,$x,$x Z/ 3600,60,1) X% 60);
p6eval rakudo 7d227d, niecza v22-6-g9e5350d: OUTPUT«03:25:45␤»
TimToady___ shouldn't need the |
sorear I agree
TimToady___ rosettacode.org/wiki/Averages/Mean_...day#Perl_6 08:04
GlitchMr 59? 08:06
Something is wrong
TimToady___ 59 what? 08:07
GlitchMr '59:47:43 is the mean time of 23:00:17 23:40:20 00:12:45 00:17:19'
TimToady___ oh, I see
GlitchMr 59:47:43 08:08
moritz did you ever divide by the number of elements? 08:09
GlitchMr I like Perl 6 solution, but 59 doesn't seem right
(but I like PicoLisp solution more) 08:10
TimToady___ fixed
GlitchMr Now it feels correct 08:11
TimToady___ I wish we had base 60 :)
:60[$h,$m,$s] oughta work... 08:12
moritz r: say :60[2, 2] 08:13
p6eval rakudo 7d227d: OUTPUT«===SORRY!===␤Malformed radix number␤at /tmp/pCLz7pnmCC:1␤»
moritz n: say :60[2, 2] 08:14
p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: :16[...] syntax NYI␤ at /home/p6eval/niecza/lib/CORE.setting line 1437 (die @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3595 (unbase @ 8) ␤ at /tmp/rud_jdIfia line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting l…
moritz std: say :60[2, 2]
p6eval std 77327a4: OUTPUT«ok 00:00 44m␤»
moritz r: say :16('a', '4') 08:15
p6eval rakudo 7d227d: OUTPUT«Nominal type check failed for parameter '$str'; expected Str but got Parcel instead␤ in sub unbase at src/gen/CORE.setting:4620␤ in block at /tmp/psWWEhOA45:1␤␤»
moritz should that work too?
GlitchMr If numbers like :36<Z12.E> work, what stops us from having :60[]?
moritz doing it 08:16
GlitchMr :60[] syntax actually would be very simple
moritz (the notable difference is that :36<...> accepts strings, and :60[] would accepts ints)
TimToady___ and ($x % 86400).base(60).join(':') :D 08:17
well, need to sneak %02d in there somehow :) 08:18
nr: (1,2,3).fmt('%02d',':').say 08:21
p6eval rakudo 7d227d, niecza v22-6-g9e5350d: OUTPUT«01:02:03␤»
GlitchMr gist.github.com/3803486 08:22
This is my lamest implementation of that
Hmmm... it could use [+] 08:23
moritz nr: gist.github.com/3803486 08:24
p6eval niecza v22-6-g9e5350d: OUTPUT«Potential difficulties:␤ &from-base is declared but not used at /tmp/KO2HlpQNr8 line 1:␤------> sub from-base⏏($base, *@arrayish) {␤␤»
..rakudo 7d227d: ( no output )
GlitchMr I will put some examples into Gist, ok?
moritz you can even do without ** 08:24
GlitchMr nr: gist.github.com/3803486 08:25
moritz by using the Horner schema of polynome evaluation
p6eval rakudo 7d227d, niecza v22-6-g9e5350d: OUTPUT«15299␤42314087␤»
GlitchMr ok... that code looks bad
I mean... $base ** * * *
Too many stars!
Why is it even a star and not something like $? 08:26
$base ** $ * $
ok... $ is ugly too
Or... 08:27
$base ** ? * ?
? is used in languages like SQL 08:29
moritz use { $base ** $^a * $^b } if you think the * is ugly 08:35
masak good morning, #perl6 08:38
GlitchMr: if you write code and then complain that it's bad because it's unmaintainable, there's always a way to re-write it to be less unmaintainable. you just have to find it. 08:39
GlitchMr: the point of power features and sugary syntax is not to use all of it all the time. it's to make programs more pleasurable to read.
sorear o/ masak 08:40
masak sorear: \o
GlitchMr: if your use of the feature or sugar fails that test, the fault doesn't necessarily sit with the feature or syntax as such. 08:41
huf also, if a thing cant be misused, it cant be too useful :)
masak right. "enough rope". 08:42
TimToady___ p6 has now come within 50 entries of p5 on RC :D 08:51
460 vs 509 08:52
GlitchMr :-)
Perl 6 is future.
TimToady___ we just need to implement 'use v5' and we can catch up... 08:53
GlitchMr I'm not sure, but when Perl 5 will be fully implemented in Perl 6, Perl 5 would be past.
GlitchMr But that also would depend on performance. Perl 6 would have to be faster. 08:54
But, well... Perl 6 is already fast enough.
Perl 5 is really slow with lots of modules loaded 08:55
sorear loading more modules doesn't make perl 5 slower 08:57
GlitchMr oh, right
It's just init time
and memory usage
For example, (made in Catalyst) DuckDuckGo's Community Platform uses 250MB of memory and makes responses in 0.02s. 08:58
It's rather huge.
I meant, 110MB of memory 08:59
Except, I have feeling that is has memory leak somewhere because every time I press F5 memory usage increases by 100KB. 09:00
TimToady___ rosettacode.org/wiki/Time_a_function#Perl_6 09:21
masak TimToady++ 09:27
diakopter TimToady___: a'howdy 09:44
moritz DBD::Pg's $sth.execute segfaults here :( 10:15
gist.github.com/3803633 # backtrace 10:16
segfault in __strlen_sse2 10:17
masak so, taking the length of something that doesn't exist?
maybe a premature free somewhere or something. 10:21
TimToady___ dinner &
GlitchMr Just wondering, does Perl 6 have something like www.php.net/manual/en/function.array-chunk.php 10:42
In PHP, array_chunk(array(1, 2, 3, 4, 5), 2) gives array(array(1, 2), array(3, 4), array(5))
masak doing 'for @array -> $x, $y?' gives you something a little like that. 10:46
tadzik r: my @a = 1, 2, 3, 4, 5; @a.map( -> $x, $y? { [$x, $y] }).perl.say 10:47
p6eval rakudo 7d227d: OUTPUT«([1, 2], [3, 4], [5, Mu]).list␤»
tadzik bah, almost
masak rn: my @a1 = 1..5; my @a2 = @a1.map -> $x, $y? { [$x, ($y if defined $y)] }; say @a2.perl 10:48
p6eval niecza v22-6-g9e5350d: OUTPUT«===SORRY!===␤␤Unexpected block in infix position (method call needs colon or parens to take arguments) at /tmp/3YsfinStpW line 1:␤------> my @a1 = 1..5; my @a2 = @a1.map ⏏-> $x, $y? { [$x, ($y if defined $y)] };␤␤Parse f…
..rakudo 7d227d: OUTPUT«===SORRY!===␤Confused␤at /tmp/TA7f17FlCD:1␤»
masak rn: my @a1 = 1..5; my @a2 = @a1.map: -> $x, $y? { [$x, ($y if defined $y)] }; say @a2.perl
p6eval niecza v22-6-g9e5350d: OUTPUT«[[1, 2], [3, 4], [5]].list␤»
..rakudo 7d227d: OUTPUT«Array.new([1, 2], [3, 4], [5])␤»
masak \o/
of course, this could all be generalized and put into a builtin. but I don't know how big the need for one is. 10:49
GlitchMr It's one of nicer PHP functions. It could be used for stuff like github.com/duckduckgo/zeroclickinf...nverter.pm
Where %timezones table was generated using script.
masak I doubt it'll end up in core. 10:50
GlitchMr :-(
masak maybe it could be put in List::Utils.
tadzik well, is-prime is core, so why no array_chunks 10:51
masak I'd rather see us getting good S09 support. 10:52
maybe something like array_chunks would fall out of how we fill shaped arrays.
GlitchMr Perhaps .shape?
masak right. 10:53
the problem with array_chunks (besides the quite horrible name) is probably that it isn't thinking big enough :)
GlitchMr In certain cases PHP functions are worse 10:54
www.php.net/manual/en/function.arra...y-case.php
Lowercases/uppercases every hash key?
what?
masak ok, so maybe array_chunks isn't horrible by PHP standards. that wasn't my point, though. 10:55
PHP is perhaps *the* deterrent example of failing to generalize useful features into a coherent language API. 10:56
GlitchMr Also, it's array_chunk, not array_chunks because somebody fails at naming
Actually, 99% of PHP functions have very specific usage case. 10:57
I find it interesting that I find array_chunk in that 1%
PHP has only 4962 functions. 11:00
According to www.php.net/quickref.php
ok... 4961 functions... delete() isn't actually function
Why they call it quickref when it's worse than doc.perl6.org? I've no idea. 11:01
(my PHP 5.4 has only 1350 functions from that list, but it's lots of functions) 11:03
masak GlitchMr: www.tnx.nl/php.html 11:04
GlitchMr 3079 functions? 11:05
Why they are still adding functions
Note that Perl has short syntax equivalents for some functions: 11:06
readpipe('ls -l') ==> `ls -l`
Actually, PHP also has backticks. Not that anybody uses them.
Why Perl has backticks anyways? 11:07
masak I believe it's a borrowing from shell. 11:08
GlitchMr Also "Walking a list": 10 functions 11:09
It's worse today
Also... preg_grep()? What?
Let me guess, it's attempt at copying grep /regexp/, @array; syntax from Perl?
This is crazy 11:10
masak stops looking at that page because it makes him too sad
GlitchMr This... is crazy 11:11
www.php.net/manual/en/function.gzgetss.php
gzgetss — Get line from gz-file pointer and strip HTML tags
Yeah...
BinGOs An infinity number of monkeys does not a works of Shakespear always make.
GlitchMr It does PHP? 11:12
BinGOs it seems so.
Synergy failure.
masak well.
GlitchMr Why I would want to get line from GZIP file and strip HTML tags O_o?
masak the thing I find interesting is how such language design sloppiness then reflects on the entire community, its people, and its code. 11:13
GlitchMr That's... really specific usage case
I wonder if anybody actually needed to do it
Could it be worse... 11:14
Well... I guess it could 11:15
www.php.net/manual/en/function.array-map.php
www.php.net/manual/en/function.array-filter.php'
Look at arguments order
I wonder how they have managed to screw arguments order of similar functions so much
dalek p: a4febda | jonathan++ | src/QRegex/P5Regex/Actions.nqp:
Try to get quantified captures righter.
13:51
p: ea7a053 | jonathan++ | t/p5regex/rx_captures:
A few more capture tests.
p: 9a42dc5 | jonathan++ | src/QRegex/P5Regex/ (2 files):
Various bits of alignment with STD_P5.

This also allows the empty alternation branch.
p: 5c4d6b2 | jonathan++ | / (3 files):
Implement backreferences.
jnthn evenin' 13:52
dalek kudo/nom: d14be4f | jonathan++ | src/Perl6/Actions.pm:
Use the P5Regex qbuildsub when needed.
13:54
masak jnthn! \o/ 13:59
jnthn masak! \o. 14:00
*/
dalek rlito: 2144d48 | (Flavio S. Glock)++ | / (4 files):
Perlito5 - js3 - die() shows stack trace
14:01
nyuszika7h I guess dalek is a bot? 14:03
moritz does anybody know what became of mst's plans to do remote code execution with rakudo? 14:04
nyuszika7h: you guess correctly
jnthn o/ moritz
moritz jnthn o/ 14:05
curious: my segfaulting DBIish example "works" under valgrind 14:06
jnthn Hm
moritz and inserts an empty string instead of the proper one in the last column
jnthn moritz: Sounds...fun
masak moritz: I think he's still working on it, albeit slowly. 14:07
[Coke] sounds like an off by one error, moritz 14:08
or is it /just/ the last one?
actually, even then, sounds like an off by one.
moritz [Coke]: it does. But the insert before it, which goes through the same code path, works fine 14:09
so it's not something trivial
[Coke] O_o 14:11
moritz oh, and valgrind shows a write error roughly at the same spot where the segfault would otherwise be
colomon sounds promising. 14:12
moritz gist.github.com/3803633#file_valgrind.txt 14:13
dalek rlito: c0ab727 | (Flavio S. Glock)++ | / (3 files):
Perlito5 - js3 - "use", eval-string work
14:14
[Coke] AHA! progress on the partcl-nqp thing.
needed to walk away from it for a bit, apparently, as this seems like an obvious issue I should have noticed. 14:15
jnthn yay :) 14:16
jnthn r: say 'abcde' ~~ /$<x>=[c]de/ 14:17
p6eval rakudo d14be4: OUTPUT«「cde」␤ x => 「c」␤␤»
jnthn hm. 14:18
jnthn moritz: Could it be that strings get freed right after a call? 14:21
moritz jnthn: I have no idea. Could be, probably. 14:24
execute uses explicitly managed strings 14:27
maybe prepare needs that too
doesn't seem to help :( 14:28
isBEKaml OHHAI, #perl6! 14:30
masak isBEKaml! \o/ 14:30
TimToady ohaiō 14:31
isBEKaml hello, masak and TimToady! How's things?
TimToady winding down from YAPC::Asia here 14:32
isBEKaml Oh, YAPCs - great. :) 14:33
TimToady looks like we get a typhoon tomorrow evening, though probably only a tropical storm by then 14:34
masak .oO( this conference literally blew me away ) 14:35
isBEKaml rn: (1,2,8,9).pick(2).say 14:47
p6eval rakudo d14be4: OUTPUT«8 2␤»
..niecza v22-6-g9e5350d: OUTPUT«1 9␤»
grondilu Hello 15:05
say I want to use a function in openssl using NativeCall. Here's my attempt with sha-1: paste.siduction.org/20120929150447 15:06
grondilu this gives me "Malformed UTF-8 String": paste.siduction.org/20120929150746 15:08
Was I too naïve in thinking it would be easy?
[Coke] r: my %h = 1=>2; for keys %h -> $key { say($key) } 15:12
p6eval rakudo d14be4: OUTPUT«1␤»
moritz grondilu: what does the function return, exactly?
[Coke] nqp: my %h = 1=>2; for keys %h -> $key { say($key) }
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near " 1=>2; for"␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
[Coke] nqp: my %h := 1=>2; for keys %h -> $key { say($key) }
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near ">2; for ke"␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
[Coke] nqp: my %h := 1,2; for keys %h -> $key { say($key) }
p6eval nqp: OUTPUT«get_iter() not implemented in class 'Float'␤current instr.: '' pc 162 ((file unknown):80) (/tmp/Wrg16hw2b9:1)␤»
moritz nqp: my %h := (1 => 2); for %h -> $x { say($x) } 15:13
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near "> 2); for "␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
[Coke] nqp: my %h; %h{1}=2; for keys %h -> $key { say($key) }
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near "2; for key"␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
moritz nqp: my %h :=hash('a', 1) for %h -> $x { say($x) }
p6eval nqp: OUTPUT«Confused at line 2, near "my %h :=ha"␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
moritz nqp: my %h :=hash('a', 1); for %h -> $x { say($x) }
p6eval nqp: OUTPUT«too many positional arguments: 2 passed, 0 expected␤current instr.: 'hash' pc 1327 (src/stage2/gen/NQPCORE.setting.pir:593) (src/stage2/NQPCORE.setting:379)␤»
moritz nqp: my %h :=hash('a', 1); for %h { say($_) }
p6eval nqp: OUTPUT«too many positional arguments: 2 passed, 0 expected␤current instr.: 'hash' pc 1327 (src/stage2/gen/NQPCORE.setting.pir:593) (src/stage2/NQPCORE.setting:379)␤»
moritz nqp: my %h :=hash( a => 1); for %h { say($_) }
p6eval nqp: OUTPUT«a␤»
[Coke] danke. 15:14
moritz [Coke]: nqp only parses => inside an argument list, it seems
and otherwise complains about it being assignment
[Coke] oooh. I just made partcl-nqp segfault. 15:16
... it's all nqp (and pir) at this point. 15:17
grondilu moritz: Not sure. The expected digest, I guess. .
www.openssl.org/docs/crypto/sha.html 15:18
pmichaud good morning, #perl6
moritz unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md); 15:19
dalek ar: 82e4f16 | pmichaud++ | tools/star/Makefile:
Update Makefile for revised nqp/star/parrot release.
15:20
moritz zavolaj expects a zero-terminated UTF-8 string, if nothing else is specified
jnthn grondilu: You can configure the encoding that comes back, iirc 15:21
moritz if that returns byte string of fixed length, you cannot use Str as return value
*returns a byte string
you can use an CArray[Int], and do some post-processing 15:22
jnthn moritz: by default, but there's an "is encoding" trait
moritz jnthn: but that doesn't help much for a fixed-width byte string, does it? 15:22
jnthn moritz: Probably not, no 15:23
grondilu wouldn't it be simpler if I could specify Buf instead of Str? 15:25
jnthn Yes 15:26
But afaik that's not implemented yet 15:27
And Buf would want to know the length too
moritz it dosn't help much with the size problem either
grondilu It doesn't ask a length with Str, so I don't see any size problem.
moritz what "it" are you talking about? 15:28
jnthn grondilu: Only because it assumes zero terminated and gets the length from that.
grondilu Oh, ok.
dalek ar: fce2bfa | pmichaud++ | docs/announce/2012.09:
Update release announcement with 2012.09.1 compiler release information.
15:29
moritz oh, and the SHA1 function does what th know the length (in bytes, I guess) 15:30
jnthn sleep time o/ 15:31
dalek ar: 8c409fd | pmichaud++ | modules/ (3 files):
Update modules to current head settings.
15:33
moritz grondilu: though if you want to get the SHA1, you can use nqp::sha1 in rakudo 15:34
grondilu I don't really want sha1, I want to learn how to use NativeCall. 15:35
moritz ok
masak #perl6: I'm going on a two-week vacation without much hope of a solid Internet connection. my participation in stuff is likely to be very spotty. take care. 15:37
moritz masak: good luck, and good travel
masak thank you.
isBEKaml masak: have a good vacation.
moritz masak: and have an inappropriate amount of fun :-)
masak :P
pmichaud masak: bon voyage
isBEKaml .u 263A 15:41
phenny U+263A WHITE SMILING FACE (☺)
moritz star: use NativeCall; sub SHA1(Str, Int, OpaquePointer) returns CArray[int] is native('libssl.so') { ... }; my @a := SHA1("foo\n", 4, Any); say @a[0] 15:42
p6eval star 2012.07: OUTPUT«-103623951␤»
moritz that's the first 4 bytes of the SHA1 as a signed integer 15:43
star: use NativeCall; sub SHA1(Str, Int, OpaquePointer) returns CArray[int] is native('libssl.so') { ... }; my @a := SHA1("foo\n", 4, Any); say @a[^4]
p6eval star 2012.07: OUTPUT«-103623951 -1400444636 -1275593338 -541289364␤»
moritz now you "just" have to do the right bitshift and extraction operations to get the bytes 15:44
grondilu moritz: impressive. Thanks. 15:47
moritz grondilu: you're welcome
dalek rlito: 634599e | (Flavio S. Glock)++ | / (4 files):
Perlito5 - parser - test end of term
15:50
[Coke] is there a way to write this in nqp: 15:59
Q:PIR { $P1 = getinterp %r = $P1['sub'; 1] }
[Coke] pir::getinterp__P ... but then how to do the 2 part key index? 16:00
supernovus A quick question, is it possible to export constants from a module?
moritz supernovus: yes, since quite recently 16:01
[Coke]: I know that key indexes weren't supported in NQP for a long time; not sure if they are now
[Coke] barring that, is there a way to do a multiline Q::Pir in evalbot? 16:02
moritz [Coke]: in fact rakudo has Q:PIR block for exactly that reason
[Coke] r; say "something so I can get a newline"
moritz r: say 'something'
p6eval rakudo d14be4: OUTPUT«something␤»
moritz ␤ is translated to newline in input too
supernovus moritz: thanks, I think the rakudo on my netbook is too old, as it seemed to work from my workstation yesterday but it has a brand new build on it. 16:03
moritz r: Q:PIR {␤say 'foo'; %r = 12␤ }
p6eval rakudo d14be4: OUTPUT«use of uninitialized value of type Mu in string context␤use of uninitialized value of type Mu in string context␤===SORRY!===␤error:imcc:syntax error, unexpected ';', expecting '\n' (';')␤ in file '(file unknown)' line 65␤␤»
moritz r: Q:PIR {␤say 'foo' %r = 12␤ } 16:04
p6eval rakudo d14be4: OUTPUT«use of uninitialized value of type Mu in string context␤use of uninitialized value of type Mu in string context␤===SORRY!===␤error:imcc:syntax error, unexpected PREG, expecting '\n' ('$P5005')␤ in file '(file unknown)' line 65␤␤»
moritz r: Q:PIR {␤say 'foo'␤ %r = 12␤ }
p6eval rakudo d14be4: OUTPUT«foo␤Null PMC access in set_integer_native()␤ in block at /tmp/3q24gP4sS7:1␤␤»
moritz r: my int $i = Q:PIR {␤say 'foo'␤ %r = 12␤ }
p6eval rakudo d14be4: OUTPUT«foo␤Null PMC access in set_integer_native()␤ in block at /tmp/RKBgqwqWdR:1␤␤»
moritz oh, %r is a PMC
r: Q:PIR {␤say 'foo'␤ %r = getinterp } 16:05
p6eval rakudo d14be4: OUTPUT«foo␤»
pmichaud Q:PIR only knows how to return PMCs
moritz is glad he nearly never has to touch PIR anymore 16:06
[Coke] is trying to figure out how to iterate over a parrot namespace object from nqp. 16:07
moritz NQP solves this problem by not using parrot namespaces 16:08
pmichaud for $namespace { say($_.key); say($_.value); }
moritz or at least rakudo does
I#d expect namespace to inherit from Hash; then that'll work
pmichaud should work, if "iter $namespace" works.
iirc, namespace doesn't inherit from Hash 16:09
oh, it does
so yes, it should be same as iterating a hash
dalek rlito: a23a8c9 | (Flavio S. Glock)++ | src5/lib/Perlito5/Javascript3/CORE.pm:
Perlito5 - js3 - fix rindex()
16:13
rlito: f00c69a | (Flavio S. Glock)++ | / (2 files):
Perlito5 - js3 - numify before math functions
[Coke] I need to look something up in the caller's namespace.
is that possible with straight NQP? 16:14
pmichaud using pir:: it's possible
[Coke] (i was getting the parrot interp, and trying to look things up in it, but if nqp isn't putting things in parrot namespaces... 16:14
pmichaud oh, yeah 16:15
moritz [Coke]: you can go through the backtrace, which has the subroutine object
pmichaud I don't know if we really have the concept of subs-belonging-to-namespaces 16:16
[Coke] ... urk 16:23
pmichaud I mean, clearly a (package) namespace can contain subs... but the sub doesn't necessarily know what namespace it is in 16:25
I'm afk... bbbl 16:28
supernovus There, SCGI v2.0 is released. It requires a Perl 6 implementation capable of exporting constants. Next up FastCGI v1.0 which will have an identical class layout and compatible API (and thus will be compatible with WWW::App out of the box.) 16:33
dalek rlito: 604d457 | (Flavio S. Glock)++ | / (2 files):
Perlito5 - js3 - dereference lvalues inside core functions ("js3" bootstraps now)
16:36
[Coke] nqp question: if I define a sub in a .pm, use that .pm, should I be able to call that sub from anywhere after the use? 17:00
does there need to be an export in there somewhere?
[Coke] (er, no, you cannot invoke it.) 17:04
... and yes, "is export" exposes it. whee.
[Coke] ... but only in my simple program, still not found in partcl. argh. 17:08
[Coke] here's a summary of my current nqp blocker: gist.github.com/3804636 17:20
moritz [Coke]: I guess b.nqp needs "use a;" 17:21
[Coke] if I dont' use the class, it works. if I use the class, but make it inline, it works. with this, the class is found, the method is found, but then the method can't find the sub.
moritz nqp doesn't complain at compile time about unknown subroutines
which is why you only notice it at runtime
[Coke] arglebargle. 17:22
this means I have to "use" every single partcl command in the dispatcher.
moritz++ # that did it.
moritz if you put them all in separate files, yes 17:23
dalek rlito: 85c7700 | (Flavio S. Glock)++ | / (2 files):
Perlito5 - js3 - use fetch() consistently
flussence python 3.3 release notes: "we had two different unicode string types until now!" - eww. 17:25
moritz I just skimmed the excerpt of that on slashdot, and it sounded like it contained backwards incompatible changes 17:26
is that usual for minor releases in python?
[Coke] moritz: well, the commands are current 3K lines of nqp, and getting longer. 17:27
but I can concat them all into a single file, I suppose. 17:28
moritz that's what rakudo does for the setting
[Coke] (as part of the build)
moritz or you could take a middle ground, and group related built-ins
and compile them separately, and then use each
I hate it that I have to recompile the whole setting in rakudo each time I touch a single built-in 17:29
[Coke] the number of incompatible changes between nqps is pretty daunting.
[Coke] moritz: doing all the deps right between builtins will also be a pain, at least for partcl 17:37
what scoping does "our" use in nqp? 18:01
diakopter it's changed 18:02
recently jnthn fixed it
[Coke] er, s/use/provide/ - in parrot-nqp it was apparently more global.
diakopter it used to simulate export
now it doesn't
[Coke] I want to create a variable that I can reference everywhere; 18:03
diakopter I *think* you'll have to use a lexical and then an exported sub to access it 18:04
but I could be way wrong
maybe variables can be exported too. 18:05
nqp: our $a is export;
p6eval nqp: OUTPUT«Method 'name' not found for invocant of class 'NQPMu'␤current instr.: '' pc 147201 (src/stage2/gen/NQP.pir:51645) (src/stage2/gen/NQP.pm:2603)␤»
diakopter o.O 18:06
NOT QUITE
[Coke] if I have an exported sub that returns the variable (a hash), will I be able to modify it?
diakopter assign to the variable or assign to keys in the hash 18:07
[Coke] keys in hash
diakopter I don't see why not
hm. Dr. Stroustrup isn't replying immediately to my email. He must be busy. ;) 18:10
dalek rlito: 6f9e32c | (Flavio S. Glock)++ | / (2 files):
Perlito5 - js3 - extract proxy classes from Scalar
18:17
supernovus SCGI was an easy protocol to implement. FastCGI on the other hand... ugh. 18:18
[Coke] argh. so, what is the advantage of locking down scopes in the new nqp? 18:27
moritz mostly that bootstrapping is saner 18:29
if you compile NQP with NQP, then both the compiler and the compiled program will have classes of the same name
and you don't want them to collide
[Coke] It's a mazy of twisty dependencies. 18:30
*maze
doy bootstrapping typically is
(:
[Coke] doy: Yes, but I am not bootstrapping.
I'm just trying to use the already built NQP. 18:31
GlitchMr Python 3.3.0: can I get sane explanation of 'yield from' syntax? 18:33
[Coke] are INIT {} blocks guaranteed to run only once now matter how many times you use the files they are in? (nqp)
GlitchMr Also, www.python.org/dev/peps/pep-0414/ - I wonder why it wasn't supported since beginning 18:36
[Coke] ah, generating invalid PIR: gist.github.com/3804636
moritz nqp: INIT { say("nice, IN'IT?") } 18:37
p6eval nqp: OUTPUT«nice, IN'IT?␤»
moritz so, not that simple
[Coke] you need to compile to PIR and have it included twice. 18:39
er, not twice, necessarily: c's "use b" and b's "use a" is enough to trigger it. 18:40
(even if c doesn't explicitly use a) 18:41
moritz does it go away if c has 'use a;' before 'use b;'? 18:54
[Coke] no, that's the initial config which also errored. 18:58
ARG. so I have to initialize this lexical in an INIT block. but for the exported sub to see it, it has to be in teh same file. so I have to use this file wherever I use the imported sub. which means I'm double-use'ing the "INIT" block, which boom. 19:00
Any suggestions? 19:01
japhb TimToady, re: irclog.perlgeek.de/perl6/2012-09-29#i_6026394 : 19:02
r: my ($h, $m, $s) = 20, 52, 4; say +":60[$h,$m,$s]";
p6eval rakudo d14be4: OUTPUT«75124␤»
japhb We do have base 60 ... in Str.Numeric. ;-)
moritz std: say :60[1, 2, 3] 19:03
p6eval std 77327a4: OUTPUT«ok 00:00 44m␤»
japhb Did jnthn++ post his talk(s) yet? 19:08
mathw o/ 19:14
moritz if it's not at the usual place, probably not
\o mathw
mathw hi moritz 19:16
sorear good * #perl6 19:18
mathw good @times-of-day.pick 19:19
i must admit to not being entirely sure what time of day it actually is. I don't believe the clock.
naps == bad 19:22
[Coke] phenny, tell jnthn I'm currently stuck on github.com/perl6/nqp/issues/56 19:34
phenny [Coke]: I'll pass that on when jnthn is around.
[Coke] I pushed the latest WIP to partcl-nqp/nqp2 19:45
sorear cute bug 19:46
moritz fwiw I've implemented :60[1, 2] locally
waiting for the spectests to finish
[Coke] the dispatcher is now smart enough to find one of the builtin commands, just dying on [puts] because my information about channels was stored in an our variable. 19:47
sorear: my bug is cute? 19:48
sorear yes 19:49
dalek kudo/nom: 8365f1b | moritz++ | src/ (3 files):
implement integer case of :60[...]
19:51
ast: d1e3c67 | moritz++ | S02-literals/radix.t:
unfudge two tests for rakudo
19:52
[Coke] heh. now that it's reported, sure. :) 19:53
I did get further today than I have in weeks, though, so that's nice.
moritz LHF: write a sub unbase_brackets that can deal with a dot 19:55
eg :60[1, '.', 1, 1]
supernovus Another quick question. Is there a way to specify a binary value directly? For instance this no longer works in a world with Buf: $buf ~= "\x00" x 2 20:12
nm, I found a usable solution: $buf ~= ("\x00" x 2).encode 20:14
supernovus And my FastCGI library is now dead in the water. I may finish the Protocol class, but it's no use going any further. 20:22
sorear supernovus: um, you realize that rakudo's socket bugs will be fixed eventually? 20:23
IO::Socket::INET won't be useless forever
supernovus sorear: I didn't realize it was useless now? 20:24
sorear oh, I thought you were quitting FastCGI because of socket issues
supernovus No, FastCGI is going on hold due to pack() not being fully implemented yet. It seems Str.unpack is more complete than pack()... 20:25
I will write the library as if pack/unpack were fully functional, that way once they are, the library will be ready to go :-) 20:26
flussence I've been putting off a website because I couldn't decide which perl to use... looks like I can start now :< 20:35
mathw I wrote a site in Perl recently 20:39
it was nice, although I was wishing for Perl 6 from time to time
TimToady INIT should run only once regardless of how many times its surrounding context is exectuted 22:17
it's just supposed to be a BEGIN analog at run time 22:24
TimToady [Coke]: and presumably nqp should work the same as p6 in that regard 22:25
raiph TimToady: Am I right in saying there's a version of STD, or more specifically STD_P5, that's a compiler, not just a parser? 22:33
jnthn [Coke]: NQP kinda cheats on INIT, so it probably does the Wrong Thing... 22:34
phenny jnthn: 19:34Z <[Coke]> tell jnthn I'm currently stuck on github.com/perl6/nqp/issues/56
japhb jnthn, are there slides from your talk(s)? 22:35
jnthn [Coke]: Will look into it 22:36
japhb: Thanks for the reminder...will get them up, probably this evening.
japhb jnthn, ah cool, thank you 22:37
jnthn japhb: Though tbh it's mostly annotated code snippets from modules 22:39
japhb annotations++ # Besides, given how long until video comes out ... 22:40
jnthn [Coke]: OK, the cheating is not the cause of the bug I guess 22:41
Hm
[Coke]: Uh, oh...
When you use a module, its body is run and thus its INITs to at the moment
[Coke]: Instead of 22:42
TimToady raiph: nope
jnthn nqp --target=pir b.nqp > b.pir
try
nqp --target=pir --output=b.pir b.nqp
raiph TimToady: thanks
TimToady raiph: you're probably thinking of the fact that STD compiles p6 down to p5
and you can probably get it to emit p5 from the p5, but that would just be compiling p5 to p5 :) 22:43
jnthn & 22:48
TimToady too
raiph TimToady: I'm curious about Perl 6 efforts toward A) optimization, B) parallel execution, and C) P5 integration, one day being relevant to attempts to speed up Perl 5 22:50
raiph TimToady: heh. later. 22:50
japhb raiph, Note that speeding up pure Perl 5 is not the same as speeding up XS-compatible perl5. I think only pure Perl 5 is currently being attempted; the best way to get true XS compatibility is likely just to embed perl5, and then you're not speeding anything up. 22:55
pmichaud pmichaud.com/sandbox/rakudo-star-20...rc2.tar.gz # release candidate 2 for rakudo star 2012.09 -- testing welcomed 23:11
I get failures with panda, though.
gist.github.com/3805399 # failed tests for panda in star 2012.09 23:12
if anyone can help out with fixing panda, that'd be... helpful. :-) 23:13
I'm afk again for a bit
japhb pmichaud, perl6 not found?
That seems ... odd
[Coke] jnthn++
japhb Not in PATH?
raiph japhb: Thanks. 23:14
japhb raiph, np 23:15
[Coke] jnthn: of course, I was already building partcl that way (just not my examples). now to find out what I misgolfed. :)
flussence r: say $?ENC; $?ENC = 'ascii'; say '€'.encode.perl; 23:36
p6eval rakudo 8365f1: OUTPUT«===SORRY!===␤Variable $?ENC is not declared␤at /tmp/TTSRdO4ej0:1␤»
flussence well that shoots down the awful idea I was thinking about :)
flussence (implicit lazy Buf<->Str conversions, which would probably be better done as-needed using 'handles *') 23:44
[Coke] yay! it all builds, all the weird errors are gone... and now it segfaults regularly. ;) 23:51