»ö« 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.
andrzejku hi guys 06:32
andrzejku do you think Perl6 is good for machine learning? 06:32
or it is too slow
moritz I think you want a core written in C for machine learning 06:32
even if you do it in a faster language such as python
moritz wonders how well tensorflow works with Inline::Python 06:33
andrzejku moritz: ye what I saw many machine learning and ai courses show things in python
anyway I hate C :D 06:34
this is too primitive language
samcv ;_; C is not that bad. but for machine learning sounds like a lot of work. idk do you mean writing machine learning code. or writing the whole machine learning framework... 06:40
very different those two things
andrzejku samcv: I want to start from code 06:42
just to play 06:43
Voldenet hmm, C is not that different from python 06:45
but memory allocation in C is terrible
andrzejku I am more C++ developer 06:46
however I am bad developer and alzy :P
and what I need to say writing all these mem****
tadzik metacpan.org/pod/AI::NaiveBayes should be an easy port to p6 if you want to toy around
andrzejku and size* 06:47
it idiot thing
Voldenet Frodo: "Speak 'segfault' and exit. What's the linux word for segfault?" Gandalf: "Malloc!" 06:48
tadzik %)
kurahaupo__ andrzejk_: you're looking at it as if it were a dialect of C++. A better perspective would be to consider it a smarter version of assembly language 06:50
tadzik just treat each * as another layer in the stack of map<string, vector<map<string, int>>> ;) 06:51
Voldenet kurahaupo__: C can be a wonderful language, but one would need to write a lot of low-level stuff to start high-level stuff
kurahaupo__ Voldenet: agreed
Voldenet asm can't be a wonderful language
ever
you can't get very comfy with its features or syntax
it's the language that can't really help you anyhow, but is ready to punch you in the face in case you're doing something wrong 06:53
Voldenet a propos C, is there any option to do this with perl6? perldoc.perl.org/perlembed.html#Add...-C-program 07:28
moritz there must be, because somehow Inline::Perl6 (Perl 5 module) works 07:29
Voldenet st.aticpan.org/source/NINE/Inline-...8/Perl6.xs 07:32
golden egg found ;)
El_Che tha way my shell tells me I've done too much perl6: "No command 'perl5' found, did you mean: ..." 07:42
masak at that point, I'd set up an alias or a symlink 07:43
Voldenet El_Che: haha, happens for me too 07:53
timotimo moritz: i was under the impression that no serious machine learning was done off of the gpu, and so C isn't what you want at all? 08:28
moritz timotimo: you really want something with pluggable backends, so that you can test on your dev machine, and then run on GPUs in production 08:30
timotimo your dev machine doesn't have a gpu? :)
jast depends very much on the structure of your problem. if you need to process a lot of data continuously, for instance, shoveling it between CPU and GPU adds a lot of overhead, plus not all classes of algorithms are easily vectorized
jast for the same reason, it can make sense to do pre-processing on the CPU and push things through your model on the GPU, to avoid one round trip 08:31
timotimo is OpenCL-on-CPU common for things that don't benefit a lot from the gpu? 08:33
jast I'm not really up-to-date on the performance side of things. I guess the only reason to do that is to simplify your code, do everything using the same API 08:34
timotimo mhm
except nobody uses OpenCL and everybody uses cuda for some reason
jast don't ask me why 08:36
timotimo they rushed to market and have some extra tools or something
jast if I wanted extra tools I'd use Java
gfldex anybody here who managed to use api.travis-ci.org to sync the repo list with github? 08:47
timotimo and QSharedPointer 08:47
oh, wrong window
pistacchio hi, i'm having trouble with grammars. how do i match "any text till an optional space optionally followed by any text till a new line?" this is what i'm trying: glot.io/snippets/eohyruz8wd 09:53
moritz \N*\n 10:09
or rather \N* $$ 10:10
jnthn I think the problem is that your token doesn't seem to be matching the space anywhere
jnthn ' '? would be an optional space 10:11
moritz unless there's a constraint somewhere that the "any text" may not contain spaces
pistacchio so, why does the space require being specified between path and regex but not between recursive and path? 10:13
also
{ ^^ <recursive>? <path> (\s+ <rgx>)? }
this
still greps "regex" as part of path
jnthn Because path is \N+ which means "not a newline" 10:15
Try \S+ instead
pistacchio now i get Nil 10:18
glot.io/snippets/eohzibv3zh
jnthn 'cus you aren't matching the space after the * at the start, and before the path 10:22
Try a \s+ after the <recursive>?
Or \s* maybe, dunno how the output looks :)
uh, input
(In the general case, I mean)
Also, you may find a module like Grammar::Tracer useful in helping figure out where grammars fail to match 10:23
Ulti with the version pragmas if you give nothing at all is the implication latest language feature set? 10:50
at least latest stable
jnthn Ulti: Yes
Ulti sighs relief from imagining Perl 5 feature hell 10:51
which is increasingly less hellish in fairness 10:52
Ulti things moving from experimental or getting properly thrown away is kind of great in the last couple of releases 10:53
Geth ecosystem: 7ojo++ created pull request #313:
Add Platform to ecosystem
11:46
ecosystem: a678423ed2 | (Jarkko Haapalainen)++ | META.list
Add Platform to ecosystem

