»ö« 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.
shinobi-cl r: my @a is default(Nil); @a.append(1,2,3,Any,Nil,6); say @a.perl; my @b = @a; say @b.perl; 01:21
camelia [1, 2, 3, Any, Nil, 6]
[1, 2, 3, Any, Any, 6]
shinobi-cl Hmmm, interesting, the modifier sticks only to @a. That's to be expected anyway. 01:22
faraco hmm... 04:01
I'm not sure if this is only me, but I saw that in perl6.org (recent blog posts) section there is some repetitive typos (iniside) unless that was intended as a pun.. 04:02
faraco *shrugs*
adu what? 04:03
faraco I'm seeing this - i.imgur.com/0SO7RfC.png 04:05
adu faraco: are you refering to "in Perl 6"? 04:09
faraco No, I meant the 'Perl 6 iniside out'. Nevermind...I thought it is a part of perl6.org system. 04:11
leont I see Proc::Async has gained a merged output supply. 07:48
El_Che hi leont 07:49
leont Is that a real merged on a file descriptor level? 07:50
Of is that merged on a Supply level
El_Che I saw you forgot your fire protection on p5p :)
leont I did -_- 07:52
El_Che sunblock factor 50k 07:53
timotimo leont: it's merged at moar level, but it looks like it still creates two pipes rather than passing the same pipe for both 2nd and 3rd fileno 07:57
github.com/MoarVM/MoarVM/blob/mast...ops.c#L661 07:58
leont timotimo++ 07:59
timotimo it's on the spawner to decide whether stdout/stderr are buffered or not, right? 08:01
leont That is unfortunate. Makes is unusable for my purposes.
If they're different file descriptors, then the order of the moar-merged stream isn't necessarily the same as the order that data is written in. 08:02
Buffering can happen on both sides 08:03
timotimo can you give me a short one-liner that i can proc::async.new that'll tell me if stdout and stderr are the same underlying fd? 08:08
leont Not sure I can. On the child process they look like different FDs. 08:10
leont And p6 tries hard to hide platformy things like file descriptors 08:13
timotimo not terribly hard 08:14
github.com/rakudo/rakudo/blob/mast...ync.pm#L72 08:15
leont I see
timotimo i briefly tried to handle merge by just passing the same pipe to stdout and stderr, but that didn't seem to work, causes some HLL exceptions 08:16
don't have time right now to try doing it right 08:17
also, i'd like for it to be possible to give more FDs to a spawned process than just stdin/stdout/stderr
leont Yeah that can be useful 08:27
moritz yes, very useful for IPC 08:30
timotimo can you pass sockets over FDs only on unices or also on windows? 08:32
leont You mean passing FDs over sockets?
That's a unix thing AFAIK
Windows doesn't really have FDs, but handles, which are pointers except when they're not. They're weird. 08:33
moritz TBH, FDs are also pretty weird :-)
leont The file descriptions behind them are weird, but most of the time you don't need to think about those. 08:38
faraco camelia: 'hello'.say 09:12
faraco p6: 'hello'.say 09:13
camelia hello
moritz faraco: re misspellings, those blog posts are by andrew shitov
though the typo seems to be somewhere else 09:14
yes, my fault: github.com/stmuk/pl6anet.org/commi...7fe8451a5e 09:15
faraco moritz: Ah, I see.
moritz github.com/stmuk/pl6anet.org/pull/9 09:16
stmuk_: ^^ sorry for the noise
stmuk_ moritz: no worries! merged & deployed :) 10:18
moritz stmuk_: thanks 10:19
buggable New CPAN upload: App-Platform-0.2.1.tar.gz by KAJI cpan.metacpan.org/authors/id/K/KA/...2.1.tar.gz 11:12
masak today's autopun spotting: twitter.com/vgr/status/952442493001285632 15:16
buggable New CPAN upload: P5tie-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 16:22
lizmat aka Perl 5 tie() for scalars, arrays and hashes 16:23
Geth doc: 9dff74fe1b | (Luca Ferrari)++ | doc/Type/Version.pod6
Add crosslink to 'v (version)' to point to type Version.

