ยปรถยซ 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:12 crazydiamond left 00:16 atroxaper joined 00:18 TEttinger joined 00:21 atroxaper left 00:43 ramortegui left 00:44 raschipi joined 00:45 pierre_ joined 00:51 Cabanossi left 00:53 Cabanossi joined 01:01 llfourn left 01:04 BenGoldberg joined 01:26 pierre_ left 01:32 geekosaur left 01:37 geekosaur joined, Cabanossi left 01:38 Cabanossi joined 01:43 Petit_Dejeuner joined 01:45 cdg joined 01:46 ilbot3 left
Petit_Dejeuner How would I get a file or socket to auto-close when the scope its defined in is left? I'm pretty sure I could do something with phasors, but isn't something like that already built in? 01:46
01:48 pierre_ joined 01:49 cdg left
raschipi Petit_Dejeuner: Depends on how you are using it. 01:50
01:51 ilbot3 joined, ChanServ sets mode: +v ilbot3
raschipi If you have a Seq that reads from the file, using the :close argument will make it close automatically. If you opened it just has a handle to read and write to, you'll need to explicitly close the file. 01:51
Perl6 avoids doing some tracking other languages do to avoid the performance penalty. 01:54
ugexe i think you are confused 01:55
Petit_Dejeuner Maybe if I post the code I'm trying to translate my intent will be clearer. pastebin.com/raw/PXixC0zC
raschipi: I'm surprised that there's a performance penalty for that kind of thing. Doesn't Perl6 have to check the phasors on every block either way? 01:56
ugexe they are talking about reference counting which is gc related closing of handles, not scope 01:58
docs.perl6.org/routine/close#(IO::...tine_close 01:59
raschipi ugexe: Maybe I wasn't clear with my words, but I'm aware of the difference and I know Perl6 doesn't guarantee any of them.
ugexe there is an example of how to close handles using... LEAVE phaser
raschipi ugexe: Yes, that was the next thing I was going to tell him, but I didn't start with it because he said that wasn't the answer he was looking for. 02:00
So yeah, Petit_Dejeuner, explicitly close your files in the LEAVE phasor.
Petit_Dejeuner Alright, thanks.
ugexe it was only stated that they wanted something built in. im not sure how this is not the built in answer you would be looking for 02:01
the alternative is handles always close when leaving scope unless you explicitly do... i dunno... and then it stays open? 02:02
hell `break` isnt even valid perl6 02:04
Petit_Dejeuner Many languages provide stdlibs with two ways to open files. The first returns a high level file handler that can be manually closed. This first way is almost always wrong and requires a try/finally wrapper or a dynamic-unwind around it, depending on the language. The second interface is a high order function or macro that takes a block of code as an argument. Inside that block of code, the file handler is available, 02:05
but after the block is done running, the file handler is closed.
ugexe how is that different than phaser + close? 02:06
raschipi Petit_Dejeuner: You're lookint for creating a Seq that returns the file by pieces and closes it afterwards. If you use .words or .lines on it, pass the :close argument to get something already done. 02:07
ugexe sub foo(&code) { my $handle = ...; LEAVE $handle.close; &code($handle); }
Petit_Dejeuner ugexe: I don't have to write phaser + close or anything like it, the way I opened the file ensures it will be closed correctly.
Yes, but there's no reason to write a helper if it's not already available. It just makes my code more obtuse. 02:08
02:08 Cabanossi left
Petit_Dejeuner raschipi: I'll look into that. 02:08
02:09 Cabanossi joined
ugexe right, you'd normally just write LEAVE $whatever.close, the &code was just because it was in what you said other libraries provide 02:09
Petit_Dejeuner If the Seq isn't what I want, I'll probably just use the LEAVE.
raschipi Try the P6 way, it works and it's simple to use. It's just different and you're not used to it yet. 02:10
Petit_Dejeuner I'll try! :) 02:11
02:16 pierre_ left 02:19 atroxaper joined
raschipi Petit_Dejeuner: Some tips for doing it: right after opening the file, register the LEAVE phaser. It doesn't need to be near where you think it will be executed. Let Perl6 keep track of that for you. 02:22
02:23 atroxaper left 02:24 pierre_ joined 02:29 neet joined, neet left
AlexDaniel raschipi++ 02:35
AlexDaniel โ™ฅ LEAVE 02:36
02:40 noganex_ joined 02:42 noganex left 02:52 ijneb left 03:03 char_var[buffer] left 03:06 Cabanossi left 03:07 Cabanossi joined 03:08 geekosaur left 03:10 zengargoyle left 03:12 geekosaur joined 03:15 zakame joined, char_var[buffer] joined 03:19 llfourn joined 03:22 zengargoyle joined 03:26 pharv joined 03:30 pierre_ left 03:34 geekosaur left 03:36 Cabanossi left 03:37 Cabanossi joined 03:44 geekosaur joined 03:51 pharv left 03:54 markmont left 03:58 wamba joined 04:00 cdg joined 04:02 pierre_ joined 04:05 cdg left 04:06 Cabanossi left 04:07 Cabanossi joined 04:08 BenGoldberg left 04:18 mr-fooba_ left 04:20 atroxaper joined 04:21 pierre_ left 04:22 pierre_ joined 04:23 mr-foobar joined 04:26 atroxaper left, pierre_ left 04:35 Cabanossi left 04:37 Cabanossi joined, xtreak joined 04:48 pilne left 04:55 xtreak_ joined 04:56 raschipi left 04:58 xtreak left 04:59 piojo joined 05:04 itaylor57 left 05:09 piojo left 05:11 xtreak joined 05:15 xtreak_ left 05:16 xtreak left 05:20 piojo joined 05:32 ufobat joined 05:36 parv joined, itaylor57 joined 05:46 skids left 05:49 pierre_ joined, nadim joined 05:50 mtsd joined
gfldex m: class C { my $a = 42; method m { temp $a; say $a; $a = 0; say $a } }; C.new.m 05:57
camelia 42
0
05:57 mtsd left 06:00 wamba left 06:01 cdg joined
parv Emric F makes a string case for Bailador: blogs.perl.org/users/emeric/2017/08...-help.html . That, or the post could have been only a place holder. 06:02
s/string/strong/
ufobat sounds like an SOS call :D 06:03
gfldex the internet must be broken. I made a mistake in my blog and wasn't corrected before I could blink! 06:05
06:06 cdg left 06:07 espadrine joined 06:17 nadim left 06:20 darutoko joined 06:23 ins64 joined 06:24 atroxaper joined 06:25 domidumont joined, ins64 left 06:29 cdg joined, atroxaper left 06:30 domidumont left, domidumont joined 06:33 cdg left 06:36 domidumont left 06:42 espadrine left 06:46 nadim joined 06:50 Cabanossi left 06:51 lowbro joined, lowbro left, lowbro joined 06:52 Cabanossi joined 07:03 wamba joined 07:08 rindolf joined 07:17 nattefrost joined 07:25 leont joined 07:26 lichtkind joined 07:33 robertle left 07:37 Cabanossi left, Cabanossi joined 07:38 leont left 07:40 OtherNick joined 07:41 zakharyas joined 07:45 wamba left 07:46 rindolf left 07:47 jsimonet joined 07:49 jsimonet left 07:50 jsimonet joined
nadim Good morning! 07:52
07:56 robertle joined 07:58 rindolf joined 08:00 domidumont joined, jonas1 joined 08:01 robertle left 08:04 dakkar joined 08:05 Cabanossi left 08:07 Cabanossi joined 08:09 robertle joined, rindolf left 08:17 zakame left 08:18 Ven joined, Ven is now known as Guest47978, Guest47978 is now known as Ven``
lizmat .tell gfldex cool blog: gfldex.wordpress.com/2017/08/20/pr...-for-your/ but couldn't you use a trait aka "my $c is watched" ? 08:19
yoleaux lizmat: I'll pass your message to gfldex.
08:21 leont joined, nadim left 08:29 wamba joined 08:36 Cabanossi left 08:37 Cabanossi joined 08:41 parv left 08:45 cdg joined 08:49 cdg left 08:50 nadim joined 09:04 wamba left
nadim Hi, I see that Str has a rotor method that is a Todo, is there a plan to implement those or one implements it and send a patch? 09:06
also, there's a Hash.grep method that is a Todo, how was that supposed to work? 09:07
09:07 leont left 09:10 cdg joined 09:12 cdg_ joined 09:15 cdg left 09:16 cdg_ left, cdg joined 09:17 pierre_ left 09:18 pierre_ joined 09:20 cdg left 09:25 El_Che joined 09:26 cdg joined
El_Che I pointed the rakudo/zef Fedora to this channel in case he has questions, so be nice :) 09:26
(as you always are)
09:27 cdg left, cdg joined, atroxaper joined 09:32 atroxaper left, cdg left 09:42 pmurias joined
lizmat nadim: where do you see those things? 09:44
09:46 cdg joined 09:51 Cabanossi left
nadim lizmat: docs.perl6.org/type/Hash#(Any)_method_grep 09:51
09:51 cdg left
nadim note that in the case of Hash.grep it is implemented 09:52
lizmat nadim: well, not really: it's implemented because Hash is an Any, and Any.grep is implemented
09:53 Cabanossi joined
nadim what is the TODO supposed to mean? 09:53
lizmat that the *documentation* is missing
09:55 TEttinger left 09:56 pierre_ left
Ven`` Damian Conway is beautifully insane, huh. 09:57
nadim anything new or the same old insane? 10:06
10:13 lichtkind left
nadim Here is a rather weird question, i have a piece of text generated with .perl; I want to evaluate is in another context where I know the types used in the .perl do not exist. Is there a way to catch the errors, force the generation of "dummy" types? 10:17
10:20 dogbert17 joined
lizmat nadim: the only thing I can think of, is iterative: EVAL the string, if it throws an X::Undeclared::Symbols, look at unk_types, create them, and rince/repeat 10:20
10:26 lichtkind joined
nadim thanks for the X::Undeclared::Symbol tip. EVAL being fast as it is, that means it would take forever. I had an object, mainly string, 500 KB in size, it took 40 seconds to EVAL. 10:29
10:39 cdg joined 10:41 Zoffix joined
Zoffix Petit_Dejeuner: note there's a module that gives you a `does auto-close` trait that will install the phaser for you. I didn't read far into backlog, but most of the common file operations can be done with IO::Path and you never need to worry about file handles or when to close them. 10:43
buggable: eco Trait::IO
buggable Zoffix, Trait::IO 'Helper IO traits': github.com/zoffixznet/perl6-Trait-IO
10:44 cdg left
Zoffix As for some suggesting LEAVE phasers: keep in mind the code shown will trigger the phaser when routine is called with incorrect args. Probably applies to methods only... 10:46
m: class { method foo { my $foo = open 'bar'; LEAVE $foo.close; } }.foo: 42
camelia No such method 'close' for invocant of type 'Any'. Did you mean 'clone'?
in block <unit> at <tmp> line 1
Zoffix ^ not a very enlightening error, since it dies with that before it can tell you wrong args were passed
10:48 pierre_ joined
Zoffix "Perl6 avoids doing some tracking other languages do to avoid the performance penalty." 10:49
Huh? I thought it was just a different mechanism
The ref counting has its own host of issues 10:50
10:50 Cabanossi left 10:52 Zoffix left, Cabanossi joined 10:57 committable6 joined, ChanServ sets mode: +v committable6 11:02 zakharyas left 11:10 pierre_ left 11:11 wamba joined 11:13 rindolf joined
piojo It looks like on windows, the newlines are being changed to '\r\n' 11:22
Perl6 won't open the file in binary mode and allow printing
is there a workaround? in other environments (or perl5), you just open the file as binary. 11:23
I mean in output, when I call $fh.print("$line\n")
11:27 domidumont left 11:28 domidumont joined
piojo Okay, I used $fh.write($line.encode("utf-8")), but I'm surprised it takes so much boilerplate (on every single line) to avoid the dreaded \r\n 11:29
11:30 atroxaper joined
lizmat piojo: have you tried opening with :nl-out("\n") 11:32
timotimo the encoder has a translate-nl option
you can pass an encoder object to :enc, and you can pass :!translate-nl to the encode method 11:33
11:34 atroxaper left
timotimo like Encoding::Registry.find("utf8").new(:!translate-nl) 11:34
11:39 macsnowball joined
macsnowball nick macsnowball 11:40
Ven`` Aw, I regret missing TPCiA.
when's the SPW?
11:41 macsnowball left
ilmari this week (fri-sat) 11:41
act.perl-workshop.ch/spw2017/
timotimo is going to spw o/ 11:42
Ven`` oh, probably a bit late to book 11:43
11:44 jjatria joined
lizmat conf is still open to registration :-) 11:45
piojo lizmat: I opened with :nl-out(""). Didn't try "\n" yet
lizmat et on parle Francais la bas
piojo lizmat: nl-out doesn't help, I'll try timotimo's way 11:47
Ven`` il y a marquรฉ anglais :)
their "online booking" link doesn't seem to work. mmh..
should look for a different hotel, since hotel du golf itself's website doesn't help at all. two links to book but none work, and the "rates" link doesn't work ;o) 11:50
piojo timotimo: I think the syntax is "encoder" rather than "new" :enc(Encoding::Registry.find("utf8").encoder(:!translate-nl)) 11:56
timotimo: but it fails with: Unknown string encoding 'Encoding::Encoder::Builtin<160273136>'
timotimo oh? wow 11:57
piojo I'm using rakudo star 07, so I'll see if the new release fixes it, when it comes out 11:58
11:58 raschipi joined
timotimo perhaps you can call .encoding(Encoding::Registry.find(......)) on the handle once you've built it 11:58
piojo I can't test moar-blead because of the build problem... 11:59
timotimo the new release is just about done, i don't think a fix for this will be put in
piojo I meant maybe it's already done
I know most developers don't use Windows, so maybe someone spotted this previously
timotimo we just fixed some windows build issues today 12:00
piojo Nice
timotimo is it about something with registers and such?
piojo yeah, I saw lots of discussion about it
I'll try building from source tomorrow
timotimo yeah, no fix for the encoder for this release 12:01
you can always create your encoder up top and use it to encode all your strings and .write them to your binary handle
piojo timotimo: same result when setting the encoding on the open $fh 12:02
timotimo yeah
i tried it locally with the very latest version
same error
12:03 lichtkind left 12:04 ntinos joined
piojo It would be nice to have a pre-made encoder with a string name that doesn't translate newlines, but it's enough if this info is readily available 12:04
stackoverflow is good for that, when you're not sure where to stick the info in the documentation
just ask a question, and answer it yourself :) 12:05
(if you know it's something people are going to search for)
12:05 Cabanossi left 12:07 Cabanossi joined
piojo timotimo: thanks for the explanation! 12:08
timotimo no prob 12:09
12:10 piojo left 12:11 domidumont left, domidumont joined 12:14 char_var[buffer] left 12:15 domidumont left, char_var[buffer] joined, thinkpad joined 12:16 domidumont joined 12:17 gfldexwork joined, thinkpad left
gfldexwork lizmat: I had the plan to be brave and implement a slang but a trait is a good fallback. I may just add it to the block before I fail at the slang. :-> 12:18
12:19 domidumont left
Ven`` TIL about the $_ with X idiom :). lizmat++ 12:20
12:20 domidumont joined
Ven`` well, $x = $_ with $y, rather. 12:20
timotimo it's like R//R= :P 12:23
(except that still gives you the wrong thing) 12:24
or, huh, maybe not?
i don't think R= is actually a metaop
raschipi So, people really didn't like the way I tried to explain why Perl6 doesn't have some guarantees other languages have. Isn't it the motive to not guarantee everything will be garbage collected to make sure rakudo will exit fast? (Letting the OS do the work...) And the motive for not doing reference counting is to allow the flexibility necessary for more modern GC designs?
timotimo well, reference counting does have a big performance impact for multithreaded programs 12:25
and yeah, we do let the OS clean everything up, that's why we don't guarantee we run DESTROY for everything
12:26 zakharyas joined
raschipi So, what did I got wrong? Zoffix, can you help me? What were the details I missed? 12:27
timotimo let me look again 12:28
raschipi I can bring you links to the relevant parts if you want. 12:29
12:30 domidumont left 12:31 Zoffix joined
Zoffix raschipi: where did I say you got anything wrong? 12:31
Defensive much?
raschipi No, I'm just asking if that's the case.
Because of this: irclog.perlgeek.de/perl6/2017-08-21#i_15048898. I'm asking what you meant, did I got some detail wrong? 12:32
timotimo you can say "refcounting is just a differnet mechanism", but in multithreaded situations it's far inferior to anything "completely" gc-based 12:33
Zoffix I asked if it were really true we used different mechanism from Perl 5 simply for performance reasons.
timotimo doesn't D offer both ref-counted parts and GC'd parts? and if you don't use the GC, the GC doesn't end up in your program at all?
raschipi OK, thanks for the explanation.
12:33 Zoffix left 12:34 domidumont joined 12:40 gfldexwork left 12:41 domidumont left 12:43 domidumont joined 12:45 mr-foobar left 12:46 mr-foobar joined 12:47 sena_kun joined 12:50 NeuralAnomaly joined, ChanServ sets mode: +v NeuralAnomaly
lizmat I seem to recall that MoarVM had some parts refcounted, but that turned out to be a Bad Idea(tm) 12:52
12:54 atroxaper joined, pierre_ joined 12:55 atroxaper left 12:57 rindolf left, macsnowball joined, mcmillhj joined
timotimo was that the frame cache or something? hmm. 13:06
jnthn Frames used to be ref-counted
13:06 bdmatatu joined
jnthn Before we introduced the call stack regions mechanism 13:06
And then made them GC-able
13:07 smash joined
jnthn And yeah, it didn't work out too well to have a hybrid model 'cus it intersected badly with generational GC 13:07
So as soon as your program kept lots of closures alive, GC performance started to tank
mspo can you create your own gc generations at runtime? 13:15
jnthn No 13:16
.oO( Does any VM do that? :) )
mspo erlang, of course :) 13:18
each process is its own thing
raschipi I heard Erlang has the opposite problem people usually have with concurrency, _nothing_ is shared. 13:19
mspo but the beam collector only works on process-level. There are no generations that i know about
raschipi: yeah it's tricky
X="stuff".
raschipi mspo: Do you know if it's possible to mmap files in diffrent heavy weight threads in Erlang? 13:21
mspo raschipi: you don't have any access to os threads at all, as far as I know 13:22
raschipi: BEAM decides the number of threads and how to schedule them
raschipi Right, does it have an interface for mmap?
mspo raschipi: I don't think so 13:24
raschipi Thanks.
mspo raschipi: if file:something does an mmap under the hood or not; I wouldn't know 13:25
raschipi: but it would be unusual for erlang to expose that kind of low level detail 13:26
raschipi mspo: I'm seeing the discussion online, and people talk about patching the VM to get that behavior.
mspo raschipi: it would be a nice option probably 13:27
raschipi mmap is most interesting when the same file is mapped in multiple processes.
"because of mmapโ€˜s alignment restrictions combined with the way the Erlang runtime allocate binaries, I was forced to copy the data into the binary, thus killing any performance benefits mmap might have provided." 13:29
sena_kun > m: say "<html>My Content</html>" ~~ /'<html>' .*? '<'/ 13:35
m: say "<html>My Content</html>" ~~ /'<html>' .*? '<'/
camelia ๏ฝข<html>My Content<๏ฝฃ
sena_kun m: say "<html>My Content</html>" ~~ /'<html>' .*? '<h'/
camelia Nil
sena_kun Do I miss something?
jnthn / 13:36
sena_kun omg
13:36 Cabanossi left
mspo can you tell perl6 to mmap a file? 13:36
13:37 cdg joined, Cabanossi joined
raschipi mspo: I suppose I should try it using NativeCall. 13:37
mspo raschipi: I think they would need a nif-module to give an mmap interface but i don't know how it would all work 13:38
so the same answer :)
timotimo yeah, nativecall lets you handle mmapped stuff 13:39
you can't allocate perl6 objects into an mmapped region, though
raschipi Well, bummer. 13:40
mspo is that a practical limitation?
raschipi Like I said, the interesting part is to have a mmaped file in two processes, alocating the objects in the file would mean the object would be available in both processes. 13:41
Like if they were threads.
moritz how do pointers work in mmap'ped memory regions? 13:42
timotimo if you allocate a perl6 object into a shared memory region, it's very easy to make your vm segfault ... 13:44
moritz I can imagine, yes 13:45
raschipi moritz: Pointers are restricted to offsets to inside the file itself.
I completely see why it doesn't work, though. 13:46
ingy how do I get every element of an array after the first? 13:48
AlexDaniel m: my @a = <a b c d>; say @a[1..*]
camelia (b c d)
ingy ta
timotimo m: my @a = <a b c d e f g>; .say for @a.skip(1)
camelia b
c
d
e
f
g
AlexDaniel bench: HEAD my @a = <a b c d>; for ^10000 { say @a[1..*] } 13:49
benchable6 AlexDaniel, starting to benchmark the 1 given commit
AlexDaniel, ยฆHEAD: ยซ1.6327ยป
AlexDaniel bench: HEAD my @a = <a b c d>; for ^10000 { .say for @a.skip(1) }
benchable6 AlexDaniel, starting to benchmark the 1 given commit
AlexDaniel that's not entirely identical, butโ€ฆ
Ven`` the first one creates a temporary string
AlexDaniel m: my @a = <a b c d e f g>; say @a.skip(1) 13:50
camelia (b c d e f g)
13:50 domidumont left
benchable6 AlexDaniel, ยฆHEAD: ยซ6.6695ยป 13:50
Ven`` why not say @a.skip(1)?
AlexDaniel bench: HEAD my @a = <a b c d>; for ^10000 { say @a.skip(1) }
benchable6 AlexDaniel, starting to benchmark the 1 given commit
AlexDaniel, ยฆHEAD: ยซ1.2387ยป
AlexDaniel yep
timotimo one less loop, that explains the performance discrepancy 13:51
Ven`` The overhead is probably because the 1st one has two iterators, the second one has one
(one iterator for 1..*, one iterator for @a vs one iterator for @a)
AlexDaniel m: my @a = <a b c d>; say WHAT @a[1..*] 13:52
camelia (List)
AlexDaniel m: my @a = <a b c d>; say WHAT @a.skit(1)
camelia No such method 'skit' for invocant of type 'Array'. Did you mean any of these?
emit
shift
sin
skip

