»ö« 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.
timotimo if you don't close-stdin before await $promise, it'll block forever, definitely 00:00
samcv yes i know that
that's just for this test script :)
timotimo ok 00:01
samcv autoflush isn't on docs.perl6.org where can i read about it 00:01
timotimo it's not a perl6 thing
it's a perl5 thing
you can strace the whole thing to see if things actually get written from the child process
samcv ah. :P
well. things do get written. in other thing i'm using proc async for, after like minutes it will get the message 00:02
timotimo so it's going through a buffer?
pipes for inter-process communication are generally buffered
samcv is it a pipe if it launches the perl process itself?
it's not right? 00:03
timotimo what else would it be? 00:07
samcv oh you don't mean a shell pipe. just perl 6 doing it. 00:10
if i do this vpaste.net/n0suV with asynctest.pl being this vpaste.net/u36I2 00:11
if i do it 1000 times it will start getting after a few hundred times. timotimo is there a way to get around my issue? 00:12
timotimo sorry, i didn't pay attention 00:13
well, perl6 will immediately give you bytes when they arrive 00:14
did you try autoflush? or maybe there's something like an unbuffered mode for stdio? 00:15
i'll be driving car in a few minutes from now, after that i'll probably be able to try your code 00:17
samcv ah that seemed to help timotimo. i guess it's behaving differently when run on the command line versus launched by perl 6
samcv this i think is what the problem must have been :) let me try it out in the actual thing i'm working on 00:18
timotimo well, i expect stdout provided to the program by your shell to be somewhat unbuffered
not sure how that's controllable
oh, the difference si between pipe and tty
anyway, BBL 00:20
samcv yes it works :) 00:20
samcv i did $|=1 in perl 5 and it works great 00:21
tony-o did something happen with use *:auth ? 00:54
Success hai guiysz 03:48
gfldex m: say 'ohai Success!'; 03:53
camelia rakudo-moar f5bf6c: OUTPUT«ohai Success!␤»
Success so are there any proof of concept language spoofing (etc. custom operators & functions) making perl6 look like other languages? 03:54
gfldex Success: see modules.perl6.org/#q=slang 03:55
also mouq.github.io/slangs.html 03:56
Success i find that sql one hallarious 03:57
gfldex it's a proof of concept. A proper slang would support $foo and { 5 + 5 } style interpolation 04:00
Success thats still really entertaining haha thnx m8 04:03
raiph Success: www.youtube.com/watch?v=Nq2HkAYbG5...p;t=25m37s 04:16
Success btw im not actually very uh 04:25
yeah no perl6 spins my head right around and that video did not help
it simultanious does nothing, everything and anything all at once and its so like wot
seatek is someone mucking about with search on modules.perl6.org right now? can't seem to search
Success its like quantum mechanics as a programming language
seatek hmm now it's working 04:26
gfldex seatek: works for me. You may want to ctrl-[reload] 04:27
seatek gfldex: yeah maybe it was my browser. typed in http and it seems to match everything 04:29
raiph .msg camelia m: say: # Success 04:49
yoleaux raiph: Sorry, this command is admin-only.
raiph Success: I gotta go. Hope the video wasn't *too* bad. :) Goodnight #perl6 04:52
Success when i said it was bad i meant i love it lol 05:41
AlexDaniel committable6, HEAD await IO::Socket::Async.connect("260​0:3c03::f03c:91ff:fe91:d028", 80).then: -> $p { if $p.status { given $p.result { .print: "GET / HTTP/1.0\n\n"; react { whenever .Supply { .say } } } } } 07:07
committable6 AlexDaniel, ¦«HEAD»: Failed to resolve host name␤ in block <unit> at /tmp/Hw_y7drOtI line 1␤ «exit code = 1»
AlexDaniel viki: I have no idea why it didn't work previously
moritz \o 07:54
moritz just found out that python's built in regex engine can't much Unicode properties :( 07:55
*match
arnsholt Aww. Sad panda 07:58
moritz sad snake :-) 07:59
arnsholt =D 08:00
TEttinger moritz: python 2 or 3? 08:02
that's surprising for 3 08:03
moritz TEttinger: 3 08:07
well, both, I thikn
TEttinger yeah, 2 barely had any unicode work done in it IIRC
it is pretty bad that 3 is missing that 08:08
geekosaur you;d think they would have used pcre with unicode support enabled 08:12
geekosaur although maybe they do and it's a packager error; I seem to recall debian had a few issues along those lines (and are adamant about not using bundled versions of anything they already package, so python wouldn't be allowed to be packaged with its own unicode-enabled pcre but would have to use the existing package whether it's unicode or not) 08:14
geekosaur (this being one of those areas where, while I am sympathetic to their intent, they're really shooting themselves in the foot by being hardline about it. MATE had the same issue, since upgraded/rebranded versions of gnome2 libs that debian already packaged) 08:15
timotimo python has its completely own regex engine, doesn't it? 10:42
masak timotimo: in Lib/re.py, there's a comment at the top saying "Secret Labs' Regular Expression Engine" 10:46
timotimo right. perfect :) 10:47
masak looks like 2k LoC in total
dalek c: 4199726 | (Zoffix Znet)++ | doc/Type/Iterator.pod6:
Document Iterator.skip-one
14:00
synopsebot6 Link: doc.perl6.org/type/Iterator
dalek c: 5b45f44 | (Zoffix Znet)++ | doc/Type/Iterator.pod6:
Document Iterator.skip-at-least
14:25
synopsebot6 Link: doc.perl6.org/type/Iterator
c: f504791 | (Zoffix Znet)++ | doc/Type/Iterator.pod6:
Fix typo
14:29
synopsebot6 Link: doc.perl6.org/type/Iterator
dalek c: a7a0a91 | (Zoffix Znet)++ | doc/Type/Iterator.pod6:
Document Iterator.skip-at-least-pull-one
14:32
synopsebot6 Link: doc.perl6.org/type/Iterator
brrt know what I heard? that folks not following perl6 actively are still having it pop up on the radar 16:34
timotimo that's good! 16:37
viki What sort of radar?
viki As in... "I saw 'Why Perl 6 hasn't taken off?' on HN the other day" .. or as in... "I'm contemplating on writing some P6 code" 16:38
timotimo yeah, that HN exposure was a thing
Juerd Calling something "a thing" has trickled into Dutch as well and I still don't know what it means... :) 16:39
viki Juerd: "it happened"
Juerd (Of course, we use the diminutive, "een dingetje", or "a little thing", because, well, we do that.)
viki or "it exists" 16:40
gfldex or "a topic" 16:40
Juerd That's all?
Wow.
timotimo it's like pointing at a thing but not really giving it a value
viki Lol, yeah
Juerd So calling things "a thing" is a thing, I guess? 16:41
timotimo yes
viki Juerd: did you know Crocoduck is a thing?
It is: en.wikipedia.org/wiki/Crocoduck#Fossils
:)
Juerd I did not
timotimo <3 16:42
that is absolutely amazing
nicq20 Huh. IO::Socket::Async.connect will fail after 937 calls to it. 16:45
timotimo that sounds like a spesh issue 16:46
can you try setting MVM_SPESH_DISABLE=something in your environment and re-run your code?
also, exact version information would be highly appreciated, perhaps with a golfed piece of example code
nicq20 p6: my $v; for ^950 { IO::Socket::Async.connect("google.com",80); ++$v }; say $v; IO::Socket::Async.connect("google.com",80); 16:48
camelia rakudo-moar 01856d: OUTPUT«950␤»
Juerd Heh, anti DoS feature ;)
nicq20 Hmm... Possibly I need to update my Perl6.
Juerd IIRC the bot doesn't do connections 16:49
moritz right, camelia has some IO restrictions
nicq20 Oh, I see.
timotimo it's also a good idea to actually close the sockets you open
unless you wer eplanning to keep them around
timotimo BBL 16:50
nicq20 timotimo: Oh, gee whiz! That's what I forgot!
Juerd But keeping them open is vital to slow-loris-like approaches
viki IRC bot does do connections.
viki committable6, HEAD await IO::Socket::Async.connect("irc.freenode.net", 6667).then: -> $p { if $p.status { given $p.result { .print: "NICK Perl6Robot\nUSER z z z z\nJOIN #perl6\nPRIVMSG #perl6 :OHAI!\n"; react { whenever .Supply { .say } } } } } 16:52
oops
Perl6Robot OHAI! 16:52
viki wrong wrobot :P
viki >_< 16:52
Juerd Hahaha
viki I used the UP key to get my previous code lol
m: await IO::Socket::Async.connect("irc.freenode.net", 6667).then: -> $p { if $p.status { given $p.result { .print: "NICK Perl6Robot\nUSER z z z z\nJOIN #perl6\nPRIVMSG #perl6 :OHAI!\n"; react { whenever .Supply { .say } } } } } 16:53
Perl6Robot OHAI! 16:53
Juerd Now... who will write the first irc/perl6 quine? :D
camelia rakudo-moar 01856d: OUTPUT«(timeout):karatkievich.freenode.net NOTICE * :*** Looking up your hostname... 16:53
moritz urks
viki I wonder why committable quit 16:54
moritz so, maybe camelia should execute its stuff in a docker container with disabled network, or something
viki Yeah, maybe. 16:55
It's kinda the least abusive method of abuse she currently offers.
You could get yourself logged in into the box she's on, for example.
moritz I know
moritz does't want to turn p6 infrastructure into a spammer's playground 16:56
AlexDaniel Unhandled exception in code scheduled on thread 14 16:58
Unhandled exception in code scheduled on thread 6
viki: ↑
brrt on the radar as in 'hey, i noticed people talking about perl6 in a normal way'
viki AlexDaniel: :(
brrt: that's great! 16:59
AlexDaniel commit: HEAD await IO::Socket::Async.connect("irc.freenode.net", 6667).then: -> $p { if $p.status { given $p.result { .print: "NICK Perl6Robot\nUSER z z z z\nJOIN #perl6\nPRIVMSG #perl6 :OHAI!\n"; react { whenever .Supply { .say } } } } } 16:59
Perl6Robot OHAI! 17:00
AlexDaniel interesting 17:00
AlexDaniel viki: it could be a bug in rakudo, not sure right now. I have created a ticket for that so that it doesn't slip through the cracks: github.com/perl6/whateverable/issues/57 17:06
viki Cool. Thanks. 17:06
dataf3l hey guys 17:26
viki \o
FROGGS hi dataf3l
dataf3l the newbie here again, with a question
viki Sweet.
AlexDaniel 🙋
dataf3l I’m using HTTP::Server::Tiny to receive requests from people on the internet 17:27
AlexDaniel okay
dataf3l I have doubts about how to parse HTTP Requests into a thing that looks like $_POST in php
timotimo what do you mean by "doubts"?
dataf3l what I have now is an HTTP Request QUERY_STRING
dataf3l but my attempts of finding a library that converts QUUERY_STRING into an object have been unsuccessful. 17:28
I THINK back in the perl days this may have been a part of a cgi module 17:30
timotimo ah, it seems like H::S::Tiny actually expects you to either not need that, or do it with another module
dataf3l pretty much 17:31
but it’s the only one i’ve found so far that handles many requests at once
timotimo github.com/tokuhirom/p6-Crust/blob...st.pm6#L53
steal this :)
dataf3l simple doesn’t and neither does async 17:32
timotimo maybe you actually want to use straight up Crust
dataf3l but does Crust handle multiple concurrent requests ? 17:33
timotimo i haven't tried it yet
FROGGS Bailador does it here: github.com/ufobat/Bailador/blob/ma...est.pm#L72
dataf3l Bailador didn’t work for my machine, for some reason
Thank you timotimo, I really appreciate your help and time :) 17:34
FROGGS yeah, was just thinking that you could steal this method
dataf3l also thanks to FROGGS, you guys are amazong
amazing*
FROGGS :o)
dataf3l does crust handle uploads? 17:35
timotimo i saw an "upload" file in there 17:36
so ... probably?
dataf3l_ ok, I downloaded perl6 18:07
I mean, Crust 18:08
sorry
also, I installed the software, but it didn’t pass the tests, so I just did —notests (bold, I know), then I proceeded to copy and paste the example
I’m not sure, but I think a PSGI Server in addition to Crust?
timotimo could be, what does "crustup" do? 18:09
it can apparently use HTTP::Server::Simple for example 18:10
timotimo and HTTP::Easy, and FastCGI 18:13
apparently
viki Bah. DoS vuln in OpenSSL thehackernews.com/2016/11/openssl-p...pdate.html 18:23
viki foresees intertubes to be clogged for the next couple of weeks
timotimo "a bug in the handling of the ASN.1 CHOICE type" ASN.1 was a *gigantic* mistake 18:25
geekosaur sadly, the main alternative is xml. you sure you want to go *there*? 18:29
timotimo hm.
geekosaur or possibly json, although it's not quite as flexible. nobody argues that asn.1 is horrid. but it 's less horrid than the alternatives if you need a flexible and extensible mechanism for arbitrary data that isn't tied to a particular language's behavior (e.g. json), which is why it hangs on 18:31
er, that it isn't horrid
moritz what about protobuf, for example? 18:54
moritz has no experience with it, so has to ask
geekosaur I also have no experience
moritz btw there's an AmA going on with the let's encrypt team: www.reddit.com/r/IAmA/comments/5c9...to_secure/ 19:08
viki Wonder where we offer that feature in the docs... "This breaks my heart, since I was planning on delivering a compiled binary" RT#129909 19:12
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129909
viki to my clients, I was planning on this since I saw the feature in the docs.
moritz dunno; just ask 'em? 19:15
viki dataf3l_: I assume that's you in the ticket ^ ? Where did you see that feature advertised in the docs. 19:16
dataf3l_: also, I'm unaware of any plans to implement it this year
geekosaur was wondering that as well 19:18
FROGGS hmmm, you actually can run a .moarvm, no? (if they have moarvm, that is) 19:19
well, they need rakudo too of course
dataf3l_ hi guys 19:20
it’s me again.
perlpilot Maybe he saw that in the old FAQ?
dataf3l_ I’m reading about exceptions
docs.perl6.org/language/exceptions#try_blocks
moritz FROGGS: but there's no mechanism to compile scripts down to .moarvm files, no?
dataf3l_ the code excerpt is this:
CATCH {
when X::AdHoc { .Str.say; .resume }
}
I think .STr.say is a method name 19:21
viki Yup
dataf3l_ which is implicitely being run on “something”
perlpilot dataf3l_: two method names in fact
dataf3l_ I want to know the name of said variable
viki dataf3l_: topic
dataf3l_ so I can do $name.Str.say
viki dataf3l_: $_.Str.say
dataf3l_ because I like variable names
ok
how can I access the topic?
perlpilot dataf3l_: it's in $_
moritz dataf3l_: please update the docs if you think they could be clearer 19:22
dataf3l_ I think I want to update HTTP::Server::Tiny ’s main example, since any bad code inside the START block will fail silently and not return a 500 error at all 19:27
also, there is a bug in the documentation
printing the file name and the line name together like that, just prints a very large number
like, line 5 file 6 will print “exname 56 throw”
so maybe add a space or something? 19:28
FROGGS moritz: you can do that: perl6 --target=mbc --output=test.moarvm -e 'say 42'
moritz: thing is, since we have auto-recompilation the module loader checks for a checks for a .pm file first, and gives up even when there is a test.pm.moarvm 19:29
dataf3l_ viki, yes it was me 19:31
that sucks
oh well...
I’ll write an obfuscator I guess 19:32
viki dataf3l_: have you considered a legal approach instead?
moritz FROGGS: well, for me it dies trying to load ModuleLoader.moarvm 19:33
(which I try to run the .moarvm file)
FROGGS ~/dev$ perl6 --target=mbc --output=test.moarvm -e 'say 42'
~/dev$ perl6 -e 'CompUnit::Loader.load-precompilation-file("test.moarvm".IO)'
42
thing is... such a .moarvm file is *not* portable 19:35
moritz it can't be, because rakudo itself isn't relocatable 19:36
FROGGS it is not just about locations, but also about the references to other compilation units like the setting
every build is unique 19:37
such a .moarvm would be portable if everybody would install the debian rakudo package with the same version
dataf3l_ I understand..
FROGGS but as soon one upgrades, the .moarvm is invalid
dataf3l_ so if I copy the source code to a machine, compile, and then delete the source code, then it would be isntalled, correct? 19:38
but then, the whole environment would be permanently fixed, I guess
moritz if you're talking about the source code of rakudo, then yes
dataf3l_ I’m goint to try the 42 example 19:38
awesome!
:)
FROGGS yes, the perl 6 installation cannot be changed afterwards, or the .moarvm file is useless
viki What about precompiled modules? 19:39
FROGGS viki: that's what we have here
viki Ah, ok
FROGGS just recompiling rakudo without changing any line in the setting makes every dependant .moarvm file outdated 19:40
dataf3l_ tthose 2 lines FROGGS just posted should be like, published somewhere, like an article or something
moritz dataf3l_: then do it
FROGGS I just think that these two lines give false hopes :S 19:41
moritz dataf3l_: stop talking about what things should be done, and simply do them. Far more effective.
dataf3l_ very well
I’ll write the article
FROGGS a mangler or obfuscator would be interesting too I guess 19:42
sad that I lack knowledge in that area
dataf3l_ I can’t help but wonder 2 things. 19:44
1.
if helping a language be compiled would drive up adoption, given a compiled sourcecode means everyone hides their secrets
hiding the tool itself
as oposed to, for instance, PHP, which didn’t/doesn’t have a decent compiler, which influences people’s decision to build OPEN SOURCE stuff
since it’s hard to hide the sources 19:45
OR
if on the other side, building a compiler would drive UP adotion, since people can use it and sell things an make money and stuff
I just don’t know what the best way is, I guess...
RabidGravy why would you want to hide the source?
El_Che most of what is compiled can be easily decompiled 19:46
dataf3l_ I own a software company, and due to the capitalist socety I live inside of, I must protect future revenue by implementing vendor-lockin
viki dataf3l_: you can still sell your Perl code. The way it's done is you make your client sign a legal document preventing them from modifying and distributing your code.
dataf3l_ but they get the code anyway
viki dataf3l_: I mean, hiding the source doesn't "hide your secrets" you can still disassemble the entire program and read what it does. 19:46
dataf3l_ I know vendor lockin sucks, but I can’t really make choices about it
RabidGravy maybe I'll just "hide" all the free software that other people use 19:47
dataf3l_ but how could the average layman disassemble the moarvm file?
El_Che I pay for a "closed" source perl product
El_Che I can adapt the source if I need it 19:47
but I can not release it
fair enough
moritz dataf3l_: do laymen can do anything interesting with the source code?
dataf3l_ I don’t think so, to be honest
too niche to be interesting 19:48
I’m trying to get my client to let me release all my work
If i’m succesful, I’ll just open source the whole thing
that is my goal
moritz anyway, I agree that being able to ship Perl 6 code as an executable would be beneficial
but that doesn't make it happen
El_Che that's one of Go's adavantages
moritz somebody has to put in the work to make it so
dataf3l_ maybe what I should do is just get my employer to support the technology it uses, by supporting the perl foundation 19:49
FROGGS I've got old branches that do that btw
dataf3l_ how can I help you merge said old branches into the master? 19:50
FROGGS heh, first they need to actually work :o)
dataf3l_ I think the fair thing to do, would be to open source the whole thing, so it prints out like a book 19:52
something like Knuth’s literate programming
a nice latex intertwined with perl6 sourcecode document, ready for print
which actually prints
timotimo can make a slang that helps parse the latex chunks in between code 19:53
i.e. not make the parser crash when it sees latex
moritz finds latex markup too verbose for documents that contain much code 19:54
dataf3l_ wait 20:01
I just realised my comment on the documentation has a bug was completely misguided.
the docs are OK
pmurias dataf3l_: is hidding the source a big concern for most closed source programs? 20:14
viki I really like Rust's RFC process: github.com/rust-lang/rfcs/#what-the-process-is 20:40
Compared to ours: where people just open tickets with "would be nice" (or at best, adding an [RFC] tag) 20:41
viki We probably aren't big enough to do their process verbatim, but it's nice to peak at greener grass. 20:41
(specifically, I like the part of the process that ensures RFCs don't collect dust in the corner, forgotten and unloved) 20:42
buggable: rfc 20:43
buggable: tag rfc
buggable viki, There are 60 tickets tagged with RFC; See perl6.fail/t/RFC for details
kyclark_ So I wrote a script to detect cheaters: github.com/kyclark/metagenomics-bo...ounter.pl6 22:28
I had some students copy each other, change one variable name, and turn in another student’s work 22:29
kyclark_ We do lots of kmer stuff in our lab, so I decided to do a pair-wise kmer analysis of all the scripts on the last assignment to see if I could detect the cheaters. 22:29
It works, but it does identify one person as unlikely close even though it wasn’t. Anyway, I want to blog about this, and want some feedback first. 22:30
Any suggestions?
avuserow kyclark_, interesting. it looks like you are comparing all "words", correct? that's the opposite of how one of my college groups did it. they had a program that calculated similarity at more of an AST level 22:36
so it seems like your program is more sensitive to variables being named similar or being renamed after copying
but it is much shorter implementation-wise
kyclark_ Yes, it would be.
avuserow I can't think of a way to improve it without adding some language-specific smarts 22:40
kyclark_ I’ll throw it up and wait to get shredded on Reddit 22:41
thundergnat kyclark_: Were you looking for a way to capture keystrokes the other day? 22:42
kyclark_ Yes (without having to hit Enter)
thundergnat Try Term::termios
avuserow if you had a relatively small amount of languages you could potentially find good preprocessors for them
thundergnat Take a look at github.com/thundergnat/2048 for pointers. 22:42
avuserow kyclark++ # blogging 23:01
kyclark_ Thanks! 23:20
Xliff Hey, #perl6! 23:43
Is there an obvious reason why a method in my Grammar actions class gives a "too few positionals passed" error? All method signatures are ($/) 23:44