Close #1732.
16:54
synopsebot Link: doc.perl6.org/type/Version
El_Che lizmat: is P5 in the name a good idea? 17:08
lizmat what would you suggest ?
El_Che lizmat: it feels like it put limits to the implementation and the expiration date 17:09
lizmat well, that's the intent
El_Che why?
(if it's the intent, the name is right)
lizmat I would not recommend using tie() in new Perl 6 code: there are better ways of doing that 17:10
this is intended to make it easier to port stuff over from Perl 5
El_Che ok, than it sounds ok 17:11
the censor approves :)
lizmat thanks the censor
El_Che connection on the train seems spotty today 17:12
lizmat doesn't notice it
TimToady note that a tie might cause lack of optimization in some cases
much like if we notice an EVAL 17:13
El_Che so, you plan to implement P5threds.pm6 and p5CGI.pm6?
lizmat P5threads no
p5CGI not sure yet
TimToady and if we can't detect that a tie is going to make optimizaiton impossible, we'll probably go ahead and do the optimization and break the tie, so to speak 17:14
El_Che I get the pratical use case, but I wonder if people are poritng their perl5 code to perl6 and if they are, I wonder if it would be straightforward because perl6 offers a lot of improvements 17:15
TimToady at least, that was the thinking a decade ago when we were deciding not to put tie into the language... :)
lizmat P5tie is *not* about having code that executes in an optimal way, it is about lowering the threshold of porting Perl 5 code to Perl 6 17:16
TimToady nod 17:17
lizmat dinner& 17:18
El_Che would suggest P5tieFighter to lizmat 17:22
scimon Feeling happy about the progress I've made with Test::HTTP::Server this afternoon. Hopefully get some more work done on it this evening. 17:26
El_Che scimon: what does it do? 17:27
scimon It's intended to make testing things that make HTTP requests simple.
El_Che sounds useful 17:28
scimon By wrapping HTTP::Server::Async and adding some logging.
That you can check in tests.
scimon I was looking at picking up WWW::Mechanize and realised I wanted something to do that. 17:28
pmurias lizmat: wouldn't a :: separated name be better? (like maybe Perl5::Tie?) 17:29
scimon Once I've got a bit more done I'll let people kick it and see how it goes.
off now.
El_Che pmurias: I was thinking the same 17:30
or rather P5Porting:Tie
otherwise it may be confused with real Perl 5 modules, eg. used with Inline::Perl5
lizmat scimon: have you looked at Cro::HTTP::Client ? 18:08
El_Che: well, first of all, P5tie is about the tie() builtin, so it's not a module in Perl 5 18:09
pmurias: we haven't done the Perl5:: prefix for other modules either 18:10
in time, I guess these modules will be moved to an organisation, which you could then refer to in your -use- statement 18:11
buggable New CPAN upload: P5tie-0.0.2.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.2.tar.gz 19:22
newnick1 Hi. 19:43
How could one read command line arguments in Perl 6? 19:44
I want to treat them just as an array of tokens instead of named parameters.
timotimo try @*ARGS 19:45
newnick1 Could you please show me how to extract argument by index and get number of elements? I wrote sub MAIN() { say @*ARGS.elems; say @*ARGS[0]; } 19:49
but it doesn't work.
timotimo right, it won't run MAIN() if you have more than 0 arguments, because the signature wouldn't match 19:53
you can give the sub main a signature that will accept anything, like sub MAIN(*@, *%) or you could just not use MAIN at all
newnick1 And how to write signature of MAIN that would accept 0 or more args?
timotimo i've gotta take my RSI rest break, TTYL
timotimo m: sub MAIN(*@, *%) { say "yo" }; MAIN(); MAIN(1, 2, 3); MAIN(9, 9, :foo) 19:54
camelia yo
yo
yo
yo
as_ rakudo: say UInt64.Range; 19:55
camelia -Inf^..^Inf
newnick1 Is it possible to iterate args in loop?
timotimo of course, @*ARGS is just an array of string-likes 20:05
scimon lizmat: I'm loathe to use the Cro stuff until it can install with tests. I'm 100% looking forward to it being stable :) but until then I'd like to not have to rely it. 20:14
timotimo m: say @*ARGS.perl 20:15
camelia []
timotimo hm, we don't have a way to tell camelia to give the script some arguments
so can't really demonstrate 20:16
lizmat timotimo: BEGIN @ARGS= () ??
newnick1 @timotimo, so it's not possible with Perl 6?
timotimo it definitely is possible 20:17
newnick1 Just wanted to iterate over arguments in loop.
Very simple use case.
timotimo just do "for @*ARGS -> $argument { say "$argument is an argument" }
newnick1 Is it possible to put it inside MAIN with appropriate signature? 20:18
sub main(<something>) { ...
MAIN
timotimo that's possible, too, but .. hold on, phone
jnthn scimon: Cro::HTTP, which is the bit you'd need to depend on, has done that fine for a good while 20:22
jnthn The only remaining sometimes-fail I'm aware of is in the development tools 20:23
scimon I can always switch between them :) No offence intended jnthn, like I say it's an amazing bit of kit and I'm really looking forward to the .8 release. 20:24
jnthn None taken. :-) Just pointing out the piece you'd need is one of the stabler bits. :-) 20:25
scimon Cool :) 20:26
lichtkind is pierre viegier here? 20:28
newnick1 @timotimo, I'm sorry, could you please elaborate on example?
scimon github.com/Scimon/p6-Test-HTTP-Server So here's the thing I'm working on. Idea if you point it at a folder and it's server up files in it. Also plan is to have a config.yml file that lets you define paths with special responses (like 500 errors etc). Idea is to make it very simple to setup tests. 20:48
scimon But now I'm signing off to read some Malory. Night all. 20:50
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2018/01/15/...blue-note/ 20:56
leont :-) 21:16
moritz lizmat++ 21:18
pmurias lizmat++ # the weekly makes keeping track of rakudo community a lot easier 21:42
El_Che news.ycombinator.com/item?id=15961031 <-- interesting comment in your weekly. Pretty relevant voor perl6 22:04
lizmat: kudos for the new section of the news letter 22:05
lizmat thanks :-)
gladly accepting links to wherever this is also occurring :-) 22:06
for inclusion in the P6W
El_Che I will certainly keep that in mind
lizmat thanks in advance!
El_Che are you strictly interested in perl 6 mentions or can it be widers? 22:07
lizmat it at least has to mention Perl 6
El_Che I saw a blog this week about how seclang was struggling due to intel vulnerabilities
ok
it makes sense
lizmat news.ycombinator.com/item?id=16153455 # will be in next weeks 22:08
it doesn't mention Perl 6 directly, but indirectly
that would also be ok for me
El_Che I agree so much with this (working on devops envs): "People flock to Go not only because of its performance, but because it can be easily deployed, and deployment isn't something even on Ruby's Roadmap." 22:09
timotimo pff, now we have docker everything's trivial to deploy! just ship a whole linux with it!
El_Che no it's not
timotimo i meant /s
El_Che golang on alpine is orders of magnitude easier and faster to build on docker than all other languages 22:10
I need to stick to centos for my perl 5 projects
thx $deity for docker specially for perl 5 on 6 22:11
without it it could be pretty hopeless
but even then deployment is hard
(CPAN is a lot saner than the gem environment, it must be said though) 22:12
upgrading the gems of a ruby project is hard
(you still need to manage that even with Docker)
timotimo right, but as JS has taught us, you just keep local versions of everything with your code 22:15
El_Che yes, you do that in golang as well. But for security reason you need to update your stack
timotimo right 22:16
El_Che and in my experience things seem to blow up more often with gems than with cpan
mspo gem bad 22:24
timotimo i'll go into your basement and steal all your rubies and gems 22:25
El_Che you'll find only Rust
Although Julia may be there 22:26
Be careful for the Python
timotimo if anybody wants a slang idea for something really simple, why not implement ruby's ?a syntax for single character strings (?a would be "a", for example) 22:44
lizmat timotimo: how would that work with: my \a = 42; ?a 22:45
timotimo well, you wouldn't use the ? character 22:49
lizmat hehe, ok, fair enough :-)
timotimo but i'd expect longest token matching to prefer ?a as "a" 22:51
buggable New CPAN upload: P5tie-0.0.3.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.3.tar.gz 22:52
lizmat apparently, if you pass a string to a precompiled module that is the name of another precompiled module, then ::() won't find it 22:53
timotimo is that a compile-time/run-time difference? 22:54
lizmat feels to me, yes
or compunit scope maybe
if the class is in the compunit of the caller, then ::() can find it 22:55
timotimo like, how do you pass it? does the passee know the string early enough?
lizmat I found this when implementing Tie::Array, a subclassable class that performs the tie() interface using a normal array
the logic in tie could not find it 22:56
I'll try to golf it down
and make an issue :-) 22:57
meanwhile, disallowing classes to be specified as a string, fixes the issue
if you have a string, then you will need to do the ::() yourself :-)
Garland_g[m] Is there a way to take an 'is rw' class attribute, and run a bit of code whenever it's modified by assignment? 23:00
Zoffix Garland_g[m]: yeah, just bind a Proxy object (or use Proxee module that's a more plished Proxy). Middle of "Coercers" section has an example of coercing to Int on assignment: github.com/zoffixznet/perl6-Proxee#synopsis 23:04
Garland_g[m]: in the future, it'll be possible to bind a Proxy to the attribute directly, instead of using `submethod TWEAK` for that purpose. 23:05
Zoffix huggable: Proxy 23:05
huggable Zoffix, Item container with custom storage and retrieval: docs.perl6.org/type/Proxy
Zoffix ^ that's the core version of Proxy
Garland_g[m] Thanks. 23:06