in block <unit> at <tmp> line 1
AlexDaniel m: my @a = <a b c d>; say WHAT @a.skip(1)
camelia (Seq)
timotimo it doesn't necessarily do an iteration of the 1..*
it could totally see it's a Range and work more efficiently
AlexDaniel yea, I'd expect it to be smarter than that
13:52 jjatria left
AlexDaniel why does it have to return a List there though? 13:53
Ven`` let's go check with the magic bus
AlexDaniel m: my @a = <a b c d>; say WHAT @a.list.skip(1)
camelia (Seq)
13:53 jjatria joined
AlexDaniel m: my @a = <a b c d>; say WHAT @a.list[1..*] 13:53
camelia (List)
13:54 kannan joined
Ven`` m: my @a = 1..*; say WHAT @a[1..*] 13:54
reified?
camelia (timeout)
timotimo AFK for a bit
Ven`` m: my @a = 1..*; say WHAT @a.skip(1)
camelia (Seq)
Ven`` yup...
kannan hello good day. i am new here. can one learn perl6 without knowing much of perl5? (just going to get started with coding) 13:55
Ven`` kannan: perl6.org/resources/ see here 13:56
We have a "For Newcomers" section.
kannan Ven` ` oh ok, thanks 13:57
raschipi kannan: Yes, no need to know Perl5 at all.
Ven`` say: 1..* ~~ Iterable:D
kannan good. i will start then.
Ven`` m: say 1..* ~~ Iterable:D
camelia True
Ven`` timotimo, AlexDaniel: apparently lizmat++ worked on such a candidate and reverted the commit ( github.com/rakudo/rakudo/commit/75...60459f14fe ) 13:58
lizmat yeah, it broke stuff in the ecosystem afaik 14:01
14:01 domidumont joined
lizmat and I also realized I would need to dig deeper to really make things faster generally 14:01
that area of the setting is still showing scars of the GLR 14:02
m: my @a = ^10; dd @a[^5].WHAT
camelia List
lizmat ideally, I would want that to return a Seq
AlexDaniel yeah 14:03
lizmat but that will be for after the SPW
AlexDaniel Ven``: RT #131830
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131830
jnthn Seq? It's by design that indexing consistently returns a List, I thought...
lizmat jnthn: but why ?
Ven``
.oO( The GLR also left scars in my understanding of this apparently )
14:04
jnthn I'm sure this was discussed a bunch during the GLR. 14:05
ilmari GLR = gashes left and right
jnthn I don't consider it up for being revisited.
lizmat well, my recollection is that it was considered too complex to make it a Seq
but with my current knowledge of iterators, seqs and other internals,
I think it is merely tricky 14:06
and it could give a performance boost in many cases
jnthn Yeah but it's API. Everybody who's written my @foo := @bar[1..5]; would have their code broken by this
lizmat so perhaps this needs to be 6.d :-) 14:07
jnthn I don't recall it as "too complex", I recall it as a concious decision that slicing should return a List
14:08 skids joined 14:28 matiaslina joined
daxim hey, the bugs I filed three days ago failed to materialise in the queue. I need a champion to take over for me: <paste.debian.net/hidden/33aab62d/> (NB: 3 bugs altogether) please highlight me if you do so. 14:30
14:31 brrt joined
ugexe there is no binary grammar parsing 14:32
daxim that's what the bug says 14:33
ugexe thats a feature request
AlexDaniel so mark it as [RFC] and that's it. 14:34
daxim: fwiw, โ€œparser lacks a sensible error messageโ€ is a known thing. In fact, this was addressed a couple of days ago, but it's not backward-compatible 14:35
daxim what does addressed mean here?
AlexDaniel daxim: it was changed to return a Failure (which had all of the nice bits) instead of a Nil, but you can probably imagine how many people were relying on the old behavior :) 14:36
daxim ok, cool
AlexDaniel daxim: so first we moved it to 6.d (and it was usable if you put use v6.d.PREVIEW in your source), but today it was decided that it's not going to fly
daxim: in other words, 2017.08 release is not going to have it 14:37
14:37 mcsnolte joined
Ven``
.oO( .parse-pretty-please )
14:38
ugexe say $match-obj isnt pretty enough? 14:39
AlexDaniel daxim: in any case, here's a ticket, so we probably don't need another one: RT #131919&
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131919
Ven`` ugexe: when a match failed?
the Failure isn't for when the match succeeded.
ugexe ha i thought you were asking for a .parse-pretty (like a json-pretty)... I missed the please 14:40
AlexDaniel daxim: also, I've already done a bunch of PRs to modules that relied on the previous behavior, in a hope that it will ease up the transition. You see, we want this change as strongly as your ticket suggests it :) 14:42
mspo mm binary grammar
timotimo fwiw, you can parse your string as latin1 and pretend you have bytes with your grammar ...
AlexDaniel daxim: โ€œinfinite loop with grammarโ€ is a valid ticket, but the doc part of it is better submitted here: github.com/perl6/doc/issues 14:43
daxim what about the failure mode? 14:45
14:47 nattefrost left
AlexDaniel daxim: that's why I say that the ticket is valid. Most likely there's a way to do it better, but it has to be discussed more 14:48
daxim can you take care that the ticket doesn't fall under the table? 14:49
14:51 ChoHag left 14:53 pierre_ left 14:57 sena_kun left 14:58 pierre_ joined, rindolf joined 15:01 pierre_ left 15:04 Cabanossi left 15:06 macsnowball left 15:07 Cabanossi joined 15:08 zakharyas left 15:16 matiaslina left 15:24 gregf_ joined, Kyo91 joined 15:26 sena_kun joined 15:29 Skarsnik joined
Skarsnik Hello 15:29
timotimo yo
Ven`` \o 15:34
15:35 Cabanossi left
kannan ok, now i ran the 'hello world' !! i added 3 lines to /etc/profile 15:36
export PATH=$PATH:/opt/rakudo-star-2017.07/bin
export PATH=$PATH:/opt/rakudo-star-2017.07/share/perl6/bin
export PATH=/usr/src/perl6/rakudo-star-2017.07/install/bin/:$PATH
not sure if these are the correct ones, i added first two from instructions seen after a 'make install', and the last one from installation instruction. 15:37
15:37 Cabanossi joined 15:38 wamba left
kannan on website - rakudo.org/how-to-get-rakudo/#Insta...Star-Linux 15:38
Skarsnik hm did you set a prefix? 15:39
15:41 brrt left
timotimo can you look what these paths contain? 15:46
Skarsnik what di you use? rakudobrew? 15:47
timotimo i hope not! 15:49
ugexe its rakudo star, and they showed a link to the instructions they followed
kannan tom editor gives an error when i run a helloworld.p6 - Check Error: Failed to spawn command `perl6`. Make sure `perl6` is installed and on your PATH
atom editor i meant 15:50
ugexe did you refresh your shell so the PATH got updated? what does `echo $PATH` show?
15:50 devmikey joined
timotimo when you change /etc/profile it doesn't immediately take effect everywhere 15:51
15:51 jonas1 left
Skarsnik ugexe, dunno the link point me to etheir apt or rakudobrew 15:51
timotimo why are we still recommendin rakudobrew on rakudo.org 15:52
Petit_Dejeuner is it that bad?
15:53 jjatria left
kannan ugexe, thanks. i just need to restart the atom editor. 15:53
15:54 jjatria joined
timotimo it can cause some trouble 15:54
15:54 pecastro left
timotimo it's meant for rakudo developers who want to quickly switch between multiple rakudo versions 15:54
Petit_Dejeuner like the python or ruby version managers?
Petit_Dejeuner can't remember what they're called. 15:55
rvm, pvm?
Skarsnik dunno I always fetch rakudo directly
kannan i installed from source (rakudo star) , as explained on the perl6intro page for installing. i did not install rakudobrew. 15:56
15:56 lowbro left
kannan now all i have left is to learn to code and learn perl6 , heh. 15:56
ugexe there is a few problems if you aren't experienced enough to know whats happening. for instance: problems with the git repos between 1 of 3 different things (rakudo, moarvm, nqp), artifacts when upgrading an existing installation ala moar-nom/moar-blead, previous module installations can go haywire, etc 15:57
timotimo and the bin/ stuff modules install ... they only actually show up when you "rakudobrew rehash" 15:58
15:58 rba_ joined, zakharyas joined 16:00 pecastro joined, telex joined 16:01 rba__ joined
ugexe but if you *do* know what you are doingits invaluable 16:02
and "know what you are doing" I really mean "know how to avoid the traps" 16:03
Skarsnik rm -fr rakudo && git clone 16:04
how git work in a nutshell
16:04 rba_ left 16:05 OtherNick left
mspo yeah that split is pretty confusing 16:08
16:08 imcsk8 joined 16:10 setty1 joined, pmurias left 16:12 AlexDaniel left 16:13 rba__ is now known as rba_, rba_ is now known as rba, rba is now known as rba_ 16:16 AlexDaniel joined 16:17 rba__ joined 16:18 Ven`` left 16:19 rba_ left 16:20 P6steve joined 16:21 alimon left 16:22 mcmillhj left 16:27 dakkar left 16:31 alimon joined, rba_ joined
P6steve Hi - I am trying to write a perl6 Class "Distance" to work as a type. This works my Distance $d .= new: '1e1 m'; With infix foo, this too $d โ‡ '3e1 m'; BUT my Distance $c; $c โ‡ '3e1 m'; seems to load attributes but leave object itself undefined. 16:32
Probably a newbie error ... can someone give me a hint, please?
16:33 S007 joined 16:34 rba__ left, mcmillhj joined
timotimo how does your infix work? 16:36
P6steve sub infix:<โ‡> ($left, $right) { return $left.assign($right); } 16:37
timotimo that'll only work if the assign method works on undefined Distance objects
rather, "the type object" 16:38
if you don't .new your my Distance $c, it'll be just the type object of Distance
16:38 raiph joined
timotimo you can do a little magic with "is rw": turn your infix into a multi sub, one of the multis will look like (Distance:U $left is rw, $right) { $left = Distance.new; $left.assign($right) } 16:39
P6steve multi method assign (Str:D $right) { if self.defined { self.extract($right); } else { self.new($right); } }
timotimo oh, ok
that still doesn't do anything to actually cause assignment to the variable on the LHS of your arrow 16:40
it'll return the new object, but it'll just fall on the floor
P6steve ah - now I (think I) get it - multi the infix seems best
timotimo it makes sense to only ask for "is rw" if it's a Distance:U 16:41
because that lets you do something like Distance.new <= '1 m', where there is no variable that it could modify 16:42
P6steve sounds good - let me give that a shot - thanks 16:43
16:44 st_elmo joined 16:46 rba__ joined, gregf_ left
timotimo you're welcome! 16:47
i'll be afk for a bit
16:48 rba_ left 16:50 Cabanossi left 16:51 bdmatatu left 16:52 Cabanossi joined, kannan left 17:01 rba_ joined
P6steve my Distance $c โ‡ '5e1 m'; say $c; #50 m Nice 17:02
17:03 rba__ left 17:09 setty1 left 17:10 zakharyas left
Petit_Dejeuner Weird, when I call the socket 'print' method with a string argument, I get an error as if I'm calling 'print' as a string method and a function, like 'abc'.print('abc'). 17:11
gfldex m: constant \T = Int; my T $b;
camelia ( no output )
yoleaux 08:19Z <lizmat> gfldex: cool blog: gfldex.wordpress.com/2017/08/20/pr...-for-your/ but couldn't you use a trait aka "my $c is watched" ?
gfldex is that doced?
and more important, is that specced? 17:12
ugexe looking at the doc for trait i would say yes? 17:13
gfldex it's a bit to hidden. I shall issue right away! 17:16
17:16 rba__ joined 17:19 rba_ left 17:23 jjatria left 17:24 raiph left, jjatria joined 17:28 nadim left 17:31 rba_ joined 17:33 rba__ left 17:34 sjoshi joined 17:35 DerAlex joined
timotimo s: IO::Socket::INET, 'print', \("Foo") 17:35
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/2017...ket.pm#L93
17:35 Cabanossi left
timotimo huh, how did the . in the tag name get lost? 17:35
Petit_Dejeuner: do you have an IO::Socket::INET or an IO::Socket::Async? 17:36
Petit_Dejeuner timotimo: I have an IO::Socket::INET
timotimo mhm, it should work with a string argument
can you show some code?
Petit_Dejeuner sure
17:37 DrForr joined, Cabanossi joined
Petit_Dejeuner timotimo: pastebin.com/raw/s9cZbQb1 17:38
DrForr Well, that was an odd greeting.
yoleaux 29 Jun 2017 10:52Z <tbrowder> DrForr: my Perl6::Parser PR passes all tests
timotimo yo DrForr, how are you doing?
17:38 devmikey left
timotimo howd on 17:39
Petit_Dejeuner: why does it say "parrot" there?
what's your perl6 --version?
Petit_Dejeuner 'This is perl6 version 2014.07 built on parrot 6.6.0 revision 0' 17:40
oh
sjn quick question; is there a way to query the version on of a loaded module? (eqiv. to print $My::Module::VERSION in perl5)
timotimo that's really not good :D
Petit_Dejeuner I'm guessing 2014's way too old.
What's the point of having a package manager if everything is several years out of date. I gotta go install by hand. 17:41
DrForr Working on the emojicode parser, thinking about debugging.
timotimo there's packages you can get for your distro
huggable: packages
huggable timotimo, nothing found
timotimo buggable: packages
Petit_Dejeuner thanks
timotimo huggable: debian
huggable timotimo, nothing found
timotimo really
17:41 wamba joined
AlexDaniel huggable: deb 17:41
huggable AlexDaniel, CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
AlexDaniel huggable: debian :is: CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
huggable AlexDaniel, Added debian as CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
AlexDaniel huggable: packages :is: CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases 17:42
huggable AlexDaniel, Added packages as CentOS, Debian, Fedora and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg/releases
timotimo thanks! 17:43
Petit_Dejeuner: if you're on any of these distros, you're in luck!
17:46 rba__ joined 17:47 ChoHag joined 17:48 rba_ left
sjn m: use Test; say Test.^ver; 17:49
camelia (Mu)
DrForr Working on the emojicode parser, thinking about debugging.
Grr.
sjn doesn't any of the core rakudo modules have a version defined? 17:50
El_Che DrForr: I understand the -o fun part, but wtf :)
sjn El_Che: -o fun # output fun 17:51
El_Che: -O fun # optimize fun
DrForr It just happens that I was on the worng tmux screen.
sjn :)
DrForr That and I'm distracted by watching a .. review, I think... of /Moonwalker/. 17:52
El_Che sjn: -O ๐Ÿคก 17:53
sjn El_Che:-D
El_Che timotimo, Petit_Dejeuner: if you use and other distro, and there is demand for pkgs, I can add it. 17:54
17:54 sjoshi left
Petit_Dejeuner El_Che: I'm on Devuan, so the Debian package would probably work, but it would just need to be tested. 17:55
Which I guess <<I'm>> in a pretty good position to do.
Although I just started installing rakudobrew, so I'll have to sanitize my system first. 17:56
El_Che wel, if devuan is binary compatible with the released debian version, it should work. No systemd deps on the pkgs :)
Petit_Dejeuner Oh, then that should be fine!
Let me see if rakudobrew works, then I'll try uninstalling it and check if the deb works. 17:58
18:01 rba_ joined
El_Che both work :) 18:03
18:03 rba__ left 18:05 Cabanossi left 18:07 Cabanossi joined 18:11 cdg left 18:16 rba__ joined 18:18 rba_ left 18:26 mcmillhj left 18:30 leont joined 18:31 cdg joined, rba_ joined 18:34 rba__ left 18:36 cdg left 18:39 rba__ joined, rba_ left, mcmillhj joined 18:41 TEttinger joined 18:44 mcmillhj left
Geth ecosystem: 23e74625a9 | (Martin Barth)++ (committed using GitHub Web editor) | META.list
time::crontab META.info -> META6.json
18:46
18:47 rba_ joined 18:49 rba__ left, Rawriful joined 18:51 mcmillhj joined 18:52 jjatria left 18:53 jjatria joined 18:55 rba__ joined, mcmillhj left 18:58 rba_ left 19:02 rba_ joined 19:03 rba__ left 19:04 mcmillhj joined 19:05 Cabanossi left 19:06 domidumont left 19:07 Cabanossi joined, pierre_ joined, espadrine joined 19:11 P6steve left 19:12 pierre_ left 19:15 geekosaur left 19:17 setty1 joined, rba__ joined 19:19 rba_ left, darutoko left 19:21 leont left 19:22 pecastro left 19:25 geekosaur joined 19:27 raschipi left
gfldex m: multi sub trait_mod:<is>(Variable $v, :$watched){ dd $v }; my $c is watched; say $c; 19:29
camelia Variable $c = Variable.new(name => "\$c", scope => "my", var => Any, block => -> gnatur { #`(Block|42281752) ... }, slash => Perl6::Grammar.new() #`[140095662401952])
(Any)
19:30
gfldex what is slash in `Variable`?
19:30 pecastro joined
ugexe the variable name is '$c' i presume 19:30
oh literal 'slash' 19:31
19:31 rba_ joined
moritz probably a $/ during compile time 19:31
19:33 rba__ left
gfldex i'm trying to bind a new container to a Variable in a trait. Is there actually any way to do that? 19:37
timotimo gnatur %)
gfldex: i don't think so, as traits are compile-time
lizmat gfldex: I have been trying that this afternoon... didn't get it to work yet 19:39
gfldex i'm trying to tie a Proxy to a Variable as lizmat suggested. Looks like I will have to dive into NQP land.
muddy waters that
lizmat I assume you got to the Scalar container already? (1st param.var.VAR )
gfldex yes 19:40
lizmat I was thinking that maybe by using the $!whence on the container, you could do something
19:40 cdg joined
lizmat but I didn't get that to work: guess I still don't understand when the $!whence is being called 19:41
and I really should work on my slides :-) 19:42
19:44 cdg left
timotimo i wonder if you should perhaps install it as "is default" does it 19:44
19:46 Spot__ joined, rba__ joined 19:48 timeless joined, rba_ left
gfldex timotimo: doesn't work. The default value is just a fallback for the value in the container it seams. 19:52
lizmat yeah, that doesn't work
either we need to replace the container with a proxy, or do some $!whence magic
timotimo ah 19:53
19:54 OtherNick joined
moritz my $var := watched(); and then a sub watched that returns a Proxy 19:55
19:56 cdg joined
lizmat moritz: yes, but we were going for something syntactically less invasive 19:56
19:58 cdg_ joined, st_elmo left 20:01 rba_ joined, cdg left 20:03 rba__ left 20:09 pierre_ joined 20:13 pierre_ left 20:15 yqt joined 20:16 rba__ joined, yqt left 20:18 rba_ left 20:19 raschipi joined, emeric joined 20:24 setty1 left 20:28 cdg_ left 20:31 rba_ joined 20:34 rba__ left, g0d355__ left 20:35 Petit_Dejeuner left 20:36 DerAlex left 20:37 nadim joined 20:39 cdg joined 20:46 teatime joined, rba__ joined 20:48 rba_ left, llfourn left
teatime is trying to determine what perl6 thing, if any, is the perl6 equiv to nodejs's streams / object streams 20:49
supplies, I think...
20:51 Cabanossi left 20:52 Cabanossi joined 20:53 jjatria left 20:54 jjatria joined
teatime like... streams, pipes, coroutines, are equivalent, yeah? 20:55
20:55 Skarsnik left 21:01 rba_ joined
ugexe probably closer to a Channel 21:02
21:03 rba__ left
mspo promise? 21:04
lizmat and yet another Perl 6 Weekly hits the net: p6weekly.wordpress.com/2017/08/21/...ng-atomic/ 21:06
21:07 |oLa| joined, wamba left 21:08 skids left
raschipi yay lizmat++ 21:08
21:09 mcmillhj left 21:12 raschipi left
gfldex lizmat: s/if 0 if/of 0 if/ 21:12
lizmat gfldex++ 21:13
(fixed)
gfldex ohh, it's a weekly that's announcing a talk about weeklies โ€ฆ one more level of indirection :-> 21:15
lizmat
.oO( indirection is grossly overrated )
21:16
21:16 rba__ joined 21:19 OtherNick left, rba_ left 21:25 mcmillhj joined 21:27 emeric left 21:30 mcmillhj left 21:31 rba_ joined 21:34 rba__ left 21:36 Cabanossi left 21:37 jjatria left, Cabanossi joined
AlexDaniel lizmat++ 21:38
21:41 mcmillhj joined 21:42 MasterDuke left 21:46 mcmillhj left, rba__ joined
timotimo lizmat++ :) 21:46
21:47 Kyo91 left 21:49 rba_ left
ugexe ahem โš›+++ 21:56
timotimo yeah, better make sure none of the ++ go to waste 21:57
21:57 mcmillhj joined, nadim left, espadrine left
geekosaur ...lizmatom? :p 21:58
or is that the nuclear option? 21:59
lizmat hmmm liztormatomic :-) 22:01
22:01 rba_ joined 22:02 mcmillhj left
TEttinger there's โ˜ฃ 22:02
22:03 mcmillhj joined
lizmat .u โ˜ฃ 22:03
yoleaux U+2623 BIOHAZARD SIGN [So] (โ˜ฃ)
lizmat yeah, we're keeping that for the dirty work
22:03 rba__ left
lizmat perhaps "use MONKEY" should have a unicode counterpart: "use โ˜ฃ" 22:03
:-)
good night, #perl6! 22:04
TEttinger โ˜ข
.u โ˜ข 22:05
yoleaux U+2622 RADIOACTIVE SIGN [So] (โ˜ข)
22:07 mcmillhj left 22:10 rindolf left
timotimo so ... the spw, right? 22:11
there's a pre-workshop meetup. the description asks people to "add this to your personal schedule" so they know how many spots to reserve
except the software won't let me do that, nor does it show any other attendees
22:16 rba__ joined 22:18 sena_kun left, mcmillhj joined 22:19 rba_ left
cono m: class โ˜  { method state { "DEAD" } }; โ˜ .new.state.say 22:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse class definition
at <tmp>:1
------> 3class7โ5 โ˜  { method state { "DEAD" } }; โ˜ .new.st
expecting any of:
generic role
cono is there any way to create unicode class name? :) 22:22
.u โ˜  22:23
yoleaux U+2620 SKULL AND CROSSBONES [So] (โ˜ )
22:23 mcmillhj left, zoll joined 22:24 mcmillhj joined 22:29 mcmillhj left 22:31 rba_ joined 22:34 rba__ left 22:35 skids joined 22:38 cdg_ joined 22:40 mcmillhj joined
[Coke] unicode, sure. emoji, no. 22:41
22:41 cdg left, MasterDuke joined 22:43 cdg_ left
jnthn It'd have to something that matches \w+ to parse the usual way. Though you can probably do class ::('weird symboles here') { } to do it anyway 22:44
22:46 rba__ joined 22:48 mcmillhj left 22:49 rba_ left
Geth doc/master: 5 commits pushed by (Will "Coke" Coleda)++ 22:52
[Coke] m: class ::('๐Ÿ’€') { ... } ; 22:53
camelia 5===SORRY!5=== Error while compiling <tmp>
The following packages were stubbed but not defined:
๐Ÿ’€
at <tmp>:1
------> 3class ::('๐Ÿ’€') { ... } ;7โ5<EOL>
[Coke] m: class ::('๐Ÿ’€') { } ;
camelia ( no output )
cono heh 22:54
[Coke] m: class ::('๐Ÿ’€') { } ;say ๐Ÿ’€.new.^name;
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3class ::('๐Ÿ’€') { } ;say7โ5 ๐Ÿ’€.new.^name;
Bogus postfix
at <tmp>:1
------> 3class ::('๐Ÿ’€') { } ;say 7โ5๐Ÿ’€.new.^name;
expecting any of:
โ€ฆ
ugexe m: class ::("โ˜  ") { method state { "DEAD" } }; ::("โ˜ .").new.state.say 22:55
camelia Failed