See github.com/7ojo/perl6-platform
11:47
ecosystem: d020ee2150 | (Carl Mäsak)++ | META.list
Merge pull request #313 from 7ojo/patch-1

Add Platform to ecosystem
araraloren How can I access argv[0] passed by C function execlp (man 3 execlp), $*PROGRAM-NAME is not what i want, seems like it always script name. 13:14
jnthn Maybe $*EXECUTABLE 13:16
(If you're not expecting the script name, I'm guessing you are after the Perl 6 interpreter name?) 13:17
raschipi "man perl6" doesn't have enough hype. 13:18
araraloren jnthn, No, It is the first argument as argv[0] in **C** ( int main(int argc, char* argv[]) ), I use execlp('p6script-path', 'argv[0]', ..., NULL) execute p6 script 13:31
I print $*PROGRAM-NAME out, it always script name, not "argv[0]" which passed by use execlp 13:32
jnthn araraloren: If it's not one of those two, then no idea. perl6 is actually a shell script that invokes the VM; I note in that script it does my $tag = "Upload $!ids.pull-one()"; $!output.debug($tag, "Starting $local-path -> $user\@$host:$remote-path"); 13:38
oops
I note in that script it does --execname="$0" 13:39
And I think that's what ends up in $*EXECUTABLE
araraloren jnthn, A little understand, and I also tried python and perl5, no idea get that value. 13:49
Fortunately, we almostly not need that
raschipi What do expect to find? 13:52
mls seems like there's no way to get that value from the shell
timotimo when you execlp, is there even a shell involved? 13:53
mls yes, that little /usr/bin/perl6 shell script
the problem is that $0 in the shell is not argv[0], but set to the name of the script 13:54
i.e. it's always /usr/bin/perl6 or something like that 13:55
jnthn Aha 13:56
So short of us moving away from having the shell script, there's probably not a fix?
araraloren $*PORGRAM-NAME is $0 in perl5
mls I don't think there is. I glanced through the bash source, and I don't think there's a way to access argv[0] 13:57
huf what's $0? 13:58
araraloren It's no idea, maybe ..
raschipi The irst word in the system call that executes the program.
huf oh, $0 is compromised :)
raschipi first*
pmurias if EN QUAD is canonicall equivalent to EN SPACE MoarVM just turns it into that? 14:00
timotimo i believe so? 14:03
i know you can't trip up perl6ers with the greek question mark
mls hmm, I can't access argv[0] from perl5 and python as well. They all clobber it with the script name 14:12
so perl6 is not that different ;)
raschipi I think this i an XY problem, to be honest. 14:13
timotimo feels a little bit like that 14:14
[Coke] pmurias: if you look up GREEK QUESTION MARK - whatever flag that has that turns it into a semicolon, that should work for other chars too 14:19
[Coke] m: "\c[EN QUAD]".uninames.say 14:20
camelia (EN SPACE)
[Coke] ... is there a way to get the uninames from a codepoint? 14:23
timotimo of course
m: say 0xff12.uniname
camelia FULLWIDTH DIGIT TWO
[Coke] (is there ever a way to get GREEK QUESTION MARK back as the response? Not with a Str..) 14:24
timotimo: danke.
timotimo there were speculations about Str objects that don't have NFG in them 14:25
and by speculation i don't mean back when we were writing the specs
pmurias m: "\c[GREEK QUESTION MARK]".uninames.say 14:25
camelia (SEMICOLON)
mls (to wrap up the $0 issue: actually it's the kernel that drops argv[0] for #! scripts.) 14:28
[Coke] m: "\c[HEBREW LIGATURE YIDDISH YOD YOD PATAH]".uninames.say
camelia (HEBREW LIGATURE YIDDISH DOUBLE YOD HEBREW POINT PATAH)
raschipi When we have pre-compiled binaries, we can add a binfmt in linux and have it not use the #! mechanism to execute Moar bytecode, even though it's not in ELF format. The same is usually already configured for the JVM in distros. 14:43
ilmari m: my $¢ = 42 14:44
camelia Potential difficulties:
Redeclaration of symbol '$¢'
at <tmp>:1
------> 3my $¢7⏏5 = 42
ilmari m: say $¢ = 42 14:45
camelia 42
ilmari huh
raschipi m: say $¢.WHAT 14:46
camelia Nil
ilmari m: say $¥ = 42
camelia 5===SORRY!5=== Error while compiling <tmp>
Name must begin with alphabetic character
at <tmp>:1
------> 3say $7⏏5¥ = 42
expecting any of:
infix
infix stopper
postfix
statement end
s…
raschipi m: say dd $¢
camelia Nil $¢ = Nil
Nil
ilmari ¢ is just as litte an alphabetic as ¥ is (they're both Symbol, Currency) 14:47
raschipi The first one is apparently defined by the interpreter, it has no problems defining puntuation variables. 14:48
ilmari oh, + '$¢' in grammars now refers to the current cursor 14:50
timotimo yup
that's a changelog entry? must be from 2013 or earlier
ilmari since 2015.09
timotimo wow, that late?
ilmari the docs.perl6.org search doesn't find it 14:51
timotimo time for a doc ticket 14:54
[Coke] I think someone just recently opened a ticket for $¢ 14:58
timotimo a doc ticket, i assume?
[Coke] yes 15:02
github.com/perl6/doc/issues/1262 15:03
raschipi I think the most surprising thing abou P6 is this: my @a := 1 but Positional; 15:08
gfldex it seams that a .tap on an Proc::Async is sensitive to malformed utf-8. Is there a way to tell it not to? 16:16
a try inside the tapping block does not catch it
:bin does not help 16:20
gfldex :enc<utf8-c8> segfaults 16:25
:enc<latin-1> seams to work
andrei9999 hi, I am a beginner. I want to learn the use of ARGFILES 16:26
raschipi gfldex: I'm curious to know if it's doing some kind of normalization on the stream? Is it stuffing things into a Str or giving you a Buf to deal with? 16:27
andrei9999 when I say my $x = $*ARGFILES.path
andrei9999 the compiler refuses, says No such method 'IO' for invocant of type 'Any' 16:27
gfldex i'm using `$s.stdout.lines.tap: { .say }` so it must parse as Str to get the lines. 16:28
andrei9999 but according to the manual ARGFILES extends IO::Handle which must have method path() ...
raschipi gfldex: There's two places it could be failing due to malformed UTF-8: when it receives the Buf or when it normalizes it into the Str 16:29
gfldex andrei9999: with an empty $*ARGFILES it defaults to Any, not an empty list of IO::Handle 16:31
andrei9999: try $*ARGFILES.?path
gfldex raschipi: if you want to toy with it you need a malformed filename and the following code github.com/gfldex/perl6-proc-async...e/basic.p6 16:33
raschipi I was toying with it the other day, using this file: www.cl.cam.ac.uk/~mgk25/ucs/example...8-test.txt 16:37
Zoffix andrei9999: ARGFILES is unpolished ATM. Ignore that it inherits from IO::Path, it does it poorly. It doesn't set `.path`. You can what files were loaded by dumping @*ARGS 16:46
andrei9999: eof, get, lines, slurp, nl-in on is it all you can reliably use on it ATM and it'll very likely be replaced with IO::Cat in the next language version that properly inherits from IO::Handle with methods that don't make sense not being there. 16:48
Zoffix IO::Handle.lock() is not part of the language ATM and the Int:D argument from Rakudo's impl. is going await. Don't use it. 16:50
andrei9999 What does abbreviation ATM mean? 16:52
Zoffix andrei9999: At The Moment 16:53
raschipi Automated teller machine
andrei9999 Thank you, I think I got it. What is the nearest analogue of Perl5 perl -pi.bak -e'...' filename.txt ? 16:54
Zoffix andrei9999: that "moment" being until the end of April, with the polished version available to be available under v6.d.PREVIEW afterwards (until v6.d release, which is when it'll be the default)
andrei9999: don't think we have the -i switch yet. I'd write it as perl6 -e 'for @*ARGS { "$_.bak".IO.spurt: .IO.slurp; .IO.spurt: .IO.slurp.subst(/^^...$$/, "blah") }' filename.txt 16:56
+ :g in .subst :) 16:57
andrei9999 I understand, thanks so much!
Zoffix andrei9999: oh, no need for slurp/spurt we have copy :)
andrei9999 copy $_ $_.bak ?
Zoffix andrei9999: don't think we have the -i switch yet. I'd write it as perl6 -e 'for @*ARGS».IO { .copy: "$_.bak"; .spurt: .slurp.subst(:g, /^^...$$/, "blah") }' filename.txt 16:58
^ that
andrei9999 beautiful! 16:59
yes, it works, thank you 17:01
Zoffix Cool.
One day, we'll add -i so it'll be shorter :)
Zoffix part
raschipi Zoffix IRC->twitter bridge is working. 17:03
tbrowder hey, #perl6 17:45
raschipi hi tbrowder 17:48
tbrowder i just pushed a new mod to github using the .travis.yml i use for other modules and got a problem: "- panda installdeps ." didn't install the test-depends "File::Temp", i had to add "- panda install File::Temp". can we now use zef without extra install steps? if so, hopefully it will do the "right thing"
hello, raschipi 17:49
gfldex tbrowder: this works for me github.com/gfldex/perl6-proc-async...travis.yml 17:50
tbrowder gfldex: does it install all your dependencies including test-depends? 17:52
tbrowder i'll try it anyhow--glad to see panda out of the travis requirements 17:53
tbrowder gfldex: thanks, works for me, too. however, it looks like there was some test duplication since i see the module in question being tested twice. i'm trying a slightly different approach after looking at the zef options--will report. 18:22
raschipi People with Autism, I want to send a message to you: you are appeciated and the world is better because of oyu. 18:24
geekosaur appreciated 18:36
tbrowder gfldex: aha, i'm correct. here is my latest .travis.yml: <github.com/tbrowder/Proc-More-Perl...is.yml> 19:48
tbrowder the difference is, as far as i can tell, is that "- zef install ." does a normal installation which fully tests the module, but then the master build script then runs the command "PERL6LIB=lib prove -v -r --exec=perl6 t/" which runs the module's tests again. when I instead use "- zef install --depsonly ." zef quits after testing and installing only the 19:54
module's dependencies, so the module's tests get run only at the end buy the build script, thus saving a minuscule amount of time and energy.
s/buy/by/
gfldex tbrowder: please note that installing from the ecosystem is no the same as `git pull; zef install .` as I had to learn the hard way. 19:57
tbrowder: i solved this problem and bitrot testing as described here gfldex.wordpress.com/2017/01/20/once-a-week/ 19:58
gfldex i should add a meta.t 20:01
tbrowder okay, but i don't use the Build command, so i guess my work flow is different. i did see yr blog but didn't look very closely because i don't use build or cron. I do all development on my master branch and try to keep the travis build passing. i make separate releases that are used by the ecosystem and zef, and I ensure they are passing before release. 20:06
@ugexe suggested that and it has worked well. no regular user should find my tests not working if using zef with the ecosystem. what i haven't done is add a warning to my all my READMEs NOT to clone my module repos unless you want to help development. normal users should just "zef install Tbrowders::ModuleX".
s/my all my/all my/ 20:08
gfldex you can tell a travis cron job to build a given branch, what might help to spot bitrot
tbrowder well, as i said i am always on the master branch and ensure that last commit passes before cutting a release. only releases are put in the ecosystem, so they are insulated from continuing development until the next release. 20:10
tbrowder so there should be no bitrot on a release, just lurking bugs which the user should report if he finds one. 20:11
gfldex travis is testing with bleeding rakudo. Bitrot rare originates from the code it hits. 20:15
what also means we should test against latest star as well 20:16
andrei9999 About string quoting. The Japanese angular brackets #xff62 and #xff63 --- what exactly do they do? It seems that they transform ' into the word quote . is that right? how to insert absolutely literally ? 20:24
gfldex andrei9999: see docs.perl6.org/language/quoting#Li...strings:_Q 20:25
andrei9999 Sorry, that was my confusion... 20:31
andrei9999 In fact, it works perfectly 20:33
Geth doc: 8330d72243 | (Tom Browder)++ | doc/Language/io.pod6
add info on other file routines

