»ö« 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.
TimToady otoh, saying .comb(10) is really just .comb( / . ** 10 / ) has something to be said, teachingwise 00:00
or . ** 1..10 00:01
m: say ("x" x 15).comb(10)
camelia rakudo-moar e5d7a1: OUTPUT«(xxxxxxxxxx xxxxx)␤»
TimToady m: say ("x" x 10).comb(10) 00:02
camelia rakudo-moar e5d7a1: OUTPUT«(xxxxxxxxxx)␤»
BenGoldberg m: while( $*IN.read(16) ) -> $blob { dd $blob }
camelia rakudo-moar e5d7a1: OUTPUT«5===SORRY!5===␤Word 'while' interpreted as 'while()' function call; please use whitespace instead of parens␤at <tmp>:1␤------> 3while7⏏5( $*IN.read(16) ) -> $blob { dd $blob }␤Unexpected block in infix position (two terms in a row)␤at <…»
BenGoldberg m: while ( $*IN.read(16) ) -> $blob { dd $blob }
camelia rakudo-moar e5d7a1: OUTPUT«Buf[uint8] $blob = Buf[uint8].new(67,195,169,97,100,32,115,108,195,161,110,32,97,103,32,115)␤Buf[uint8] $blob = Buf[uint8].new(108,195,169,105,98,104,116,101,32,109,97,111,114,103,97,32)␤Buf[uint8] $blob = Buf[uint8].new(67,104,111,110,116,97,101,32,68…»
TimToady well, that's okay if you want to read 16 bytes, but the convo was about "characters", so I assumed they didn't mean bytes :) 00:04
but reading N characters from a file actually requires reading past the last character to make sure you have all the combiners, so if you're depending on the file pos to be right after the char, it might not be 00:05
BenGoldberg m: say so "" 00:08
camelia rakudo-moar e5d7a1: OUTPUT«False␤»
BenGoldberg m: while ( $*IN.read(16) ) -> $blob { say $blob.decode("utf8") } 00:10
camelia rakudo-moar e5d7a1: OUTPUT«Céad slán ag s␤léibhte maorga ␤Chontae Dhún na␤ nGall␤Agus dhá␤ chéad slán ag␤ an Eireagal ard␤ ina stua os cio␤nn caor is coll;␤␤Nuair a ghluais␤ mise thart le L␤och Dhún Lúich␤’ go ciúin sa␤Malformed termination of…»
BenGoldberg m: my $all = ""; while ( $*IN.read(16) ) -> $blob { $all ~= $blob.decode("utf8") } 00:11
camelia rakudo-moar e5d7a1: OUTPUT«Malformed termination of UTF-8 string␤ in block <unit> at <tmp> line 1␤␤»
TimToady you split a character 00:12
BenGoldberg I realize that ;)
I think that .decode should take an optional argument, :trailing-garbage, which causes it to return a two-element list, a Str and a Blob, where the Blob is everything from the first bad byte onwards. 00:13
Or something like that. 00:14
dalek osystem: 4671360 | ugexe++ | META.list:
Add distribution with same name, different auth