Actually thrown at:
in block <unit> at <tmp> line 1
AlexDaniel I meanโ€ฆ 22:56
m: class term:<โ˜ > { method state { "DEAD" } }; term:<โ˜ >.new.state.say
camelia DEAD
AlexDaniel this works, butโ€ฆ
zoll Does the 12:54 error message complain about "skull" not having a "say" method?
23:01 rba_ joined 23:04 rba__ left 23:06 Cabanossi left 23:07 Cabanossi joined 23:09 pierre_ joined 23:10 pierre_ left, pierre_ joined 23:11 pierre_ left 23:15 ntinos left 23:16 ntinos joined 23:17 rba__ joined 23:18 rba_ left 23:21 notostraca joined 23:23 TEttinger left, raschipi joined 23:25 BenGoldberg joined, notostraca left 23:31 rba_ joined 23:33 rba__ left 23:36 TEttinger joined 23:45 ufobat left 23:46 rba__ joined 23:48 rba_ left
Xliff m: my %a = { 'A' => 1, 'B' => 2, 'cD' => 34, 'Ef' => 56 }; %a.keys => .lc; dd %a; 23:51
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3=> 1, 'B' => 2, 'cD' => 34, 'Ef' => 56 }7โ5; %a.keys => .lc; dd %a;
WARNINGS for <tmp>:
Uselesโ€ฆ
23:52 BenGoldberg left
AlexDaniel m: my %a = 'A' => 1, 'B' => 2, 'cD' => 34, 'Ef' => 56 23:58
camelia ( no output )
AlexDaniel or, if you insist 23:59
m: my %a = %('A' => 1, 'B' => 2, 'cD' => 34, 'Ef' => 56)
camelia ( no output )