also add simple example and links to more detailed docs
20:44
tbrowder gfldex: you're right of course, i didn't think of changes in rakudo! i'll go study yr blog more closely. 20:47
Geth doc: 8ae1298845 | (Tom Browder)++ | doc/Language/io.pod6
move file copy. etc., to a more appropriate place
21:12
Geth doc: 2e7b007127 | (Tom Browder)++ | doc/Language/io.pod6
use file-consistent heading format
21:23
Geth doc: a01a18e4d6 | (Tom Browder)++ | doc/Language/io.pod6
move copy chunk again, tidy comments
21:38
gfldex ugexe: i wonder if zef should honor .gitignore while installing binaries 21:54
travis-ci Doc build passed. Tom Browder 'move copy chunk again, tidy comments' 22:17
travis-ci.org/perl6/doc/builds/217353909 github.com/perl6/doc/compare/2e7b0...1a18e4d6e6
maxp_ A very simple question... The extension of perl6 program must be .pl, .p6 or .pl6? Because in the examples and docs there are 3 different extensions. 22:23
And for modules? .pm or .pm6?
AlexDaniel maxp_: .pl and .pm are perhaps not the best choice because perl5 is using them 22:24
AlexDaniel maxp_: .p6 and .pm6 works fine, .pl6 is not bad also 22:24
AlexDaniel maxp_: there was a discussion about this here: github.com/perl6/doc/issues/778 22:26
maxp_ ok thank you very much 22:27
ugexe gfldex: .gitignore is not part of a perl6 distribution 22:29
its not really difficult to do with a regular distribution object: 22:32
my $dist = Distribution::Path.new($*CWD) but role :: { method meta { my %meta = callsame(); %meta<files> = grep { $_.key !~~ /\.pm6$/ }, %meta<files>.hash; %meta; }; }; say $dist.meta<files>
gfldex ugexe: I ended up with a .swp in a /bin/ and that should not go there. We don't got that problem with modules because those are listed in the META6.info. But for binaries we do a fetch all. 22:34
ugexe you could end up with a .swp for non-git directories too though 22:41
ugexe if bin/ could only contain perl6 code it could give us a much better filter at least, as I suppose we could just try to compile each file in bin/ 23:02
gfldex a .swp would most likely compile :) 23:03
timotimo gfldex: i'm surprised it'd explode with encoding trouble; what version of rakudo and moarvm are you on for that, and can you paste code that reproduces it? like, can i just Proc::Async a cat on /dev/urandom or something?
ugexe heh good point
gfldex timotimo: i'm using bleeding. I need to think about a way to reproduce as the invalid utf-8. It's in a filename (that I keep around to trigger such bugs). 23:05
gfldex tar tends to be helpful when it comes to screw up file systems 23:06
I'm required to be at work tomorrow but likely wont have much work to do. Plenty of time to think.
timotimo understood 23:09
i'll head towards bed now, seeya!
AlexDaniel 23:50
yes, writing a small web scraper in perl 6 was a horrible idea… 23:51
BenGoldberg Why? 23:52
AlexDaniel oh wait, maybe if I run(‘curl’, …) instead of using HTTP::UserAgent it will stop leaking 20MB per fetched page 23:52
BenGoldberg: I've been banging my head against RT #131003 for a while, then I decided to switch to python-gumbo (through Inline::Python), and that works fine, except that just downloading something leaks memory (without even parsing) 23:54
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131003
AlexDaniel if run(‘curl’, …) doesn't fix it so that I can go through least 200 pages, I give up 23:55
at
or… I don't know… might save the state and rerun the whole thing. Who cares about added startup delay, at least it will finish my thing 23:57