For Perl6 tool chain testing purposes
01:15
osdfuhsui How would I print numbers like this 00001, 00002, ..., 00125, 00126, etc. 01:47
osdfuhsui in a short way 01:51
osdfuhsui nevermind I've figured it out 01:56
by using .fmt
BenGoldberg m: printf '%05d', $_ for 1..5; 01:58
camelia rakudo-moar e5d7a1: OUTPUT«0000100002000030000400005»
BenGoldberg m: printf "%05d\n", $_ for 1..5;
camelia rakudo-moar e5d7a1: OUTPUT«00001␤00002␤00003␤00004␤00005␤»
BenGoldberg osdfuhsui, ^
osdfuhsui How would I go about reading from a file that isn't utf-8 02:04
like a binary file
osdfuhsui I see you can use :bin 02:07
I don't understand how though
After I open the binary file with the :bin option, how would I read 16 bytes at a time 02:10
MasterDuke you might be able to use unpack docs.perl6.org/type/Buf#(Blob)_method_unpack 02:11
or 'my $b = slurp "file", :bin; my @bytes = $b[0..3]' 02:14
TimToady you can read a binary file with .read(16)
it'll return a 16-byte buf
osdfuhsui thank both of you 02:17
How would I see how many bytes there is before doing that masterduke? 02:18
osdfuhsui or would I just use .elems 02:19
okay I've got it, thanks 02:20
AlexDaniel m: my $foo = ‘hell’; say ‘hello world’ ~~ / {$foo ~ ‘o’} ‘ world’ / 02:44
camelia rakudo-moar e5d7a1: OUTPUT«「 world」␤»
AlexDaniel m: my $foo = ‘hell’; say ‘hello world’ ~~ /^ {$foo ~ ‘o’} ‘ world’ / 02:45
camelia rakudo-moar e5d7a1: OUTPUT«Nil␤»
AlexDaniel what was the right way to do it?
TimToady add <>
AlexDaniel m: my $foo = ‘hell’; say ‘hello world’ ~~ /^ <{$foo ~ ‘o’}> ‘ world’ /
camelia rakudo-moar e5d7a1: OUTPUT«「hello world」␤»
AlexDaniel right
TimToady: thank you 02:46
TimToady actually watching olympics, but have laptop sitting on the TV tray :)
ugexe .tell TheLemonMan the issues you've brought up with zef have been addressed 03:27
yoleaux ugexe: I'll pass your message to TheLemonMan.
vapace p6: say Int.HOW; say Array.HOW; say Hash.HOW; 03:50
camelia rakudo-moar e5d7a1: OUTPUT«Perl6::Metamodel::ClassHOW.new␤Method 'gist' not found for invocant of class 'Perl6::Metamodel::ClassHOW+{<anon>}'␤ in block <unit> at <tmp> line 1␤␤»
nine wonders why App::Ack is most wanted when there's already a perfectly useful one written in Perl 5 08:17
DrForr Because everything's better in perl 6? :) 08:18
timotimo well, perl6 regexes would require either Inline::Perl5/6 work for Ack itself, or a re-implementation 08:19
DrForr m: "foo" ~~ m:p5{[f]} 08:20
camelia rakudo-moar f648d3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Adverb p5 not allowed on m␤at <tmp>:1␤------> 3"foo" ~~ m:p5{[f]}7⏏5<EOL>␤»
DrForr Thought there was a p5 adverb for that. 08:21
timotimo need a capital P
DrForr m: "foo" ~~ m:P5{[f]}
camelia ( no output )
DrForr Oh, you're talking the other direction. Too much blood in my caffeine supply. 08:22
timotimo :) 08:23
DrForr O gawd, I'm now thinking about an App::Ack6 that lets you do something like: ack --Perl6 'has <variable> where * > 0'. 08:36
timotimo how is that supposed to work :) 08:38
DrForr Add an option to load a grammar library for your RE. 08:39
timotimo oh, were you meaning 'has ' and ' where * > 0' to be literals? 08:43
nine Reminds me of semantic patching 08:44
DrForr Yes, literal terms. Though allowances woudl have to be made for the metachar rule in p6. 08:45
timotimo well, regexes are slangable :P 08:46
DrForr I know, I know. Too many ideas, so little time.
DrForr Might at least make people less frightened of p6 regular expressions :) 08:49
(not that I've really seen that in talks; I tread on it lightly though.)
El_Che lo 08:55
regular expressions
DrForr Afternoon... almost. 08:56
El_Che the name is already a lie, so how do you explain it to people in 1 hour? :)
DrForr I usually spring that on people halfway in :) 08:56
El_Che you close the door and windows before
timotimo i thought you have to open windows in order to protect the glass during explosions? 08:57
DrForr timotimo: I just leave the transoms at the top unlocked, that's enough to dissipate the blast. 08:58
zengargoyle \quit 09:00
lizmat clickbaits p6weekly.wordpress.com/2016/09/05/...ao-perl-6/ 09:01
afk&
timotimo "transoms", now there's a word i've learned 09:02
DrForr The little windows over doors, usually in the bathroom for venting.
timotimo mhm 09:03
okay, gotta go afk, else i might end up missing my train
DrForr Wiping down the glass afterwards is a problem thoguh, I usually tip the maids extra.
Ulti m: my $junction = ((set 0,1,2,3) (&) (set 0,1,2)).any; say $junction; say (1 => True) ~~ $junction; say 1 ~~ $junction; 09:06
camelia rakudo-moar f648d3: OUTPUT«any(0 => True, 1 => True, 2 => True)␤True␤Method '0' not found for invocant of class 'Int'␤ in block <unit> at <tmp> line 1␤␤»
Ulti can anyone help me understand the behaviour of the .any on the Set type 09:07
is this just a result of Set being bag like?
timotimo i expect .any to call .list on things
Ulti well that is what .list gives you 09:07
a list of pairs where the values point to boolean 09:08
I find it odd that a set is associative in some deep way in Perl 6
it doesn't work very naturally
if I have a set of Int I expect to get back a list of the Int I put in not Ints mapping to always True Bools
is there some reason for this I'm missing? 09:09
is it specced this way?
I was going to respond to a reddit comment asking about junction intersection and was going to suggest you would use set intersection and then just wrangle to a junction but it turns out thats kind of broken 09:11
[ptc] DrForr: they're also called "louvres", aren't they? "transoms" is new to me... 09:19
DrForr Well, I usually think of louvres as kind of round steam vents, with flappy blinds over them. I think a transom is usually a full-length window across the top of a door that you can crack open if the steam buildup is too much. It could very well just be a British thing. 09:23
(not that I'm British, but I have lived intehir houses :) 09:25
[ptc] could be a British (and derivatives thereof) thing; what you call a transom is definitely what I'd call a louvre :-) 09:28
stmuk I'm British and have never heard of either louvres or transoms 09:32
DrForr Too many ye..months living among denizens of the Isle :)
stmuk some googling suggests there isn't an English word but the closest is fanlight (over a door) 09:33
a louvre is blind like 09:34
DrForr Looks like I was confusing the actual transom with what I've seen above it. Something new every day. 09:37
[ptc] stmuk: hrm, maybe it's a Kiwi thing then... 09:38
stmuk the German definition at en.wikipedia.org/wiki/Transom_(architectural) is amusing 09:41
elohmrow even though it could get me hurt for saying so, i am originally an american, and i know what a louvre is; we have them - Bob Vila told us about them many times ;) 09:51
DrForr o/' Woah-oh let's build a patio / Go call Bob Vila o/' 09:52
arnsholt Only louvre I know is in Paris =p 09:53
And generally capitalized
zengargoyle american louvre is pronounced louver. (at least where i'm from) 09:54
while louvre is the Paris thing. 09:55
which `dict` informs me is a valid spelling.. 09:57
elohmrow I don't know the history, but why is this guy 'resolved': rt.perl.org/Ticket/Display.html?id=127408 please? I guess I can use $myThing.^methods and compare, but it's not a super-helpful error message, and I just got it because of a method signature mismatch on 2016.07.1 10:06
I guess rather than 'CALL_ME', i'd like to see the $real_method_name with sig. maybe this is possible another way
nine elohmrow: what is the $real_method_name in *(42)? 10:07
elohmrow nine: point 10:08
timotimo Ulti: if you're trying to use junctions as sets, you're going to have a bad time. don't do that. they aren't meant to be used as sets. 10:11
elohmrow nine: i think i didn't say what i meant to: i'd like the error to tell me "you tried to call non-existent method '*' with argument '42'." then i at least know where to look 10:12
timotimo damn. i had hoped to mirror the libsdl wiki, but 1) i only got a few pages in every language imaginable, 2) its surge protection triggered and kicked me out 10:13
zengargoyle wonders if any distros (other than Debian) are planning on patching Perl5 to remove '.' from @INC 10:14
nine elohmrow: *(32) or just foo(32) is no method call but looks more like a function call. Anyway to arrive at your desired error message, rakudo would have to guess what you actually meant which it cannot. Think about e.g. $callable(42); It may well be that you forgot to add the CALL-ME method to the supposedly callable object. 10:16
elohmrow: and having made exactly that mistake, I'm actually quite glad that rakudo tells me that it exepcted to find a CALL-ME method, so I could just add it. 10:17
grondilu how do I prevent :$var to be interpreted as a named argument? 10:43
m: my $var = pi; say :$var
camelia rakudo-moar f648d3: OUTPUT«Unexpected named argument 'var' passed␤ in block <unit> at <tmp> line 1␤␤»
ilmari grondilu: what would you like it to be interpreted as?
jnthn Put parens around it
grondilu m: my $var = pi; say (:$var)
camelia rakudo-moar f648d3: OUTPUT«var => 3.14159265358979␤»
grondilu of course
thanks
grondilu I miss P5's dummy + operator, though. 10:46
m: my $var = pi; say +:$var
camelia rakudo-moar f648d3: OUTPUT«Cannot resolve caller Numeric(Pair: ); none of these signatures match:␤ (Mu:U \v: *%_)␤ in block <unit> at <tmp> line 1␤␤»
stmuk www.youtube.com/channel/UCLsVz9vpr...6PmcI4tnqA
grondilu or bash's -- 10:50
grondilu I have a database made of a bunch of YAML files in a directory tree. The whole tree branch is 769Mo. I'd like to put it all in a big Perl6 hash that I could easily load later. Is it reasonable to parse it all, store it in a single hash variable and create a module file like: 'unit module MyData;\nour %hash = $here-I'd-put-the-output-of-.perl' ? 10:56
grondilu tries 10:57
Xliff grondilu, I've done something on a way smaller scale with Color::Names; 11:07
Also did it with an unreleased module for Eve::Online. 11:08
With the latter I discovered it was easier to keep that stuff in an sqlite3 database and use that.
stmuk the youtube autotranslate on liz's P6 module APW talk is amusing 11:09
grondilu Xliff: it's for EVE Online too
Xliff Question for the P6 devs in here: sub EXPORT(+@a) { ... require SomeModule; ... } <- Is that supposed to crash rakaudo at stage parse? 11:09
grondilu: Ooh! What you writing? 11:10
github.com/Xliff/p6-webservice-eveonline
grondilu: ^^
grondilu I'd like to write a webgl interface to look at New Eden.
so I'm parsing cdn1.eveonline.com/data/sde/tranqu...UILITY.zip
I'll do something similar to what I did for a dna visualisation here: grondilu.github.io/dna.html 11:12
Xliff grondilu: YOW!
Xliff Grondilu: If all you are looking for are the x,y,z tuples for the star systems, you could always load that data into mysql and then extract into something sane. 11:15
I update local mysql every time Eve patches.
That reminds me. I haven't played in a while.
...Aaand they've updated the launcher. 11:16
....aaaand CCP flubbed the launcher update. At least here. 11:18
grondilu I don't like SQL. I was hoping I wouldn't have to use it.
grondilu If the database is too big even after restricting to position values, I'll limit the visualisation for a few regions. 11:19
Xliff Yeah. Well, parsing the YAML is a valid strategy then. 11:20
Xliff I did look at Eve's YAML for my project, but couldn't get it to parse using P6 modules as of April. 11:20
grondilu I'm currently parsing with YAMLish. Seems to work fine. 11:21
grondilu here's the code I'm using: paste.debian.net/811318/ 11:23
Xliff Cool. I think I tried YAMLish back then, too.
arnsholt Right. That's the program that generates function defs from header declarations more or less done. Now for the program that extracts stuff from 11:25
... #define directivess
arnsholt Not for NativeCall, sadly, but the knowledge should be transferrable \o/ 11:25
Xliff Eve Launcher finally patched after 16 attempts. 11:26
arnsholt, Are you talking about gptrixie?
grondilu I had to kill the job. It was eating all memory I guess.
so that's definitely not the way to go. I do need a database, I guess. 11:27
timotimo one bottle of beer for whoever builds a slang that gives me a "nsub" keyword that is exactly like "sub" + "is native($lib)" + "{*}" 11:28
moritz take it down, pass it around, ...
timotimo b "is export", please 11:29
"+", not "b".
Xliff timotimo: Ooh! I'd use that slang. 11:30
Of course, the whole Slang mechanism looks overly complex to me.
(not the parsing, but the getting it active)
DrForr Xliff: It's kind of "there" waiting for macro support.
arnsholt Xliff: Using pycparser actually, since I need to generate SmallTalk (yes, really!)
timotimo yes, macros will make that a lot easier 11:31
dalek c: 772b297 | (Tom Browder)++ | doc/Type/Signature.pod6:
Fix typo
Xliff arnsholt++ # For writing the Python I may need but would never do myself
grondilu: I could probably churn out a module with that data if you want. 11:32
arnsholt Xliff: If you ever need to do this kind of thing, pycparser is pretty damn good
arnsholt It doesn't support preprocessor stuff at all, so it only parses preprocessed C which is somewhat limiting, but apart from that, it's awesome 11:33
arnsholt A bit less than a day of work gave me a program that generates some 350 API entry points from OpenSSL directly from the headers 11:34
And that's only the libssl ones. There's another 1150 or something like that in libcrypto
Xliff arnsholt: gptrixie will do that, but there is an inherent limit in the size it will allow. 11:35
timotimo don't forget, everyone, we do have gptrixie that automatically creates a nativecall binding from a c header file 11:35
yeah :)
Xliff For example, I can get it to work with liboggvorbis.
But I don't think it would survive if I threw libssl at it.
Same with libcryto. 11:36
arnsholt Heh 11:37
gptrixie parses GCC's XML output or something like that, no?
Xliff Yeah.
Which, if I remember, has been deprecated for something else.
But that support hasn't come yet. 11:38
arnsholt The neat thing about pycparser is that it's a full C parser library, which is pretty cool
Xliff Finding gccxml was a bit of a chore.
arnsholt I'm tempted to look into porting it to Perl 6, TBH
konobi libressl? 11:43
moritz that's a thing, yes 11:44
konobi i had heard that it had a much constrained api
Xliff arnsholt: Ooooo! That would be niiice! 11:46
If you start that project and want coder flunkies... count me in!
arnsholt konobi: Yeah, I considered it 11:47
But since this is for $work, it was a bit too early-adoptery to go for OpenSSL 11:48
But we have discussed it as an option, actually
Er, too early adopter to go for *Libre*SSL I mean (obviously)
timotimo we can also use pycparser through Inline::Python ;) 11:57
arnsholt For the time being, yeah =) 12:02
timotimo oh the joy of scancodes 12:04
"\" (Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and
POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout.)
"`" (Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE
SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.)
how fun!
arnsholt When you plug in a new keyboard on OS X, it asks you to press the bottom-leftmost non-modifier key, to autodetect what kind of KB it is 12:05
hahainternet the worst are the hybrid layouts
on crap laptops
arnsholt Le sigh. "Nordic" kb layouts can piss right off
Especially since Danish and Norwegian, which both have æ and ø, have deigned to place them on *different* keys 12:06
So you have to keys right next to each other, both of which are labelled æ and ø >_<
arnsholt s/to/two/ 12:06
moritz wtf.
timotimo "" (no name, empty string; This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.)
SDL_SCANCODE_NONUSBACKSLASH
arnsholt moritz: YA RLY!
smls m: class A { has A @.children is default(A.new) } 12:19
camelia rakudo-moar f648d3: OUTPUT«===SORRY!===␤Method 'new' not found for invocant of class 'A'␤»
smls ^^ Is it possible to somehow delay the evaluation of an `is default` value, so that it can be used in a tree-like class like this?
jnthn smls: No 12:21
smls ok
jnthn (And due to the way `is default` works, it's really not easy to make that happen either) 12:22
timotimo shouldn't it work with = instead? 12:28
or is that for "assigning an empty element into the array will give an A.new?
oh, that'll also create an A when A gets created
smls timotimo: the `is default` is what you get when you index a nonexistent element of the array 12:30
not what the array itself is initialized with
timotimo right
smls m: class A {has $.n = 42}; my A:D @a; say @a[1]; say say @a[1].n; 12:33
camelia rakudo-moar f648d3: OUTPUT«(A:D)␤Cannot look up attributes in a type object␤ in block <unit> at <tmp> line 1␤␤»
smls jnthn: Is this also working as expected? ^^ 12:34
jnthn That should probably be disallowed 12:41
timotimo yeah, that's slightly problematic
[Coke] .msg 12:45
yoleaux [Coke]: Sorry, this command is admin-only.
[Coke] .seen supernovus
yoleaux I saw supernovus 22 Apr 2016 23:27Z in #perl6: <supernovus> Well, I'm going to have to run. Have a great day/night everyone. I hope to fix up some of my long neglected libraries at some point when I'm not completely overloaded with work! :-)
Ulti timotimo: the other way around turn a set into a junction in the same way you would do .any on a list 13:33
pierre__ HI 13:46
pierre__ except the conciseness, is there any difference between 13:47
m: sub closure() { my $i = 0; return -> { ++$i } } ; my $a = closure(); say $a(); say $a();
camelia rakudo-moar f648d3: OUTPUT«1␤2␤»
pierre__ and
m: sub closure() { my $i = 0; return sub () { return ++$i } } ; my $a = closure(); say $a(); say $a();
camelia rakudo-moar f648d3: OUTPUT«1␤2␤»
pierre__ i know that with the pointy block notation, i cna't use a return, but as the last element is returned by default, i do not see any difference 13:48
masak pierre__: only that with `sub`, you should use `return`, and with blocks, you should use (unimplemented) `leave` (which is also implicit)
pierre__: that is the difference. `return` binds to innermost enclosing *sub*, not block
pierre__ ok 13:49
masak so it mostly comes down to, do you want `return` or not
much of the time with small blocks (sent to `map` etc), you don't
pierre__ make sense,
so in the case of a closure, the sub construction make more sense i guess 13:50
to explicitely return the value
masak both the block and the sub close over their respective environment
so it's only about whether you need to explicitly return 13:51
for example if you need to return early
pierre__ indeed
masak with explicit `leave`, even that would be a non-issue 13:52
but, alas,
m: { leave }; say "OH HAI"
camelia rakudo-moar f648d3: OUTPUT«leave not yet implemented. Sorry. ␤ in block <unit> at <tmp> line 1␤␤»
masak I don't know if there's an interesting technical blocker to having `leave`...
...or if it just turns out no-one really cared enough.
moritz I haven't done it, because I'm scared of low-level stuff 13:54
pierre__ ok, in the same register, a routine seems to be a block, but the reverse is not true 13:57
m: my $sub = sub { say &?ROUTINE }; $sub() 13:58
camelia rakudo-moar f648d3: OUTPUT«sub () { #`(Sub|76851984) ... }␤»
masak m: say Routine ~~ Block
camelia rakudo-moar f648d3: OUTPUT«True␤»
masak correct.
pierre__ m: my $sub = sub { say &?BLOCK }; $sub()
camelia rakudo-moar f648d3: OUTPUT«sub () { #`(Sub|68516576) ... }␤»
masak and both are Callable.
pierre__ m: my $block = { say &?BLOCK }; $block()
camelia rakudo-moar f648d3: OUTPUT«-> ;; $_? is raw { #`(Block|74998840) ... }␤»
pierre__ m: my $block = { say &?ROUTINE }; $block()
camelia rakudo-moar f648d3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤ ?ROUTINE used at line 1. Did you mean 'Routine'?␤␤»
pierre__ make sense
masak man, block gists are ugly :P
pierre__ sorry :) 13:59
masak not really your fault
TheLemonMan ugexe, zef's working perfectly so far :) 14:07
yoleaux 03:27Z <ugexe> TheLemonMan: the issues you've brought up with zef have been addressed
Woodi Zoffix: about "your lang don't have Junctions" - I think I do that in C when I read about automatic tail calls... 14:18
robertle hi folks, should using concurrency using start() and IO::Socket::INET work as expected in combination? in the sense that different threads working on different sockets do not block each other? 15:20
hoelzro robertle: if you create a socket in thread A, thread A is the only thread that can use it 15:22
moritz robertle: they don't block each other, but iirc you can't use an IO::Socket::INET from another thread
jnthn Indeed. IO::Socket::Async would be a better bet usually 15:23
Even when the "creating thread only" restriction is lifted, it'll typically still scale better.
[Coke] boggles that this conversation is getting tractino here but not in perl6-dev. 15:25
[Coke] (ok, not exactly the same convo, but definitely related) 15:26
Ulti re: padding zeroes sprintf('%08d', $int) does the job
ugexe IO::Socket::Async has no IO::Socket::SSL yet though :( 15:31
ugexe i wrote a shim to make it work but it was super slow 15:32
jnthn ugexe: I've been vaguely working on that but...OpenSSL's API makes it un-fun enough that it's hard to find motivation to do it in free time ;) 15:37
konobi nodejs probably has ideas to steal 15:38
arnsholt ssl.h is almost mappable to FFI defs programmatically (somewhat less than 200 #defines that need fixups by hand out of almost a thousand)
konobi iirc it's crypto interface is fairly slim
arnsholt crypto.h is a lot bigger
jnthn konobi: I found something to steal from, it's mostly just an annoying task to trudge though :) 15:39
ugexe gist.github.com/ugexe/71d82eb4bb5653125bd8 # this was the shim (IO::Socket::Async::SSLow)
konobi yar
ugexe jnthn: yeah the openssl api is not interesting or fun in any way :/ 15:40
[Coke] updates gist.github.com/coke/84389edf917a1...30f1c86848 to highlight his bailador(socket) vs. async issue.
Woodi hey, guys, OpenSSL is just under funded! - from 2daysago on HN TLS history link :) 15:49
AlexDaniel timotimo: wait, so… you are saying that keyboard layouts are different. Alright, makes sense. So what? Isn't it the point? 15:59
I'm actually happy that even layouts with the same name are different everywhere 16:00
this way people won't assume stupid things
robertle hoelzro, moritz, jnthn: ok, good to know that it should work. I'll do some more digging, but what I see is that I start n threads and each of them loops x/n times, creating a socket, writing, reading, closing. if n == 1, this takes some amount of time. I would expect that to drop with increasing n (right). what happens is that it increases sharply at n==2, and then stays at that time for n==3, n==4 16:01
ugexe maybe related to overhead? 16:11
m: say $*THREAD.id; for 1..4 { start { say $*THREAD.id }; };
camelia rakudo-moar f648d3: OUTPUT«1␤3␤3␤3␤4␤»
AlexDaniel in fact, keyboard layouts are so easily configurable. “`” key can as well produce 🖕, and that should not bother you at all. Sometimes I see stuff like “ok, here is my game, controls are: WASD, you can't change it” and it makes me sad. 16:16
mst btw 16:17
mst docs.perl6.org/language.html 16:17
so I skimmed to the first 'about perl6' link, which was docs.perl6.org/language/classtut
then it says 16:18
> This type object is an "empty instance" of the class. You've already seen these in previous chapters.
is there a list of the 'standard' chapter ordering?
robertle if each thread just does sleeps, then the runtime behavior is as expected: pastebin.com/YgnnJH3V 16:20
so *something* in there needs to block the multiple threads. CPU load is low, so that's not it 16:21
also note that the runtime goes up by more than a factor of two, rather than stay roughly the same which is what I would expect for some resource starvation
perlpilot mst: I *think* that bit was copied verbatim from the "Using Perl 6" book. 16:22
perlpilot Aye, cloud.github.com/downloads/perl6/b....23.a4.pdf page 54, section 5.1 16:23
AlexDaniel mst: github.com/perl6/doc/issues/889 16:24
robertle and what's the best way to go about understanding this? my next step would have been to remove http::client and doing IO::Socket::INET directly to check whether it's http::client 16:24
mst AlexDaniel: ah, so it's a doc bug, rather than me picking the wrong reading order
that's fine
just I've decided to go through the doc.perl6.org pages ignroing the 5to6 stuff and just reading through all of the 'reference to perl6' parts 16:25
mst in order to be able to ask more imaginatively stupid questions in here ;) 16:25
AlexDaniel mst: I always dislike references that assume you would be reading docs in some particular order. However, the consensus seems to be that it's OK to refer to something above on the same page. In this case, however, it is a bug indeed. 16:26
ugexe robertle: see my previous message in this channel; add a debug statement with $*THREAD.id then see what the difference is when you add the sleep. 16:27
that might give a clue. might not
AlexDaniel mst: also, it's such a pity that you are ignoring 5to6 docs. These need more eyes :) 16:29
mst I don't want to learn how to write perl5 in perl6 though
also, they almost certainly don't cover the real perl5 anymore 16:30
the classes doc talks about perl5 doing DFS for MI
whereas the best practice for ~10 years has been C3
mst (ok, they say 'by default', but ignoring how e.g. DBIx::Class does it makes it seem kinda dated) 16:31
ugexe i like writing perl6 in perl5 >:)
always get screwed by lazy map/grep though
AlexDaniel mst: great! Right. Indeed. It would be great if you could write your notes here: github.com/perl6/doc/issues/new ;) 16:31
mst every time I read perl6 OO code I think "I could write this with Moo and have less boilerplate"
ilmari mst: neither Moo nor Moose impose C3, though? 16:32
mst but I've already grumbled about the specific reasons for that
ilmari: no, but they also basically say "don't use MI"
ilmari true 16:32
robertle ugexe: fascinating! with one thread, each block of 100 http::client requests/responses takes roughlyu the same time. with more threads, each block seems to take the same amount of time, but one somewhere in the middle just sits there for quite some time... 16:33
also segfaults every now and then :) 16:34
iH2O how is that :) instead of :( 16:35
mst because eventually, you have to find this stuff funny 16:35
iH2O i wont find hillary funny once elected 16:35
im already practicing :( :( :( 16:36
robertle I do say $i++ ~ ' ' ~ now ~ ': " ' ~ $*THREAD.id; now
mst iH2O: hey, I'm english
robertle and I get:
16 Instant:1473179786.850537: " 4
17 Instant:1473179786.979291: " 4
18 Instant:1473179791.823523: " 3
19 Instant:1473179791.946529: " 3
mst iH2O: you focus on laughing at our political disasters
iH2O: and in exchange we can laugh at yours :D
robertle the first 15 lines are also very quick, note the lag from 17 to 18 16:37
iH2O im Canadian, and we'll be both affected (without representation) by hillarys policies
affected a lot
robertle I have no idea how I would go about debugging this... 16:37
ugexe robertle: your time isn't going to go down though if you are creating the socket, connecting, reading, writing, etc every time
robertle note that I do x/n cycles in each thread. if the numebr of threads goes up, the loop cycles in each thread go down 16:38
plus I am of course not saying that this is a good way to do anything, just that the behavior is puzzling
potentially puzzling in interesting ways
robertle this time I even got a core dump... 16:44
robertle #0 0x00007fca6e3cf844 in bind_key () 16:44
from //home/rlemmen/perl6env/rakudobrew/moar-nom/install/lib/libmoar.so
(gdb) bt
#0 0x00007fca6e3cf844 in bind_key ()
from //home/rlemmen/perl6env/rakudobrew/moar-nom/install/lib/libmoar.so
#1 0x00007fca6e38c78b in MVM_interp_run ()
from //home/rlemmen/perl6env/rakudobrew/moar-nom/install/lib/libmoar.so
#2 0x00007fca6e39e5ce in start_thread ()
anyway, I need to get some dinner. will try to do more digging... 16:45
harmil_wk Just responded to a p6l question with this snippet that I didn't realize would work until I tried it: 16:59
m: sub dueet(&op, *@list) { op @list }; say dueet &prefix:<[R-]>, 1..100
camelia rakudo-moar b3e442: OUTPUT«-4850␤»
Xliff <Xliff> Question for the P6 devs in here: sub EXPORT(+@a) { ... require SomeModule; ... } <- Is that supposed to crash rakaudo at stage parse? 17:05
Or at all, for that matter. 17:06
harmil_wk m: sub EXPORT(+@a) { require Test } 17:06
camelia ( no output )
harmil_wk m: sub EXPORT(+@a) { require Test }; say "looks good"; 17:07
camelia rakudo-moar b3e442: OUTPUT«looks good␤»
harmil_wk Xliff: what's your perl -v?
*perl6 17:08
Xliff m: sub EXPORT(+@A) { require ::('Test') }; say "hey!" 17:12
camelia rakudo-moar b3e442: OUTPUT«hey!␤»
Xliff This is Rakudo version 2016.08.1-48-gf2df2c5 built on MoarVM version 2016.08
implementing Perl 6.c.
harmil_wk, this is occuring in a file-based module context. 17:14
harmil_wk: When run, I get the following: ===SORRY!=== 17:15
Cannot find method 'merge-symbols': no method cache and no .^find_method
Xliff See gist.github.com/Xliff/fceb9354193e...68b991d6ec for context. 17:16
[Coke] I would recommend not having discussions about us politics in here. 17:47
I am curious as to what policies in particular you think will negatively impact you, though, esp. in comparision with the (to be generous) 3 other options. 17:49
harmil_wk [Coke]: did you just say that you would recommend against politics and then ask for followup on politics? 17:57
[Coke] did I say one thing 17:58
and then continue the thought?
yes.
geekosaur perhaps that was an invitation to continue... elsewhere 18:01
nine has even missed the first mention of politics that [Coke] responded to ;) 18:03
[ptc] nods in agreement, still confused
mst it was a canadian practising for being upset by the US presidential election outcome 18:06
at this stage, it's kind of a national sport
harmil_wk [Coke]: I was just uplifted to hear a voice of reason in suggesting that a language channel wasn't the place to introduce politics and then saddened to see the prod to continue. 18:10
timotimo i also didn't notice anything about politics 18:11
from robertle's backtrace it looks like they're accessing a hash concurrently
mst #perl does ok with this, usually - when politics come up they get discussed politely for a bit, followed by us going back to perl 18:14
anybody who can't manage to be polite wins a free tempban until they cool off
[Coke] prepends a "However, " to avoid confusion. 18:17
mspo nerd politics? 18:19
[Coke] best kind? 18:21
Woodi let's assume nerds are like scientists from Half-Life - weird, old gentelmens... so, requested by [Coke] list of facts can barely be what we call "political discusion"... agreeing on facts is almoust not-political discussion becouse politics base a lot on misunderstanding and some hidden gain, IMO 19:01
Woodi as alway is too late for current topic... :) 19:02
Woodi btw. DDD is great debugger :) 19:07
smls m: constant %a is default(42); 19:19
camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing initializer on constant declaration␤at <tmp>:1␤------> 3constant %a is default(42)7⏏5;␤»
smls ^^ Is the `is default` trait not supposed to work on constants?
moritz m: constant %a is default(42) = (); 19:20
camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Type check failed in constant declaration of %a; expected Associative but got List (List)␤at <tmp>:1␤------> 3constant %a is default(42) = ()7⏏5;␤»
moritz m: constant %a is default(42) = %();
camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(Hash, Str, Int); none of these signatures match:␤ (Mu:U $child, Mu:U $parent)␤ (Mu:U $child, :$DEPRECATED!)␤ (Mu:U $type, :$rw!)␤ (Mu:U $type, :$nativ…»
moritz smls: constant hashes are kinda weird in rakudo, because they don't do proper hash assignmnt 19:20
smls ok 19:21
moritz m: constant @a is default(42) = 1, 2; say @a[4]
camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(List, Str, Int); none of these signatures match:␤ (Mu:U $child, Mu:U $parent)␤ (Mu:U $child, :$DEPRECATED!)␤ (Mu:U $type, :$rw!)␤ (Mu:U $type, :$nativ…»
smls m: BEGIN my %a is default(42) = a => 1; say %a<b>; 19:23
camelia rakudo-moar bd3d43: OUTPUT«42␤»
smls Is there any downside to using `BEGIN my` instead of `constant`?
It'll still be pre-compiled when in a module, right? 19:24
moritz does it make %a immutable?
m: BEGIN my %a is default(42) = a => 1; %a<b> = 23; say %h 19:25
camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '%h' is not declared␤at <tmp>:1␤------> 3 default(42) = a => 1; %a<b> = 23; say 7⏏5%h␤»
moritz m: BEGIN my %a is default(42) = a => 1; %a<b> = 23; say %a
camelia rakudo-moar bd3d43: OUTPUT«{a => 1, b => 23}␤»
moritz seems it doesn't
smls I can live with that :P 19:26
smls m: my %a is Map is default(42); say %a<foo> 19:29
camelia rakudo-moar bd3d43: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤is default on shaped Map not yet implemented. Sorry. ␤at <tmp>:1␤------> 3my %a is Map is default(42)7⏏5; say %a<foo>␤ expecting any of:␤ constraint␤»
smls heh
Unavowed Quick question: In a signature you can do: Associative:D[Bool:D] $hash; If you want the equivalent for the %-sigil, can you do better than Bool:D %hash where .defined ? 19:35
moritz Unavowed: you mean except patching rakudo to make % implied :D ? :-) 19:39
Unavowed moritz: I take that as a no :D 19:40
(where :D is just a smiley face) 19:41
El_Che hi 19:46
Unavowed Is it possible to specify a type like Array[Int|Str] meaning an array which can contain ints or strings? 20:16
nine Unavowed: only as subset with a "where" 20:18
vcv isn't there already an IntStr type?
perlpilot m: my IntStr $x; 20:20
camelia ( no output )
perlpilot Looks like there is.
m: my Non-existent-type $x;
camelia rakudo-moar 72d3be: OUTPUT«5===SORRY!5===␤Type 'Non-existent-type' is not declared␤at <tmp>:1␤------> 3my Non-existent-type7⏏5 $x;␤Malformed my␤at <tmp>:1␤------> 3my7⏏5 Non-existent-type $x;␤␤»
Unavowed nine: thanks 20:28
Int|Str was just an illustration, the question was really about a general "junction" type in an Array 20:29
perlpilot m: subset Int-or-Str of Any where { $_ ~~ Int|Str }; my Int-or-Str @a = (1,2,3, "foo", "bar"); say @a.perl; @a[2] = 3.14; 20:31
camelia rakudo-moar 72d3be: OUTPUT«Array[Int-or-Str].new(1, 2, 3, "foo", "bar")␤Type check failed in assignment to @a; expected Int-or-Str but got Rat (3.14)␤ in block <unit> at <tmp> line 1␤␤»
dalek c: ba1af07 | (Jan-Olof Hendig)++ | doc/Type/Setty.pod6:
Added docs for Setty.default
perlpilot Unavowed: there's a completish example for you
Unavowed perlpilot: nice, that's what I was after, thanks 20:32
masak perlpilot: IntStr is more like Int&Str than like Int|Str 20:36
perlpilot I kinda figured. It felt errno-y 20:38
travis-ci Doc build failed. Jan-Olof Hendig 'Added docs for Setty.default' 20:40
travis-ci.org/perl6/doc/builds/157995993 github.com/perl6/doc/compare/772b2...1af07e9294
dogbert17 hmm, what is 'Type check failed in binding to $id; expected CompUnit::PrecompilationId but got Str ("4CDC84469EF12631D41D...) ..' in the Travis log supposed to mean 20:44
geekosaur ummmm 20:48
perlpilot dogbert17: my guess would be someone put "49EF1CDC84462631D41D..." where they should have put CompUnit::PrecompilationId.new("49EF1CDC84462631D41D...");
dogbert17: or someone forgot a coercion
or stuff :)
geekosaur didn't nine just change this stuff?
may have a version mismatch now
Glitchy Hey all, I'm just looking for a little advice on modules. Are there any established unit testing modules, and light web frameworks? 20:49
dogbert17 uh oh, my own changes, to the doc, look quite innocent
nine: you around? 20:50
nine dogbert17: for a couple more minutes 20:52
geekosaur if I read the commit message right, that string used to *be* the PrecompilationId, but now it is a class
dogbert17 nine: could you take a look at travis-ci.org/perl6/doc/builds/157995993
nine dogbert17: pass CompUnit::PrecompilationId.new($id) instead of just $id 20:54
dogbert17 nine: you mean change the src? 20:54
nine dogbert17: CompUnit::PrecompilationId used to be a subset of Str but now is a full class so rakudo doesn't run the "where" whenever we pass an $id around
dogbert17: yes 20:55
Using CompUnit::PrecompilationId.new($id) should work on old and new rakudos but I haven't tested that.
dogbert17 in pod2onepage I guess?
nine Oh, it doesn't :/ 20:56
m: Str.new("test")
camelia rakudo-moar 72d3be: OUTPUT«Default constructor for 'Str' only takes named arguments␤ in block <unit> at <tmp> line 1␤␤»
moritz m: subset Foo of Str where /x/; say Foo.new('blex') 20:56
camelia rakudo-moar 72d3be: OUTPUT«Default constructor for 'Foo' only takes named arguments␤ in block <unit> at <tmp> line 1␤␤»
moritz m: subset Foo of Str where /x/; say Foo('blex')
camelia rakudo-moar 72d3be: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Foo)␤ in block <unit> at <tmp> line 1␤␤»
geekosaur sadness
nine If anyone knows a better way to achieve this, I'm all ears... 20:57
moritz where does pod2onepage come from? 20:58
dogbert17 I believe gfldex wrote it som time ago 20:59
lizmat nine: add a Str.new($str) candidate ? 20:59
moritz is it a from a separate module? or part of Pod::To::HTML?
nine lizmat: I'd have to do that in older rakudos 21:00
lizmat ah, eh oh, eh too bad :-(
dogbert17 moritz: not sure to tell the truth 21:01
moritz ah, found github.com/gfldex/perl6-pod-to-bigpage
moritz nine: add a multi to precompile that does the coercion to the new type? 21:03
moritz multi method precompile($io, Str $id where ...) { self.precompile($io, CompUnit::PrecompilationId.new($id)) } 21:04
that way internal code can use the fast path, and old code should continue to work 21:05
Glitchy Is there any *Unit style testing suite for p6? 21:05
perlpilot Glitchy: if you can't find one on modules.perl6.org, I don't think there is one. 21:06
Glitchy: I wrote a hacky thing similar to P5's Test::Class, but I don't know that I'd recommend it to anyone without a few caveats. 21:07
Glitchy perlpilot: Will take a look at it 21:09
Do we still use cpanfile or is there a new way to list project dependencies?
moritz Glitchy: META6.info or something... 21:10
Glitchy: docs.perl6.org/language/modules has more infos
Glitchy moritz: Thanks
Are there any large web projects? Just looking for a 'base structure' (and maybe some help picking modules) 21:11
moritz nine: try gist.github.com/moritz/ab4cf411bd9...8439466e37
moritz nine: I'm still recompiling NQP, and need to go to bed very soon :-) 21:11
moritz if it works, feel free to push 21:12
nine moritz: makes sense. But I'm already in bed :) 21:16
.o(why am I holding my phone instead of my book?) 21:17
literal so, what is the idiomatic way of making failures fatal, e.g. for $file.copy() ? 21:36
jnthn use fatal; ? 21:37
literal oh
Unavowed m: say @(Set.new: 1, 2, 3) 21:50
camelia rakudo-moar f55e11: OUTPUT«(3 => True 1 => True 2 => True)␤»
Unavowed Wouldn't you expect this to return a list of elements rather than a list of pairs?
lizmat Unavowed: a Set is considered to be a QuantHash of Bool 22:02
thus when you make it a list, it will show the key / value pairs