»ö« 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.
skink So then that begs the question of why the travis build isn't finding the lib 00:03
Xliff_ skink, Last I checked, the Travis tests were passing. All nativelib calls will have API versions in v0.0.2
Xliff_ checks again. 00:04
ZoffixWin m: my @posts = %(date => 'April 4, 2016'), %(date => 'April 2, 2016'), %(date => 'April 25, 2016'); say @posts.sort: *<date>
camelia rakudo-moar c40374: OUTPUT«({date => April 2, 2016} {date => April 25, 2016} {date => April 4, 2016})␤»
Xliff_ WTF?
Why is it building v0.0.2?
ZoffixWin What am I doing wrong?
Ahhh 00:05
never mind :P (cmp for numerics
)
Xliff_ Is there a way to turn OFF Travis-CI builds for branches? I only want it to focus on master. 00:06
skink Should be in the travis settings
timotimo yeah, there's some filter thingie
Xliff_ Found it. 00:07
00:07 vytas left 00:08 vytas joined
Xliff_ GRRR 00:11
I can't merge recent changes on master in my v0.0.2 branch. 00:12
I've used "git pull origin/master" and "git rebase master" and my changes to .travis.yml are still not reflected in v0.0.2 branch
Usually these things work.
00:14 maybekoo2 left 00:20 hotel_california is now known as hotel
ZoffixWin w00t! My first ever Perl 6 Web App! perl6.party/post/20160502-Perl-6-Th...st--Part-1 00:22
With in-browser-runnable code snippets!
Now, I just need to start using self-contained, runnable examples in my blog posts :P 00:23
Xliff_ git conflict and branch resolution sucks. 00:24
ZoffixWin :/ This one doesn't work... I guess JS needs "special magic" to make unicode work :/ perl6.party/post/20160425-Perl6-Comb-It#limits 00:25
Ah, Perl 6 spoils me
timotimo how do you run the code? 00:26
jdv79 try doing that in svn
timotimo with glot.io?
hotel m: my constant ( ͡° ͜ʖ ͡°) = 'booty'; say ( ͡° ͜ʖ ͡°); 00:27
camelia rakudo-moar c40374: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9I8LXCDSgg␤Missing initializer on constant declaration␤at /tmp/9I8LXCDSgg:1␤------> 3my constant7⏏5 ( ͡° ͜ʖ ͡°) = 'booty'; say ( ͡° ͜ʖ ͡°);␤»
yoleaux 3 May 2016 03:42Z <AlexDaniel> hotel: try this for swapping values: my @arr = <a b c>; @arr[0,2] = @arr[2,0]; say @arr
Xliff_ Now I have to push a dummy change to master so I can get rid of the "failing" status... wheee
hotel missing initialiser? 00:28
m: my $( ͡° ͜ʖ ͡°) = 'booty'; say $( ͡° ͜ʖ ͡°);
camelia rakudo-moar c40374: OUTPUT«5===SORRY!5=== Error while compiling /tmp/f9qhlD5xS_␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/f9qhlD5xS_:1␤------> 3my $(7⏏5 ͡° ͜ʖ ͡°) = 'booty'; say $( ͡° ͜ʖ ͡°);␤ expecting any of:␤ …»
hotel oh gg
ZoffixWin timotimo, yup: github.com/zoffixznet/perl6.party/...app.p6#L40 00:29
00:30 pierre_ joined
timotimo neat. 00:31
hotel: you can of course make it a term
hotel a term?
ZoffixWin You can't :P It got spaces in it 00:32
timotimo m: sub term:<( ͡° ͜ʖ ͡°)> { say "booty" }; ( ͡° ͜ʖ ͡°);
camelia rakudo-moar c40374: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TQbZceIXgo␤Too many symbols provided for categorical of type term; needs only 1␤at /tmp/TQbZceIXgo:1␤------> 3sub term:<( ͡° ͜ʖ ͡°)>7⏏5 { say "booty" }; ( ͡° ͜ʖ ͡°);␤»
timotimo it does? damn.
00:32 pierre_ left
hotel it does? didn't think it did 00:32
timotimo ZoffixWin: now that you have a /run there, you should really invest in using a multi-threaded/asynchronous web server backend :)
ZoffixWin hm, maybe not... Or maybe my HexChat is glitching... If I remove what looks like a space, the eyebrows go away :/ 00:33
timotimo m: "( ͡° ͜ʖ ͡°)".comb>>.uniname
camelia ( no output )
timotimo m: "( ͡° ͜ʖ ͡°)".comb>>.uniname.say
camelia rakudo-moar c40374: OUTPUT«(LEFT PARENTHESIS SPACE DEGREE SIGN SPACE LATIN LETTER INVERTED GLOTTAL STOP SPACE DEGREE SIGN RIGHT PARENTHESIS)␤»
hotel oh damn
timotimo m: "( ͡° ͜ʖ ͡°)".comb>>.uniname.perl.say
camelia rakudo-moar c40374: OUTPUT«("LEFT PARENTHESIS", "SPACE", "DEGREE SIGN", "SPACE", "LATIN LETTER INVERTED GLOTTAL STOP", "SPACE", "DEGREE SIGN", "RIGHT PARENTHESIS")␤»
timotimo so many psaces in there
psaces? wow.
ZoffixWin m: "( ͡° ͜ʖ ͡°)".comb.grep({$_ ne ' '}).join.say 00:34
camelia rakudo-moar c40374: OUTPUT«5===SORRY!5=== Error while compiling /tmp/y6cq9Qg2TI␤Bogus postfix␤at /tmp/y6cq9Qg2TI:1␤------> 3 ͡° ͜ʖ ͡°)".comb.grep({$_ ne ' '}).join.say7⏏5␤ expecting any of:␤ infix␤ infix stopper␤ statement end…»
hotel m: sub term:<(°ʖ°)> { say "booty?"; }; (°ʖ°);
camelia rakudo-moar c40374: OUTPUT«booty?␤»
ZoffixWin m: "( ͡° ͜ʖ ͡°)".comb.grep({$_ ne ' '}).join.say
camelia rakudo-moar c40374: OUTPUT«( ͡° ͜ʖ ͡°)␤»
ZoffixWin The two look the same to me :/
hotel just doesn't have the same impact
ZoffixWin m: '( ͡° ͜ʖ ͡°)'.comb>>.uniname.perl.say 00:35
camelia rakudo-moar c40374: OUTPUT«("LEFT PARENTHESIS", "SPACE", "DEGREE SIGN", "SPACE", "LATIN LETTER INVERTED GLOTTAL STOP", "SPACE", "DEGREE SIGN", "RIGHT PARENTHESIS")␤»
ZoffixWin :/ dafuq
hotel (°ʖ°) <- without spaces
Xliff_ That's what I am saying about Travis-CI right about now.
hotel lol
cool about the terms though
like #define 00:36
Xliff_ I think I have it slapped into shape, but when you have 3-5 commits across 2 branches where the lines start with "- TRAVIS: "... you know something is wrong.
timotimo er, no :)
hotel well
ZoffixWin sees this i.imgur.com/RPMZntI.png
hotel shrugs
#define true false
ZoffixWin m: sub term:<¯\_(ツ)_/¯> { say 'hotel shrugs' }; ¯\_(ツ)_/¯ 00:37
camelia rakudo-moar c40374: OUTPUT«hotel shrugs␤»
timotimo so that's what that's supposed to look like !!!!
no wonder i never understood why people use that emoticon
ZoffixWin loool
Xliff_ ROFL!
hotel lol
timotimo i'll make a screenshot with what ( ͡° ͜ʖ ͡°) looks like to me, a sec.
i.imgur.com/AyDtfKv.png
Xliff_ Probably a lot of boxy shapes. 00:38
timotimo nah
ZoffixWin hahaha
Xliff_ Wooow!
timotimo i see all those spaces
Xliff_ Trippy
timotimo thanks so much for enlightening me
ZoffixWin :)
hotel whoa that's one weird looking booty 00:39
timotimo if your butt has eyes, a nose and a mouth like that, i'm really worrying about your health
skink I assume he's referring to this: www.youtube.com/watch?v=wGlBwW7f5HA 00:40
timotimo Unfortunately, this video is not available in your country because it could contain music from UMG, for which we could not agree on conditions of use with GEMA. 00:41
hooray
i see a video filmed off of a projected screen, though 00:42
yeah, i know that song, it's a fun song
00:43 pierre_ joined 00:44 cpage_ left, cpage__ joined 00:47 wbill joined 00:49 kurahaupo left
Sgeo How do react {} and similar help avoid callback hell? 00:57
I would think generators would be a better tool? 00:58
00:59 kid51 joined
ZoffixWin Sgeo, whenever inside a react {} can hook up to a Supply. And supply can emit() whenever it wants 00:59
I think it's somewhat similar to generators, really
timotimo and inside the blocks you can write your "callbacks" as if they were just loops over the incoming values 01:00
which can look pretty nice i suppose
ZoffixWin I think the only difference is with generators you *ask* for the next item and react {} you'd react whenever the next item is emitted()
Sgeo Isn't "asking" more flexible? Maybe I need to see an example 01:02
timotimo well, you can just coerce any Channel or Supply into a lazy list, too
that'll give you a generator access pattern for free
Sgeo With a monadic approach, I could get one item from a Supply, then use that item to determine which Supply to get from next. Is there an equivalent for react/supply?
ZoffixWin There's probably a way to make it ask...
01:03 kid511 joined
timotimo supplies run whenever their data arrives, you can't start/stop a normal supply, but you can go via coercers and combinators and such 01:04
01:05 kid51 left
timotimo we do have a big amount of combinators for supplies 01:05
ZoffixWin I think Supply + Channel can be an equivalent of a genarator... Though I'm wasted at the moment and can't think well :P 01:06
timotimo your "what supply to get the next value from" thing can be done with a zip, for example
yeah, calling .Channel on a Supply will give you something where you ask for the next value, whereas .List on a Supply will give you something that'll handle like a lazy list
ZoffixWin We need a Generator module :P It's not the first time someone asks about generators :P
module or good docs 01:07
01:07 molaf left
timotimo generators are just gather/take, dood 01:07
ZoffixWin \o/ 01:09
01:09 sufrostico left
ZoffixWin mentally marks it as a TODO article to write 01:09
hotel what are these logistical-sounding constructs? supplies? generators? ?? 01:10
I know java has like factories that make factories that make things... 01:11
ZoffixWin hotel, generators are things you ask for values and they given them to you (like wiki.python.org/moin/Generators). Supplies are Perl 6 async constructs docs.perl6.org/type/Supply 01:12
This may be a better link for P6 async/concur stuff: docs.perl6.org/language/concurrency
hotel like getters/setters?
ZoffixWin has no idea what Java factories are
01:12 finanalyst joined
ZoffixWin hotel, getters/setters... like in OO? No. 01:12
hotel ZoffixWin, java factories: discuss.joelonsoftware.com/?joel.3.219431.12 01:13
ZoffixWin is too drunk to read anything :P
hotel it's funny though :P
Sgeo Ridiculously elaborate mechanism to work around the fact that Java doesn't have closures that can return new objects 01:14
iiuc
hotel ^
oh right generators are those things
yield
it's all coming back
timotimo it's coming for you
be very afraid
skink wishes he had more opportunities to use OCaml 01:16
Bunch of the fancier Perl6 reminds me of it
Sgeo I have so much difficult looking at non-Rust languages these days, I think I really like inherited mutability
hotel wonders if rust works on ubuntu on windows... 01:19
01:19 molaf joined
skink It... should... I think? 01:19
hotel nope! forgot there's curl ssl issues lmao 01:20
timotimo nobody needs ssl
hotel u right
Xliff_ hi5's ZoffixWin 01:21
I am not... yet... wasted. I am getting there, though.
geekosaur reminded to look for ppa for a recentish rust 01:22
Xliff_ Rust?
hotel broke vi 01:23
Xliff_ o_O
hotel, How in the world did u do that?
hotel I right-clicked a few too many times
01:24 rindolf joined
timotimo does that put you in a strange mode? 01:24
hotel with something big in my clipboard
windows shell pastes on right-click
Xliff_ Ooo... that might do it.
timotimo haha, if you're good you can paste it so that vi interprets it as commands
Xliff_ :P
Working Ubuntu under Windows is still not enough to make me install Windows X
I mean... look at the name. It already has a strike in it. 01:25
hotel well I would be using nano but nano is just plain broken on uow
geekosaur that should be a warning :)
hotel yep lol
Xliff_ geekosaur++
skink geekosaur, I think the installer script will always overwrite your current install with the latest stable Rust
Don't quote me on that though
Xliff_ What is rust? I would google it, but .... common term. 01:26
hotel rustlang
google that ^
Xliff_ Thankee
timotimo we should SEO the F out of "perl6lang"
hotel generally when looking for new programming languages I find it useful to add 'lang' to my search term
timotimo C#lang?
hotel golang
timotimo well, "clang" surely gives you the wrong idea :) 01:27
ZoffixWin hotel, heh, you were right, it was pretty funny :)
geekosaur rust-lang.org
looks like a cross between OCaml and C
hotel I have a universal tool factory factory factory here, need to make a hammer
skink Unfortunately, when searching for perl6 stuff, DuckDuckGo still returns mostly perl(5) stuff
ZoffixWin That's because DuckDuckGo sucks :) 01:28
skink geekosaur, Mozilla basically plastered OCaml features on top of C++ with lifetime-based memory management
hotel has had no problems on google
skink Creating a useful yet unholy abomination
Xliff_ LOL
I will need to gain several levels before Rust becomes useful to me. 01:29
Mainly coz... I have no use cases for it that aren't satisfied by languages I am more familiar with.
hotel my main interest right now is finding languages I've never heard of before, compiling them on UoW, then attempting to make an http server with them 01:30
learning is fun
geekosaur does not wait for a use case to learn new stuff
skink geekosaur, Yeah just checked, the rustup script handles upgrading fairly cleanly it seems
PPA not really needed
Xliff_ Although how you can say "efficient C bindings" and "prevents segfaults" on the same page is kinda silly.
geekosaur for one thing, I expect others to be using it and being able to understand them, and it, is useful
Xliff_ When I find that a language does something useful, I learn it. 01:31
Or for the cool factor.
timotimo we could make it impossible to cause segfaults by inspecting the memory maps our program has and only allowing Pointer to be created/boxed with valid addresses
Xliff_ Or for... legacy interest.
timotimo what could possibly go wrong
hotel one day I'll learn brainfuck
Xliff_ Perl 6 satisfied all 3. 01:32
Xliff_ googles "brainfuck lang"
geekosaur does enough sysadmin at work, is happy to let more automated stuff deal for home >.>
timotimo so lang, suckers :D
timotimo goes to bed 01:33
skink Xliff_, Rust in and of itself does exactly what is described in that top bit. Binding to C code is usually explicitly marked with #[unsafe] so you know exactly where to be careful
hotel haha
Sgeo I think I was thinking more async/await, which isn't generators but could be built on top maybe
skink Also the libraries which do bind to C tend to be extremely cautious and have saner, safer return values
Xliff_ skink, OK. But that's cheating! ;) 01:34
skink Xliff_, kamalmarhubi.com/blog/2016/04/13/ru...ramming-3/
hotel interesting, rust thinks uow is 'unknown-linux'
skink Good example, imo
Xliff_ And when the source to "Hello World" contains neither "Hello" nor "World", you know to run... quickly.
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
hotel Xliff_++ 01:35
it makes perfect sense
Xliff_ LOL!
The previous line noise was "Hello World" in brainfuck.
Now you can see that the language was aptly named.
hotel people always talk about simplicity but they can never follow through 01:36
skink Xliff_, If you wanna see something really sick, someone wrote a VB->BF->ASM compiler that outputs entirely MOV
Sgeo Perl6's Failure makes me think of a cross between Rust's Result and the billion dollar mistake called null
Like it's a null except it has useful information that someone who sees it might be able to understand and debug
skink 99 bottles is something like 5,000 lines of asm with it :)
Xliff_ skink, o_O -- I did not grok. Repeat that using single syllables. With hyperlinks!
hotel MOV-- as in, the format?
Xliff_ MOVie?
hotel or the asm instruction 01:37
mspo whitespace lang is more BF than BF
hotel github.com/jfeng41/greentext
mspo there should obviously be a BF in perl6
hotel tabs and spaces lmao 01:38
skink The asm instruction
github.com/xoreaxeaxeax/movfuscator
This compiles C code - any C code - to entirely mov instructions
Xliff_ O_O
The practical coder in me is like "EWW! WTF?" 01:39
skink The dude also has a presentation where, iirc, he can compile Visual Basic to Brainfuck and then run it through a similar compiler
Xliff_ The wimsical coder in me is like "COOOL!"
skink I read that as COBOL and was frightened.
hotel what's "practical coding"? ;-)
Xliff_ Coding where I don't have to really work to write or understand it. 01:40
hotel ;-)
Xliff_ hotel, what can I say? I like to be lazy! 01:41
skink Go to Haskell for that
Xliff_ :p
hotel s/ask//
Xliff_ ROFL!
hotel if this isn't irony idk what is: gist.github.com/HotelCalifornia/81...0f32048a0d 01:44
skink You did something wrong :) 01:50
Also try using cargo new + cargo build
for project dirs
oh new --bin, right 01:51
hotel I ran the install script like the site told me :( 01:53
Xliff_ hotel, ROFLMAO!
Now post the code to main.rs 01:54
hotel fn main() { println!("hello world!"); }
01:55 huggable left, huggable joined
skink Works for me™ 01:57
hotel Some examples:
Pi, which maps brainfuck into errors in individual digits of Pi.
02:04 itaipu joined 02:06 skrsh left 02:08 cpage__ left 02:12 yqt left 02:13 cpage_ joined, yqt joined
Sgeo Blah, start { ... } is allowed to mutate stuff in the surrounding scope 02:13
That seems fragile and a bad idea to allow
02:14 mr-foobar left 02:15 pierre_ left, mr-foobar joined
hotel elegant puu.sh/oGFw1/9fba34b6c9.png 02:16
02:17 noganex joined 02:20 noganex_ left, kid511 left 02:22 sortiz joined 02:26 hotel is now known as hotel|netteiru 02:27 mr-foobar left
sortiz \o #perl6 02:28
02:28 mr-foobar joined 02:31 skink left 02:33 mr-foobar left, pierre_ joined 02:34 mr-foobar joined, cibs left 02:39 itaipu left
grondilu m: say &[+], ().Seq; 02:42
camelia rakudo-moar c40374: OUTPUT«sub infix:<+> (Mu $?, Mu $?) { #`(Sub+{<anon|51509600>}+{Precedence}|66435040) ... }()␤»
grondilu m: say reduce &[+], ().Seq;
camelia rakudo-moar c40374: OUTPUT«0␤»
02:43 cibs joined
grondilu m: say reduce * + *, ().Seq; 02:43
camelia rakudo-moar c40374: OUTPUT«Too few positionals passed; expected 2 arguments but got 0␤ in block <unit> at /tmp/tys1CJ6WOJ line 1␤␤»
grondilu I guess that makes sense. reduce can not guess the degenerate case from a generic two-parametered sub. 02:44
zostay .seen ufobat 02:47
yoleaux I saw ufobat 4 May 2016 19:37Z in #perl6: <ufobat> sena_kun, if you have questions or suggestions don't hesitate to talk to me :)
Sgeo Is design.perl6.org/S07.html the canonical way lists work in Perl6?
zostay .tell ufobat thx, i hope the MoarVM problem blocking progress on P6SGI can get resolved sometime so I can have fun on it again... i'm no language or VM hacker 02:48
yoleaux zostay: I'll pass your message to ufobat.
02:48 yqt left
MadcapJake Sgeo: surely this is more up-to-date:doc.perl6.org/language/list 02:48
02:48 mr-foobar left
BenGoldberg m: say reduce * + *, 1..3 02:49
camelia rakudo-moar c40374: OUTPUT«6␤»
02:49 mr-foobar joined
zostay m: say [+] 1..3 02:49
camelia rakudo-moar c40374: OUTPUT«6␤»
BenGoldberg m: say [+] slip; 02:50
camelia rakudo-moar c40374: OUTPUT«0␤»
BenGoldberg m: say [*] slip;
camelia rakudo-moar c40374: OUTPUT«1␤»
BenGoldberg m: say [/] slip;
camelia rakudo-moar c40374: OUTPUT«No zero-arg meaning for infix:</>␤ in block <unit> at /tmp/ALYC5s5wlr line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/ALYC5s5wlr line 1␤␤»
BenGoldberg m: say [**] slip;
camelia rakudo-moar c40374: OUTPUT«1␤»
BenGoldberg If I had my own custom operator, how would I indicate what it should return for degenerate reduction? 02:52
Sgeo MadcapJake, hmm, ty
02:52 vike left
rindolf Hi all! Sup? 02:55
02:57 mr-foobar left
Sgeo Wait, is start/await like C#'s async/await? 02:57
Except it starts a thread?
MadcapJake I believe so
Sgeo Seems a bit blocking instructiony though? 02:58
02:58 vike joined, mr-foobar joined
MadcapJake it's not a true thread though I believe, it's handled by a scheduler 02:58
Sgeo: doc.perl6.org/type/ThreadPoolScheduler 02:59
zostay m: multi infix:<foo>() { say 'degenerate' }; [foo] slip; 03:00
camelia rakudo-moar c40374: OUTPUT«degenerate␤»
zostay BenGoldberg: declare a multi sub with a () signature
grondilu could be a trait imho sub infix:<§> does degenerate(0) {...}
oh yeah a multi with no param would do indeed 03:01
m: multi infix:<§>() { 0 }; multi infix:<§>($) { 1 }; say [§] slip; say [§] rand; 03:02
camelia rakudo-moar c40374: OUTPUT«0␤0.748557235613763␤»
zostay in fact, at least some catch all is necessary or you get an error like: Too few positionals passed; expected 2 arguments but got 0 or Cannot call infix:<foo>(...); none of these signatures match:
grondilu m: multi infix:<§>() { 0 }; multi infix:<§>($) { 1 }; say [§] slip; say [§] ().Seq;
camelia rakudo-moar c40374: OUTPUT«0␤0␤»
zostay if a degenerate case is bad, you should define one that dies with a better error message
grondilu how would I do with an anonymous sub though? 03:04
because initially I had: reduce { $^a.stuff($^b) }, ().Seq;
maybe reduce could get a $degenerate named parameter? 03:06
reduce &mysub, :degenerate(0), @stuff
in any case what I did as a work-around was: !@stuff ?? 0 !! reduce &my-binary-op, @stuff; 03:08
which is ok just not totally awesome. 03:09
though I guess I could also do reduce &my-op, $degenerate-case, |@things 03:12
03:15 BenGoldberg left 03:16 BenGoldberg joined 03:22 mr-foobar left 03:23 mr-foobar joined 03:28 mr-foobar left 03:29 mr-foobar joined 03:39 mr-foobar left 03:40 mr-foobar joined 03:42 pierre_ left 03:56 pierre_ joined 04:02 mr-foobar left 04:03 mr-foobar joined
BenGoldberg m: say &reduce 04:10
camelia rakudo-moar c40374: OUTPUT«sub reduce (| is raw) { #`(Sub|71886920) ... }␤»
04:12 BenGoldberg left 04:13 BenGoldberg joined
MadcapJake m: (gather { for 'a', 'b' ... * { say 'foo'; take $_ } })[0] 04:14
camelia rakudo-moar c40374: OUTPUT«foo␤»
MadcapJake m: (gather { for 'a', 'b' ... * { say 'foo'; take $_ } })[1]
camelia rakudo-moar c40374: OUTPUT«foo␤foo␤»
MadcapJake m: (gather { for 'a', 'b' ... * { say 'before'; take $_; say 'after' } })[1] 04:15
camelia rakudo-moar c40374: OUTPUT«before␤after␤before␤»
BenGoldberg m: (gather { for 'a', 'b' ... * { say 'foo'; take $_ } })[slip]
camelia ( no output )
MadcapJake m: (gather { for 'a', 'b' ... * { say 'before'; take $_; say 'after' } })[2]
camelia rakudo-moar c40374: OUTPUT«before␤after␤before␤after␤before␤»
Sgeo Is Perl6's equivalent of 'yield from' something like `take for @foo`? 04:16
MadcapJake Sgeo: yep! :) I'm writing an article about generators right now
Sgeo MadcapJake, :D
take can't give back a value though, can it?
MadcapJake m: (gather { for 'a', 'b' ... * { say 'before'; take $_; say 'after' } })[2].say
camelia rakudo-moar c40374: OUTPUT«before␤after␤before␤after␤before␤c␤»
MadcapJake m: (gather { for 'a', 'b' ... * { say 'before'; take $_; say 'after' } }).say 04:17
camelia rakudo-moar c40374: OUTPUT«before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤before␤after␤b…»
MadcapJake m: (gather { for 'a', 'b' ... * { take $_; } })[0..10].say
camelia rakudo-moar c40374: OUTPUT«(a b c d e f g h i j k)␤»
MadcapJake m: (gather { for 'a', 'b' ... * { take $_; } })[10..20].say 04:18
camelia rakudo-moar c40374: OUTPUT«(k l m n o p q r s t u)␤»
04:18 BenGoldberg left
MadcapJake m: (gather { for 'a', 'b' ... * { take $_; take $_.ord } })[10..20].say 04:19
camelia rakudo-moar c40374: OUTPUT«(f 102 g 103 h 104 i 105 j 106 k)␤»
04:24 luser1 joined
luser1 mmh 04:24
04:24 luser1 left 04:31 mr-foobar left
sortiz MadcapJake++ # A much needed article 04:32
04:32 mr-foobar joined 04:34 khw left
MadcapJake m: my @breaks = gather { for 'a', 'b' ... * { take $_; take $_.ord } }; @breaks[0..5].say # why does this not work? 04:35
camelia rakudo-moar c40374: OUTPUT«(timeout)» 04:36
MadcapJake sortiz: any idea ^^ ?
04:40 pierre_ left
sortiz MadcapJake, when you assign an Iterable to an array, the inner for iterator tries to resolve. A 'while' should work. 04:40
Nested Iterables try to flat unless explicitly lazy. 04:42
MadcapJake ahhh I see, thanks! 04:46
sortiz m: my \Itr = (gather { my $i=0; while $i < Inf { take $i; $i++ }}); Itr[0..5].say 04:47
camelia rakudo-moar c40374: OUTPUT«(0 1 2 3 4 5)␤»
MadcapJake m: my \Itr = (gather { my $i=0; while $i < Inf { take $i; $i++ }}); Itr.shift.say 04:51
camelia rakudo-moar c40374: OUTPUT«Method 'shift' not found for invocant of class 'Seq'␤ in block <unit> at /tmp/6FjWDNw7Bm line 1␤␤»
04:52 telex left 04:54 telex joined, verzit joined 04:58 Cabanossi left 04:59 _28_ria left, macsnowball left 05:01 Cabanossi joined
sortiz m: my @a := Array.from-iterator((lazy gather { my $i=0; while $i < Inf { take $i; $i++ }}).iterator); say @a[10..20]; 05:04
camelia rakudo-moar c40374: OUTPUT«(10 11 12 13 14 15 16 17 18 19 20)␤»
sortiz MadcapJake, ^^
MadcapJake neat! will `shift` work? 05:05
m: my @a := Array.from-iterator((lazy gather { my $i=0; while $i < Inf { take $i; $i++ }}).iterator); say @a.shift.say; @a.shift.say;
camelia rakudo-moar c40374: OUTPUT«0␤True␤1␤»
sortiz :-)
MadcapJake awesome! There it is ladies and gentlemen, generators in Perl 6! :) 05:06
sortiz And using in a for will be on demand.
The problem with array assignment is that you should use bind, otherwise the compiler try to copy. 05:08
Other important detail is that if you are using an Array, the memory will be expanding, until fully reified, so an Scalar or sigilless var works better. 05:11
YMMV, eat fruits and vegetables. ;-) 05:12
MadcapJake Interesting, I'll mention this stuff in the article. Thanks!
sortiz m: my @a := Array.from-iterator((lazy gather { my $i=0; while $i < Inf { take $i; $i++ }}).iterator); for @a { state $i = 10; say $_; last unless --$i }; # A guarded for 05:18
camelia rakudo-moar c40374: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
05:19 rurban joined
sortiz Ah, and don't ask for .elems ;-) 05:22
05:26 hotel|netteiru left, hotel joined 05:35 Actualeyes joined 05:41 pierre_ joined 05:45 pierre_ left 05:55 huggable left, huggable joined 05:56 atweiden joined
atweiden m: multi sub is-valid-array(Str @) { True }; multi sub is-valid-array(Int @) { True }; multi sub is-valid-array(Real @) { True }; multi sub is-valid-array(Bool @) { True }; multi sub is-valid-array(Dateish @) { True }; multi sub is-valid-array(List @) { True }; multi sub is-valid-array(Associative @) { True }; multi sub is-valid-array(@) { False }; my @a = 1, 2, 3; say is-valid-array(@a) 05:56
camelia rakudo-moar c40374: OUTPUT«False␤»
05:57 mr-foobar left 05:58 mr-foobar joined
atweiden anyone know why `is-valid-array(Int @)` signature isn't being selected? 05:58
sortiz atweiden, 'cus my @a = ... is a simply Array, no matter what you put in the RHS 05:59
atweiden oh, right
sortiz multi sub is-valid-array(Str @) { True }; multi sub is-valid-array(Int @) { True }; multi sub is-valid-array(Real @) { True }; multi sub is-valid-array(Bool @) { True }; multi sub is-valid-array(Dateish @) { True }; multi sub is-valid-array(List @) { True }; multi sub is-valid-array(Associative @) { True }; multi sub is-valid-array(@) { False }; my Int @a = 1, 2, 3; say is-valid-array(@a); # See Int in the declaration. 06:00
Sgeo Perl6 doesn't have statically typed type families/associated types, does it?
sortiz m: multi sub is-valid-array(Str @) { True }; multi sub is-valid-array(Int @) { True }; multi sub is-valid-array(Real @) { True }; multi sub is-valid-array(Bool @) { True }; multi sub is-valid-array(Dateish @) { True }; multi sub is-valid-array(List @) { True }; multi sub is-valid-array(Associative @) { True }; multi sub is-valid-array(@) { False }; my Int @a = 1, 2, 3; say is-valid-array(@a); # See Int in the declaration.
camelia rakudo-moar c40374: OUTPUT«True␤»
Sgeo And/or functions that take and return types that are then statically checked? 06:01
atweiden m: multi sub is-valid-array(@ where {.grep(Str).elems == .elems}) { True }; multi sub is-valid-array(@ where {.grep(Int).elems == .elems}) { True }; multi sub is-valid-array(@ where {.grep(Real).elems == .elems}) { True }; multi sub is-valid-array(@ where {.grep(Bool).elems == .elems}) { True }; multi sub is-valid-array(@ where {.grep(Dateish).elems == .elems}) { True }; multi sub is-valid-array(@ where {.grep(List).elems == .elems}) { True }; mu 06:02
lti sub is-valid-array(@ where {.grep(Associative).elems == .elems}) { True }; multi sub is-valid-array(@) { False }; my @a = 1, 2, 3; say is-valid-array(@a)
camelia rakudo-moar c40374: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AbwqGl5M4l␤Undeclared routine:␤ mu used at line 1␤␤»
06:04 CIAvash joined, hotel_california joined 06:05 hotel left, pierre_ joined
stmuk ZoffixWin++ # perl6.party although I miss the DJing cats 06:13
06:15 domidumont joined 06:20 domidumont left 06:21 telex left, nadim joined, telex joined 06:22 domidumont joined 06:25 wamba joined 06:26 firstdayonthejob joined 06:29 mr-foobar left 06:37 firstdayonthejob left 06:40 Ven joined 06:44 jeek joined, atweiden left 06:50 go|dfish joined 06:51 zakharyas joined 06:58 nadim left 07:15 domidumont left 07:18 dolmen joined 07:23 jjido joined 07:32 nadim joined 07:37 darutoko joined 07:42 jjido left 07:46 nadim left 08:03 Actualeyes left 08:09 RabidGravy joined 08:10 dakkar joined 08:11 sjoshi joined 08:17 DarthGandalf left 08:20 CIAvash left 08:26 CIAvash joined 08:29 Actualeyes joined 08:39 jjido joined 08:47 wbill left, jjido left 08:55 jjido joined, cpage_ left
Roamer` hmm, am I right to assume that there's no way to 'use v6.c' on the perl6 command line? perl5 -M5.010 -e 'say "meow"' works, perl6 "cannot find" either v6.c or 6.c as a module 08:58
(thinking about making an alias / shell wrapper for perl6 -e 'use v6.c; ...', but it seems it can't really be done... not that my fingers aren't trained already :) 08:59
09:05 jjido left
RabidGravy arguably an infelicity as that would imply that the -M is using a different path to get the module 09:11
09:14 jjido joined
RabidGravy however having given it a moments thought , because the -M argument is a string whereas "v6.c" in the code is a Version it's tricky 09:17
jnthn Yeah, version is parsed as a distinct code-path from module names: github.com/rakudo/rakudo/blob/nom/....nqp#L1519 09:19
RabidGravy boom
on a completely different topic, there's no way of dealing with varargs in NC without a wrapper 09:20
09:24 jjido left
RabidGravy I so want to do "sub lo_send(Address $a, Str $path, Str $type, CArray *@args) is native...." 09:26
09:29 dolmen left
sortiz RabidGravy, dyncall is capable of do varargs marshaling but NYI in MoarVM. 09:31
RabidGravy it's not something that comes up very often but liblo is just one of those places 09:33
09:34 cpage_ joined
sortiz Are you actually using wrappers in your GDMB module. right? 09:35
09:35 Relsak joined, xinming_ is now known as xinming
sortiz s/GDMB/GDBM/ 09:36
RabidGravy well I've tried that, but I stopped working on it because it kept failing in different and unusual way 09:37
sortiz Umm, Can I give a try? 09:38
RabidGravy sure, what I have so far is at github.com/jonathanstowe/p6-GDBM 09:39
if you get it working you can have it, I only started it because someone asked 09:40
09:40 Ven left
sortiz My p6-LDMB is working, but that library is much less common. 09:40
And only supports 64bits machines. 09:41
RabidGravy :-\
sortiz otoh, is API is saner 'cus its datum is passed by ref, not by value as in GDBM. 09:43
*its API
sortiz need more coffee.
09:46 cpage_ left, TEttinger left 09:48 sjoshi left 09:52 pierre_ left 09:55 cpage_ joined, huggable left, huggable joined
ZoffixWin is finanalyst in here? 09:56
finanalyst yes
ZoffixWin: good evening (for me)
09:57 pierre_ joined
ZoffixWin finanalyst, RE github.com/finanalyst/ModuleCitation/issues/1 I meant a link to repo so people could send fixes. Like on this site there's a "Fork me on github" ribbon at top right corner: xtatik.org/ 09:57
It doesn't have to be a ribbon, but, for example, I see a markup error that makes a link unclickable right now. To submit a PR, I have to manually change finanalyst.github.io/ModuleCitation/ to github.com/finanalyst/ModuleCitation/ just to get to the repo... and if a user doesn't know this they won't be able to submit anything 09:58
Something like <a href="github.com/finanalyst/ModuleCitati...>GitHub Repo</a> in the footer should do. 09:59
Unless you like ribbons :P
finanalyst Zoffix: just seen the site you refered to
Quite nice - ribbons.
I'll put in a link to the github. 10:00
I thought it was sufficient to put in an email.
ZoffixWin There's a whole bunch of them: github.com/blog/273-github-ribbons
Yeah, but an email doesn't let me send a PR :P github.com/finanalyst/ModuleCitation/pull/3 10:01
10:02 cpage_ left, CIAvash left
finanalyst Ok. Like I said in my email, I am not used to pull requests. 10:02
10:02 _28_ria joined 10:03 cpage_ joined 10:08 sjoshi joined 10:11 dolmen joined 10:12 Ven joined
finanalyst ZoffixWin: Just update with data for today and a ribbon. I'd prefer the ribbon to be in the <div> for the definition, but it ain't. Not sure yet why. 10:19
10:21 kid51 joined
ZoffixWin Unsure what you mean. It looks fine to me. 10:24
Do you mean you want it in the footer and not the corner of the page? Just add position: relative to the container 10:25
10:26 wamba left 10:29 dolmen left 10:41 cpage_ left 10:42 brrt joined 10:50 spider-mario joined 11:02 AlexDaniel joined
AlexDaniel ZoffixWin: why .comb».uniname when you can do .uninames ? :) 11:03
m: "( ͡° ͜ʖ ͡°)".comb>>.uniname.say 11:04
camelia rakudo-moar c40374: OUTPUT«(LEFT PARENTHESIS SPACE DEGREE SIGN SPACE LATIN LETTER INVERTED GLOTTAL STOP SPACE DEGREE SIGN RIGHT PARENTHESIS)␤»
AlexDaniel m: "( ͡° ͜ʖ ͡°)".uninames.say
camelia rakudo-moar c40374: OUTPUT«(LEFT PARENTHESIS SPACE COMBINING DOUBLE INVERTED BREVE DEGREE SIGN SPACE COMBINING DOUBLE BREVE BELOW LATIN LETTER INVERTED GLOTTAL STOP SPACE COMBINING DOUBLE INVERTED BREVE DEGREE SIGN RIGHT PARENTHESIS)␤»
AlexDaniel hmmmm
jnthn They're not equivalent :)
The second is likely what's wanted most of the time, which is why it's there :) 11:05
The first takes each grapheme and gets the uniname of its first codepoint
ZoffixWin AlexDaniel, I just copy-pasted the previous person's eval
jnthn The second gets all the graphemes.
AlexDaniel m: "( ͡° ͜ʖ ͡°)".comb>>.uniprop.say 11:08
camelia rakudo-moar c40374: OUTPUT«(Ps Zs So Zs Ll Zs So Pe)␤»
ilmari m: "( ͡° ͜ʖ ͡°)".comb>>.uninames.say
camelia rakudo-moar c40374: OUTPUT«((LEFT PARENTHESIS) (SPACE COMBINING DOUBLE INVERTED BREVE) (DEGREE SIGN) (SPACE COMBINING DOUBLE BREVE BELOW) (LATIN LETTER INVERTED GLOTTAL STOP) (SPACE COMBINING DOUBLE INVERTED BREVE) (DEGREE SIGN) (RIGHT PARENTHESIS))␤»
AlexDaniel jnthn: this reminds me that we don't have .uniprops 11:09
ilmari m: "( ͡° ͜ʖ ͡°)".ords>>.uniprop.say
camelia rakudo-moar c40374: OUTPUT«(Ps Zs Mn So Zs Mn Ll Zs Mn So Pe)␤»
AlexDaniel ooooh 11:10
11:10 pierre_ left
AlexDaniel m: "( ͡° ͜ʖ ͡°)".ords>>.uniname.say 11:11
camelia rakudo-moar c40374: OUTPUT«(LEFT PARENTHESIS SPACE COMBINING DOUBLE INVERTED BREVE DEGREE SIGN SPACE COMBINING DOUBLE BREVE BELOW LATIN LETTER INVERTED GLOTTAL STOP SPACE COMBINING DOUBLE INVERTED BREVE DEGREE SIGN RIGHT PARENTHESIS)␤»
11:11 Ven left 11:15 sjn_phone joined, sjn_phone left 11:19 itaipu joined, boegel left 11:21 boegel joined 11:22 finanalyst left 11:26 brrt left 11:35 itaipu left 11:37 itaipu joined
dalek rl6-most-wanted: 50da954 | (Michael Vu)++ | most-wanted/modules.md:
Update modules.md

Some like Pinto in house cpan for perl6
11:44
rl6-most-wanted: 8c394da | titsuki++ | most-wanted/modules.md:
Merge pull request #29 from mvu8912/patch-1

Update modules.md
11:51 jjido joined 11:55 kid51 left 11:57 itaipu left 12:06 huggable left 12:07 Ven joined 12:15 domidumont joined 12:22 domidumont left 12:25 Ven left 12:30 huggable joined 12:33 pierre_ joined
AlexDaniel huggable: poor creature :( 12:37
huggable AlexDaniel, nothing found
12:38 perlawhirl joined 12:42 ZoffixW joined
ZoffixW AlexDaniel, why poor? 12:42
AlexDaniel ZoffixW: quit, join, quit, join… :)
ZoffixW heh 12:43
Yeah. I have her restarting every 4 hours.
awwaiid I have my quit/join notifications turned off :)
ZoffixW Except for right now... I restarted the wrong server by mistake and forgot to start her again :P
awwaiid every now and then I talk to someone who isn't there (though tab-complete usually helps), but otherwise cuts out tons of noise
ZoffixW tries to imagine an async response with Bailador 12:47
Right now it's surprisingly easy to DoS perl6.party just ask it to run sleep 30; in one of the code samples :P 12:48
a start { render ..whatever.. } and return Nil, I'm guessing... Whatever "Return Nothing" in the docs means :S
masak hi #perl6 12:49
I have a discussion topic for today
ZoffixW For the whole day? :D
masak or, you know, parts of it
ZoffixW :)
What's the topic? 12:50
masak when I switched from Bailador to HTTP::Server::Tiny, I forwent the nice one-route-one-sub structure 12:51
instead everything got crammed into a single `sub app(%env)`
ZoffixW Sounds horrible :)
masak in retrospect I don't know why I accepted that
ZoffixW What's the discussion topic for today that you have? 12:52
masak I'm getting to it :)
commit github.com/masak/nex/commit/85340b...e93a01ed30 fixes the problem -- re-instating one sub per route
so the insight in the specific is that just because I change to HTTP::Server::Tiny, I don't have to forego the nice structure of my app 12:53
the insight more generally is that we as developers have both the opportunity and the responsibility to Have Nice Things
12:53 itcharlie joined
masak by structuring our programs/systems to expose what's important 12:53
I find it hard to express this in a good way 12:54
but we have a strong tendency to, um, cargo-cult or appropriate someone else's structure
12:55 verzit left
masak rather than building the structure we need for the job at hand 12:55
ZoffixW I find a lot of content type and HTTP codes in that snippet. I wouldn't call those bits important in a web app.
12:55 verzit joined
masak yeah; there's still a bit of repetition there 12:55
ZoffixW As in, I don't care about that and don't wanna see it. I care about content my app generates, not HTTP protocol
masak I could probably hide those bits away in a sub, too 12:56
ZoffixW But I see what you mean. I do feel like there should be some better way to structure web apps than a bunch of subs for route definitions :)
masak that wasn't my point, but OK :)
ZoffixW lol, OK :)
masak my point was that I just blindly accepted that I'd have to put everything directly inside `sub app(%env)` (just like all the examples), even though I really preferred the way Bailador structures it, with individual subs 12:57
ZoffixW Ah 12:58
masak this commit gives me back my individual subs, with minimal overhead (just a small switch statement left in `sub app(%env)`
ZoffixW But why did you go away from Bailador?
masak because I wanted SSE
and HTTP::Server::Tiny has it, and Bailador doesn't, and it is't trivial to add to Bailador
isn't*
moritz what's SSE? 12:59
masak Server-Sent Events
in this particular case, the server going "hey, $client! $opponent made a move!"
MadcapJake I think what masak is saying is that we have a tendency to think that a given module's structure comes from some underlying magic but often times, the general layout that a particular model supports is really just a design choice that we can easily replicate. Is that close, masak? :)
moritz how does that work technically? through websockets?
masak MadcapJake: very.
MadcapJake: I'd say "easily replicate or even improve upon"
moritz: no, it's a separate protocol. 13:00
ZoffixW *sigh* and IE is being the slow kid on SSE too: en.wikipedia.org/wiki/Server-sent_...b_browsers
masak moritz: websockets are bidirectional, SSE is just from server to client
ZoffixW spots Mojolicious on the list of supported frameworks
masak ZoffixW: since my user base is basically me and another guy, I can afford not to worry about IE
ZoffixW: but isn't there some polyfill or something one can use for IE? 13:01
ZoffixW masak, no idea. I didn't know what SSE was until you mentioned them :)
masak html5please.com/ seems to say there is
13:02 Sgeo left
moritz the wiki page is very light on technical details 13:03
"Event streams are always decoded as UTF-8. There is no way to specify another character encoding." I love it 13:04
from www.w3.org/TR/eventsource/
13:07 finanalyst joined
arnsholt Praise the encoding gods! 13:07
13:07 Emeric joined
masak moritz: html5doctor.com/server-sent-events/ is probably a more thorough introduction 13:10
in many ways it seems to be a simpler, more streamlined version of web sockets
RabidGravy and really, really simple to implement with HTTP::Server::Tiny 13:11
masak yeah -- wow 13:12
such a nice mapping between supplies and SSE! o.O
RabidGravy I really ought to get round to making a client thing for it 13:13
13:14 finanalyst left, ZoffixW left
RabidGravy the hack I made for the couchdb changes feed is sufficiently appalling that I may take it out before I release Sofa 13:15
masak the quote in www.thebigquestions.com/2014/11/13/...sing-sea/, starting with "Most mathematicians take refuge within a specific conceptual framework...", captures what I wanted to say about programming 13:16
that is, we often forget just how malleable our medium is
and what we really are, or should be, like Grothendieck, are builders of mansions
jnthn masak: Anything about SSE that makes it even more supply-nice than web sockets? :)
jnthn didn't look at SSE at all... 13:17
zostay grondilu: answering your question from last night, i would do something like this: -> |c { if c.elems == 0 { 'degen' } else { 'op' ~ c[0] ~ c[1] } } 13:18
masak jnthn: dunno enough about web sockets to answer that.
jnthn: I just find it Verra Nice that someone++ actually mapped supplies to SSE, so that it's really effortless to use SSE that way
13:20 skids joined
jnthn masak: Yeah, it's exactly the kind of case I'd imagined supplies being really nice for :) 13:20
RabidGravy web sockets work nicely with supplies too
jnthn RabidGravy: Cool...what should I look at if I want to play with that, ooc? 13:21
masak "play with" as in use, or as in implement?
RabidGravy start at github.com/jonathanstowe/Lumberjac...ket.pm#L74 and work backward ;-) 13:22
masak to a first approximation, it seems to me SSE are preferable in both cases ;)
(though of course we'll probably want ecosystem support for both)
RabidGravy the WebSocket module works nicely
jnthn masak: use
masak: I'd always thought it'd be cool to do a supplies demo involving web sockets in a talk some day, and I'm plenty happy not to have to implement it to show it off ;) 13:23
masak jnthn: I don't know why the average app would need something bidi like WebSockets, when ordinary HTTP requests already go one of the ways
jnthn: and so SSE seems like the sane kind of simplification that always seems to succeed a first slightly over-engineered solution, IMHO 13:24
jnthn masak: hmm, interesting :)
13:25 sena_kun joined
masak also, SSE feels much more aligned with HTTP/web in general 13:25
when you get down to it, the only difference to an ordinary HTTP response is `Content-Type => 'text/plain; charset=utf-8, text/event-stream'` 13:26
(and then the server doesn't hang up, but keeps sending lines)
RabidGravy I'm not entirely sure, SSE is really good for things like the CouchDB changes feed but not so convenient when you want to implement a sort of "inner protocol" that is bi-directional
websockets are more like a glimpse of HTTP/2 13:27
13:27 prammer joined
AlexDaniel RabidGravy: yea 13:27
masak that's an interesting counterpoint. haven't thought of it that way. 13:28
geekosaur knows at least one program that needs websockets 13:29
13:29 DarthGandalf joined
geekosaur (it's an online game so needs to be able to send player actions back to the server, and with lower overhead than POST) 13:29
masak sounds legit, yes 13:31
13:31 wamba joined
RabidGravy tries to find the streaming source client that is made with ws 13:32
oh yeah github.com/savonet/liquidsoap/pull/90 13:35
I forgot that it got it in 1.20 13:36
13:36 pmurias joined
awwaiid looks like there is a polyfill for SSE on IE, github.com/remy/polyfills/blob/mas...tSource.js 13:38
pmurias jnthn: my $foo;nqp::takedispatcher('$foo') gets broken by the NQP::Optimizer? should I stop the optimizer from turning it into a local? 13:39
jnthn pmurias: I think takedispatcher is only relevant to Rakudo, and its optimizer knows about it. 13:41
pmurias: Which is why we'd have gotten away with that. :) 13:42
Guess you discovered it while writing a test? :)
13:45 mr-foobar joined
pmurias jnthn: yes 13:46
13:52 nebg joined
nebg hello everyone... is perl6 based on JVM ? 13:52
tadzik no 13:53
MadcapJake Perl 6 as implemented in Rakudo has a JVM backend, but it's not entirely stable yet
tadzik perl6 is a language, not bound to any particular implementation
rakudo, the major perl6 compiler can run on jvm, but doesn't have to
RabidGravy magic pixies
perlpilot Rakudo has a magic pixie backend too? 13:55
masak .oO( Perl 6 is a language, and not bound by puny human whims )
timotimo puny human jvm 13:56
jnthn pmurias: I guess teaching the NQP optimizer about it to easy testing is OK enough :) 13:57
masak ZoffixWin: I made a commit, just for you: github.com/masak/nex/commit/62aaf4...d23788b339 13:59
wow, but the diff is confusing
sometimes it feels as if diffs could be a lot more clever if they just paid attention to block boundaries 14:00
14:00 Actualeyes left
perlpilot masak: that's why I think someone should make a "human diff" that chunks things as a human would 14:00
of course, it would need to be much smarter about some things and require "knowing" what it's diffing. 14:01
(I bet someone has already done something like this, I just don't know about it)
masak yes, I've seen that at times
I don't know how those work, though
it might help to diff with respect to the parse tree somehow, for example 14:02
timotimo there's the "patience diff" algorithm
that has some heuristic that makes diffs better for humans to read
tony-o is there a mechanism in perl6 to run code in the main thread and force the rest of the processing to occur in another? 14:03
IE, if i wanted to continue to read from $*IN while the rest of the process does its thing
timotimo i'm still convinced we shouldn't give the "socket from non-originating thread" warning for regular file descriptors 14:05
but i got no back-up for that opinion
tony-o i'll back you up
jnthn Removing the warning wouldn't suddenly make $*IN readable from another thread. 14:06
tony-o er, is that because we should be able to read those?
timotimo i shouldn't call it "warning", as it's a error actually
jnthn: i *think* the problem doesn't actually happen with file descriptors
jnthn $*IN isn't a file descriptor though
It's a tty, handled as a uv_stream
So pretty sure it's vulnerable
timotimo well ... crap :( 14:07
jnthn And yes, it wants fixing.
But that's harder than "rip out the error" :)
tony-o there were side effects when you tried copying the $*IN context into the new thread, no?
s/context/handle/
nebg tadzik, ok so what's the advantage in runnning rakudo in JVM ? why should i do that ? 14:10
timotimo you can expect it to be less buggy than whatever we made :P 14:11
its GC is good, its optimizer is frighteningly good
Roamer` Well this is fun... Is this known? chdir "some/path"; "subdir".IO.dir; works fine, but if I chdir "some/path/" with the trailing slash, then .IO.dir removes the first letter of the subdir's name :)
not sure if I can golf it here, I wouldn't want to get the bot in trouble for doing filesystem ops :) 14:12
but perl6 -e 'use v6.c; chdir "foo/"; "conf".IO.dir.perl.say;' if you have foo/conf/
awwaiid Has anyone submitted a Perl6/Rakudo talk to StrangeLoop yet? I'm going to submit one. 14:13
14:14 tharkun left
perlpilot Roamer`: Confirmed. Can you rakudobug that? 14:14
Roamer` perlpilot, sure, coming up
perlpilot, thanks 14:15
perlpilot Roamer`: no, thank you! :)
14:15 pierre_ left, tharkun joined 14:16 perlawhirl left
AlexDaniel Roamer`: that's a good one :D 14:17
[Coke] nebg: If you require interop with jvm jars, or if, e.g., you're in a corporate environment that is java only. Basically, if you need the jvm for some reason. (maybe the jvm works on your obscure platform, and MoarVM does not)
but if you don't know if you care? use the default, MoarVM.
perlpilot Roamer`: it's worse. if you chdir "foo/////"; it'll change the the foo directory, but "conf".IO.dir.say will remove one letter for each / 14:18
awwaiid man oh man. Strange Loop is a conference that was practically MADE for perl6, and yet I think nobody here knows/cares about it. What's the deal? 14:19
tadzik nebg: mostly if you want to interact with Java libraries 14:20
AlexDaniel m: chdir ‘/temp/’; ‘.’.IO.dir.say
camelia rakudo-moar 810788: OUTPUT«Failed to change the working directory to '/temp/': does not exist␤ in block <unit> at /tmp/FbwH37txlH line 1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp line 3055␤ in block <unit> at /tmp/FbwH37txlH line 1␤␤»
AlexDaniel m: chdir ‘/tmp/’; ‘.’.IO.dir.say
camelia rakudo-moar 810788: OUTPUT«("/tmp/2yamldata-M2wvA1".IO "/tmp/X11-unix".IO "/tmp/ICE-unix".IO "/tmp/XIM-unix".IO "/tmp/font-unix".IO "/tmp/Test-unix".IO "/tmp/rat9uqe4F".IO "/tmp/XajBf20V7".IO "/tmp/_kUNwvxo8".IO "/tmp/zUJ6dIrZV".IO "/tmp/MgpnqBzo8".IO "/tmp/sperfdata_camelia".IO "/t…»
tadzik I heard those speed rumours, but I haven't seen any data to back it up in a while :)
AlexDaniel well, that's not what I meant
m: chdir ‘/tmp/////////////’; ‘.’.IO.dir.say 14:21
camelia rakudo-moar 810788: OUTPUT«Start argument to substr out of range. Is: 18, should be in 0..14; use *-18 if you want to index relative to the end␤ in block <unit> at /tmp/a0I_JgRH2f line 1␤␤Actually thrown at:␤␤»
perlpilot Roamer`: and apparently, you get "Start argument to substr out of range." if you've got more / than your subdir has characters
AlexDaniel m: chdir ‘/tmp/////’; ‘.’.IO.dir.say
camelia rakudo-moar 810788: OUTPUT«("/tmp/ldata-M2wvA1".IO "/tmp/unix".IO "/tmp/unix".IO "/tmp/unix".IO "".IO "".IO "/tmp/uqe4F".IO "/tmp/f20V7".IO "/tmp/wvxo8".IO "/tmp/dIrZV".IO "/tmp/qBzo8".IO "/tmp/fdata_camelia".IO "/tmp/UnG1w".IO "/tmp/smwll".IO "/tmp/OWR8X".IO "/tmp/uYXcM".IO "/tmp/a…»
AlexDaniel there you go
ok, the problem is not only with the trailing slash 14:23
perlpilot Hmm. and it looks like it depends on whether or not your path starts with a / or not too
AlexDaniel perl6 'chdir ‘foo////conf’; ‘.’.IO.dir.say'
it does not
perlpilot no, I mean it still breaks, but you get different behavior 14:24
AlexDaniel oh
perlpilot meeting &
AlexDaniel Roamer`: perhaps consider mentioning that it is not just about a trailing slash
Roamer`: ah, you already rakudobugged
Roamer`++
14:25 tharkun left, tharkun joined 14:27 huggable left 14:29 Actualeyes joined 14:30 khw joined
MadcapJake awwaiid: location-wise I'd totally go to Strange Loop, if I have some (a lot of) spare cash by the time registration opens, I might do it! That's a big "if" though :) 14:33
14:34 sjoshi left
tbrowder help: executing 'perl6 --help' says to consult the 'perl6(1)' man page but I can't find it, any hints? 14:35
timotimo oh, yeah, do we even have a perl6 manpage anywhere? 14:37
like, do we actually have a source file that'd end up as a man page?
tbrowder I have been looking for the perl6 source but haven't found it so far...
awwaiid MadcapJake: submit a talk and maybe they'll pay for you to go :) 14:39
tbrowder maybe the docs (Language) should have a new section on perl6 the executable, and maybe Perl 6 pod, too...
awwaiid tbrowder: github.com/rakudo/rakudo
MadcapJake I am not worthy! :) Have you seen some of their videos!? Strange Loop talks are for angel-invested startups and PhDs :P 14:40
tbrowder: I don't see any manpage files in rakudo: github.com/rakudo/rakudo/search?ut...;type=Code
awwaiid MadcapJake: can't win if you don't play :) 14:41
tbrowder: for the documentation source, github.com/perl6/doc 14:42
MadcapJake Maybe someday I'll do something cool enough for StrangeLoop but that day isn't any day in the near future :P
14:43 cdg joined
awwaiid hehe 14:43
tbrowder the perl6 executable is a bash script executing 'rakudo/install/bin/moar'
awwaiid Well I'm submitting a Perl6/Rakudo talk, so being cool by-proxy :)
MadcapJake sweet! I look forward to (at least) watching it on YouTube! :)
awwaiid There are several Perl6 topics that are worthy -- you can basically take any one of the major language features and do a 40 minute talk on it. Type system, Concurrency system, Metaprogramming system, Implementation of Rakudo, Using Cross-Language Libraries... basically any of jnthn talks 14:45
So, IMO, we should collectively be submitting 7 or so talks 14:46
tony-o timotimo: i take that to mean there is no mechanism for me to kind of hijack the main loop and continue processing in another thread?
MadcapJake awwaiid: flood the conference with Perl 6! :)
timotimo we don't implement the kansas city shuffle yet
awwaiid I am only allows to submit 2. So everyone HERE needs to submit some
And I'd totally pitch in to sponsor TimToady giving a talk there. I hereby pledge $100 if there is interest. 14:48
tony-o lol 14:49
MadcapJake this article I'm writing about generators is quickly turning into an exegesis on coroutines, I could see it being a presentation...
awwaiid DO IT 14:50
The thing is when you submit you only need the abstract. Talks due May 9th. Conference is Sept something ... that's a LONG time to procrastinate making slides!
14:51 jjido left
awwaiid And if nothing else if there are several p6 talks maybe one of them will get in :) 14:51
14:53 rindolf left, kurahaupo joined 14:55 jjido joined 14:59 rindolf joined
dj_goku timotimo: what is the kansas city shuffle? I am in KC and haven't heard that before. 15:02
timotimo just a random quote from one of the best movies ever made :)
(lucky number slevin)
DrForr I would ask "where is this?" but I've already booked quite a few conferenes... 15:03
*conferences
15:03 azawawi joined
dj_goku timotimo: lol 15:03
azawawi hi :)
arnsholt: ping 15:04
15:04 zakharyas left
azawawi .seen arnsholt 15:04
yoleaux I saw arnsholt 13:07Z in #perl6: <arnsholt> Praise the encoding gods!
15:05 kaare_ joined
timotimo it really is a pretty damn good movie 15:05
15:05 zakharyas joined
azawawi timotimo: which one? 15:05
timotimo lucky number slevin 15:06
azawawi yup
MadcapJake This is wrong: en.wikipedia.org/wiki/Coroutine#Im...s_for_Perl
azawawi so i have the zeromq book on my reading list for this weekend :) 15:07
what's the status of github.com/arnsholt/Net-ZMQ?
MadcapJake Yes Perl 6 has coroutines but no, the RFC linked is for generators and isn't even in the current Perl 6 spec :P
timotimo urgh 15:08
tbrowder the perl6 man page pod seems to be "rakudo/rakudo/docs/running.pod" 15:09
it needs to be made to install with rakudobrew somehow...
15:11 nebuchadnezzar left
MadcapJake and converted to manpage format 15:11
timotimo the latter part is easy 15:13
azawawi .tell arnsholt is Net::ZMQ still being maintained? 15:15
yoleaux azawawi: I'll pass your message to arnsholt.
tbrowder timotimo: this doesn't work: perl6 --doc=man (or MAN or Man) running.pod; so how to do it (with perl 5?) 15:16
timotimo yeah, with perl5 i'd expect
tbrowder sounds kind of lame, but I guess that's the state of Perl 6 pod at the moment 15:17
timotimo nothing (except a whole lot of pain) stops anybody from building Pod::To::Roff 15:19
15:19 ggoebel114 joined, jjido left 15:20 nebuchadnezzar joined, Actualeyes left 15:21 jameslenz left 15:22 Emeric left, jameslenz joined 15:26 aindilis` left 15:28 azawawi left, M-matthew joined
tony-o ZoffixWin: data-dump should be corrected and ready for your dumping 15:30
15:31 aindilis joined
Woodi hi #perl6 :) 15:38
do s/return/tail/ could be proper TCO in moust cases ? just clear current frame and setup new... probably not compatible with captures. 15:41
uruwi How to reinstall a module with panda? 15:43
jdv79 use --force?
RabidGravy anyone fancy porting moarvm to a quantuum computer? developer.ibm.com/bluemix/2016/05/...n-bluemix/ 15:44
uruwi That didn't help
jdv79 what's the problem? 15:45
uruwi It's exactly the same as if I didn't use --force
RabidGravy which is? 15:46
uruwi It refuses to install a module because it's already there
jdv79 what is the cmd line you used?
RabidGravy er
jdv79 i think the --force has to be first, right? 15:47
uruwi panda --notests Compress::Zlib --force
putting --force first just prints a usage message
Woodi as for subject of a day: www.posteriorscience.net/?p=206 so, academia give up in 1997 :) but things realy are like that - programmers moustly use libraries and not construct things from ground up. even on that channel "algorithm" is not frequent thing (generally: probably it's effect of using OO); and "domain" thingies are moust scared domains - WHAT THAT USERS REALY EXPECT???! ;) 15:48
RabidGravy panda --notests --force install <module> # works for me 15:49
uruwi Nope, I might have an outdated version.
jdv79 update all the things 15:50
uruwi I just updated Rakudo to 2016.04 using the msi installer
Might not have updated Panda as well 15:51
jdv79 yeah, panda --notests --force install JSON::Tiny worked for me
uruwi Is there some way to see the panda version? 15:52
jdv79 panda info Panda ? 15:53
uruwi Well got the info but no version. 15:54
Trying to install Panda from source produces an error message.
jdv79 idk about windows 15:55
uruwi (while testing)
Yeah, but thanks anyway
15:55 sufrostico joined
dakkar I'm looking at NativeCall on MoarVM; if I have a «class Foo is repr('CStruct')», it looks to me that, when the GC decides to free it, MoarVM will just do MVM_free (which is the libc's "free") on it 16:01
pmichaud good morning, #perl6
dakkar so… what happens if I need to call a C library function to free the resources associated with that CStruct? like, maybe I have an opaque CPointer in there that must be freed by some special call 16:02
I don't see a way to do it, but I suspect I'm missing some piece. help?
RabidGravy method DESTROY gets called when the GC takes the object 16:06
JimmyZ pmichaud: \o
pmichaud: long time no see :) 16:07
dakkar RabidGravy: ah, so that call happens before the GC invokes the "gc free" slot in the repr structure 16:08
RabidGravy I believe so
dakkar ok, now a harder problem: the C function I have deallocates *the entire struct*, not a piece of it
so after my DESTROY, the pointer is no longer valid
timotimo you mean it follows pointers and deallocates those objects, too? 16:09
dakkar timotimo: that too
for reference, I'm looking at xmlFree from libxml2
RabidGravy yeah the chromaprint thingy does that too
dakkar which has lots of *interesting* logic, that does not seem to play well with a GC
I'd love to be able to tell MoarVM "I have taken care of all these objects, consider them freed" 16:10
timotimo are you sure moar calls free on the struct itself?
dakkar timotimo: well, it wants to; it's currently commented out because «For some reason, this causes crashes at the moment» 16:11
timotimo yeah 16:12
it should care about whether it owns the blob or not
like, when you nativecast, it wouldn't own the blob
or for that matter if a function returns the struct for you 16:13
dakkar oh gods, I hoped to be able to forget about pointer ownership
timotimo impossible when you're dealing with C 16:14
dakkar at the moment, my hunch is that, if I want a working libxml in perl6, I need to have P6Opaque objects that have a CPointer, track ownership on the p6 side, and call the C destructors from the p6 destructors
masak dakkar: pointer ownership might not be worth forgetting about. oftentimes it feels quite related to the design itself; getting the ownership wrong can mean getting the design wrong... 16:15
dakkar masak: brings back bad memories of when I was working with C++ 😕 16:16
and when the design is someone else's… bah
I liked the idea of just declaring structs and relying on NativeCall, but I was probably dreaming of too much magic 16:17
any library that manages memory in non-trivial ways (e.g. libxml, glib/gtk) needs careful proxying, probably
also: how do I test the interaction between destructors and GC? 16:19
16:19 dwarring left
RabidGravy there is a way of forcing the gc to run, can't remember what it is though 16:20
dakkar nqp::gc() or somesuch
I should probably start writing some code and see what happens… 16:21
16:21 nebuchadnezzar left
dakkar (then try it on the JVM and see what *else* happens) 16:21
16:27 rurban left 16:30 Actualeyes joined
RabidGravy dakkar, a brute force test here seems to suggest that nothing bad happens if you free something that is being GCd 16:35
gist.github.com/jonathanstowe/73dc...7784c0a345
dakkar CPointer does not have a gc_free slot callback 16:36
CStruct does :)
timotimo that's right
RabidGravy ah
dakkar on the other hand, I can't seem to get DESTROY called
timotimo when you .new a CStruct, we'll allocate stuff for you
pmurias does MoarVM really free pointers it received from a C library?
timotimo dakkar: it's not guaranteed to run
16:37 nadim joined
timotimo pmurias: not CPointers, but if you cast a CPointer to a CStruct ... who the hell knows :) 16:37
dakkar timotimo: not at all, or "not timely"?
RabidGravy well that one ^ starts calling the DESTROY after ~ 3000 iterations
dakkar oh, it was being called, I was just not looking in the right place 16:38
still nearly untestable, though: *some* objects get DESTROYed, even if I call nqp::force_gc() 16:39
16:40 rurban joined, sufrostico left
RabidGravy well, changing the CPointer to a CStruct there and still nothing bad happens 16:40
16:43 domidumont joined
dakkar RabidGravy: because MoarVM is not really calling free() github.com/MoarVM/MoarVM/blob/mast...uct.c#L668 16:43
16:43 itcharlie left
dakkar memory management is hard! 16:44
anyway, hometime here, I'll look again sometime in the (near?) future
Xliff_ Oh damn. I missed this discussion. 16:45
16:45 ZoffixW joined, pmurias left
Xliff_ dakkar: Does libxml2 return structs or are you allocating them? 16:46
timotimo dakkar: definitely not timely, but potentially not at all, as we won't call DESTROY when the process exits.
dakkar Xliff_: returns *trees* of structs, and xmlFree frees entrie trees :(
timotimo: ok, process exit is a special case I can live with 16:47
Xliff_ dakkar: Are you getting SEGVs when you use xmlFree?
dakkar Xliff_: I haven't even started writing the code
Xliff_ Coz if C-lib returns struct, you are on your own.
P6 won't do anything, that I've seen.
dakkar I want to understand what to expect, and have some testing strategies
ZoffixW tony-o, thanks. I'll test it out and will respond on the issues in about 7 hours. 16:48
16:48 ZoffixW left
dakkar goes home for real 16:48
16:48 pmurias joined
dakkar thanks all for the pointers (pun intended) 16:48
16:50 jjido joined
timotimo :) 16:51
16:53 Actualeyes left, dakkar left, azawawi joined
azawawi . 16:54
.seen RabidGravy
yoleaux I saw RabidGravy 16:40Z in #perl6: <RabidGravy> well, changing the CPointer to a CStruct there and still nothing bad happens
16:55 m0ltar left, rurban left 16:56 jjido left
RabidGravy harr! 16:58
was just outside in the garden
17:00 m0ltar joined
azawawi RabidGravy: im here eating sunflower seeds and pondering what my next project will be :) 17:04
rindolf azawawi: ah, you like subflower seeds too? 17:07
sunflower.
azawawi rindolf: time flies when you're eating them :)
rindolf azawawi: yes. 17:08
RabidGravy I think you want to make http::useragent able to feed a supply with chunked data
azawawi RabidGravy: or build a proper Net::ZMQ :)
RabidGravy I actually have a half fixed fork somewhere 17:09
'ang on
azawawi zguide.zeromq.org/pl:_start # Perl
timotimo do sunflower seeds have some psychoactive substance in them that i'm not aware of? 17:10
grondilu salt, maybe 17:11
azawawi timotimo: not that im aware of... also non-salty :)
grondilu I tried some lately. Very salty and tough to get to the actual edible part. Maybe I don't know how to consume these things. 17:13
azawawi grondilu: get the non-salty version :)
RabidGravy: so did you find it? :) 17:14
perigrin w/ 37 17:15
17:15 sufrostico joined
RabidGravy github.com/jonathanstowe/Net-ZMQ - still fails tests but they run :) 17:17
azawawi RabidGravy: great.
RabidGravy++ 17:18
timotimo cool
17:19 firstdayonthejob joined
azawawi RabidGravy: are you using Net::ZMQ in other projects? 17:20
RabidGravy no
azawawi i remember it was used for a perl6 ikernel (ipython)
github.com/timo/iperl6kernel
17:24 yasnothil left
MadcapJake how can you use a class method as a map block? 17:24
17:27 lichtkind_ is now known as lichtkind
RabidGravy well the easiest way would be to close over the instance in the block 17:27
MadcapJake is there any to to directly access it? something like Foo::<&new> ? (though that doesn't work) 17:29
ugexe m: class Foo { method bar { -> $a { say $a; }; }; }; (1..4).map(Foo.new.bar) 17:30
camelia rakudo-moar 810788: OUTPUT«1␤2␤3␤4␤»
17:30 m0ltar left 17:31 m0ltar joined
pmurias MadcapJake: is something like -> $arg {Foo.new($arg)} not good enough? 17:32
MadcapJake no that'll be fine just was curious if there was a way to treat a method like a &routine 17:33
RabidGravy m: class Foo { method bar(*@ggh) { say @ggh } }; my $f = Foo.new; my &foo = $f.can("bar")[0]; my &bar = &foo.assuming($f); &bar(1,2)
camelia rakudo-moar 810788: OUTPUT«[1 2]␤»
MadcapJake seems to work for ugexe there but with new, I can't get it to work
17:33 azawawi left
RabidGravy or more specific to your request 17:36
m: class Foo { method bar(*@ggh) { say @ggh } }; my $f = Foo.new; my &foo = $f.can("bar")[0]; my &bar = &foo.assuming($f); <a b c>.map(&bar)
camelia rakudo-moar 810788: OUTPUT«[a]␤[b]␤[c]␤»
17:37 pmurias left
MadcapJake neat! just too verbose :) 17:37
RabidGravy scared of typing or something? 17:38
MadcapJake lol no it's just I can save myself the trouble of doing that by just doing this the normal way, I was looking for a shorthand notation for instantiating several classes in a single statement 17:39
my ($a, $b, $c) = map Foo::<&new>, <name1 name2 name3>;
timotimo the thing is you have to bind the invocant somehow, unless you want to call the method with the things in the list-mapped-over as the invocant 17:41
MadcapJake I thought maybe it would work for undefined classes 17:42
RabidGravy you can "assuming" with the type object if it's a constructor
MadcapJake ahh!
pmichaud why not simply: my ($a, $b, $c) = map *.new, Foo, Bar, Baz; 17:43
which creates an instance of Foo, Bar, and Baz
MadcapJake that's nifty! but I want to iterate over a list of constructor arguments not classes 17:44
pmichaud ah, I saw "instantiating several classes in a single statement".
so: my ($a, $b, $c) = map Foo.new($_), <arg1 arg2 arg3>; 17:45
er
so: my ($a, $b, $c) = map {Foo.new($_)}, <arg1 arg2 arg3>;
MadcapJake ok yeah! that's really the best option. Thanks pmichaud! 17:46
RabidGravy m: class Foo { has $.name; multi method new($name) { samewith(:$name) } }; my &foo = Foo.can("new")[0]; my &bar = &foo.assuming(Foo);say <a b c>.map(&bar)
camelia rakudo-moar 810788: OUTPUT«(Foo.new(name => "a") Foo.new(name => "b") Foo.new(name => "c"))␤»
MadcapJake nice! I've never used samewith (is it in the docs?) 17:48
timotimo m: my ($a, $b, $c) = (Array.new($_) for <foo bar baz>)
camelia ( no output )
timotimo ^- a bit shorter still
hm. not actually shorter. but it feels shorter 17:49
well, it does get rid of curlies and a comma
RabidGravy I'm not actually sure that any of the (same|call|next)(same|with) are documented 17:50
17:51 rodarmor joined
RabidGravy and there should be a samesame for completeness ;-) 17:51
MadcapJake some of them are in doc.perl6.org/language/functions#Re-dispatching 17:52
timotimo "how are you doing?" "samesame"
17:52 jjido_ joined
RabidGravy but samewith, if it isn't documented, calls a multi candidate with the appropriate arguments 17:54
17:57 bdmatatu joined
RabidGravy well it does that if it is documented as well 17:57
ugexe s12 under calling sets of methods 17:58
perlpilot timotimo: would samesame be for calling the same method with the same args, but without introducing another call frame? 17:59
er, RabidGravy
RabidGravy :)
18:00 zakharyas left
perlpilot Sometimes I think there should be an alternate version of the synopses where the universe is just slightly askew and all of the almost-crazy ideas are in there. 18:01
MadcapJake that'd be sweet! :)
RabidGravy I thought that *was* the synopses ;-) 18:02
MadcapJake a world where programmers are scorned for including too much whimsy in everything they do :)
18:03 firstdayonthejob left
perlpilot RabidGravy: right, the current synopses are askew relative to the normal universe, we need some that are twisted just a little bit more. ;) 18:03
MadcapJake INTERPERL 18:06
pmichaud one could certainly create a "rfc" repository or an "rfc" tag in a ticket system to hold the crazy ideas
timotimo more like "rfl" - request for laughs 18:07
pmichaud request for crazy
geekosaur [Acme]
MadcapJake wrote a program to count vowels/consonants in complete shakespeare texts and naive version is looking like it will take quite a long time... 18:08
RabidGravy so when IBM sends you an email to reset your password, the link in the message results in a 502 18:09
un-good 18:10
18:10 cdg left
RabidGravy so you can't have an Informix driver for DBIish cause I can't download the SDK 18:11
timotimo that's your new password
MadcapJake: did you try parallelizing yet ... :)
MadcapJake I will, I just wanted to get a comparison, but this is taking ages! :P 18:12
perlpilot MadcapJake: show the code 18:14
(I'd like to see your naive version) 18:15
MadcapJake (Context: I'm following a presentation on python generators for some reference when writing an article about generators/coroutines, and this is meant to mimic the python code) gist.github.com/MadcapJake/c29b76d...5da7c7f7a3 18:17
perlpilot interesting 18:18
timotimo MadcapJake: it could very well be that you're generating a Set for vowels every single time you get a character 18:19
MadcapJake yeah was thinking that, I'll move it outside of the loop
timotimo i'd personally use a native int for the $!count, to 18:21
too
and did you not like my "Counter.new($_) for <... ... ...>" suggestion? :(
and i'm surprised you'd use 'vowel','consonant' rather than <vowel consonant foo>
MadcapJake I liked it! I just had already written that bit :) But if it bothers you that much, I'll change it :P 18:23
18:24 firstdayonthejob joined
MadcapJake You have to enclose it in parentheses though, that's a little unfortunate 18:24
18:25 jjido_ left
timotimo right 18:28
maybe a "do" after the = replaces the parens
MadcapJake 221 seconds! not bad :) 18:29
yeah that works timotimo thanks! 18:30
18:30 buharin joined
perlpilot pmichaud: Are you going to YAPC this year? 18:33
pmichaud perlpilot: that's the current plan :) 18:34
18:34 domidumont left
timotimo MadcapJake: the previous attempt ran for how long? 18:34
perlpilot Cool. Looks like I'll be there too (barring anything strange happening)
MadcapJake timotimo: unknown, didn't want to wait long enough to find out :P
the only change was not creating a set after loop, so I'm guessing that's fairly expensive and not really what I'm looking to measure 18:35
s/after/every/
timotimo well, how long did it run for before you killed it 18:36
MadcapJake here, I'll set one up in a terminal and see 18:38
timotimo: on a tiny 4 stanza file it takes 0.4s outside the loop and 2.5s inside the loop 18:41
buharin hiho 18:43
:)
MadcapJake 'ello! 18:49
buharin weechat is greate ;D 18:59
19:10 maybekoo2 joined 19:14 brrt joined 19:16 ufobat joined
ufobat hello perl6 19:18
yoleaux 02:48Z <zostay> ufobat: thx, i hope the MoarVM problem blocking progress on P6SGI can get resolved sometime so I can have fun on it again... i'm no language or VM hacker
19:19 macsnowball joined 19:22 jjido joined
MadcapJake timotimo: it's been almost a half hour, still hasn't finished :) 19:23
it's at least 6 times slower (though at 600% it should've completed in approx 22 minutes) 19:25
timotimo OK 19:26
what changes are there between these versions you're comparing?
MadcapJake Set generated inside while loop versus prior to while loop 19:28
timotimo wow.
19:35 jjido left
MadcapJake timotimo: I tried a channel approach but it appears to be quite slow, anything I could do to improve it? gist.github.com/MadcapJake/c29b76d...5da7c7f7a3 19:41
Ulti ZoffixWin: I think if you look at some of the other languages they setup env in the docker instance 19:42
timotimo MadcapJake: i don't see it actually spawn more than one worker 19:43
Ulti ZoffixWin: also I think Rakudo perhaps needs to have some flexibility on the format of errors, I've mentioned before it would be good if it could do JSON following some error standards 19:44
timotimo ideally, our hyper and race implementations would be good enough to do this for you mostly
[Coke] (rfc) there are [RFC] tagged tickets in RT.
MadcapJake timotimo: I think I might be doing it wrong though :P
timotimo oh, and also: shaped native arrays are CRAZY SLOW
MadcapJake oh yeah! I thought they were faster :P 19:45
timotimo no, definitely not at the moment
Ulti RAKUDO_ERROR_HUMAN=0 or something gives more machine readable output
19:46 zakharyas joined
MadcapJake how would I make it spawn more than one worker? 19:46
bbl
timotimo call start more than once, collect the Promises in a list, await the list to get the results, add up the results with a zip
Ulti how easy would it be to hook in SSE operations on shaped native arrays from a user module?
19:47 SquireOfGothos joined
timotimo Ulti: since you can just invoke a pointer into a buffer you've written yourself via nativecall, it's possible 19:47
Ulti cool
19:48 jjido_ joined
Ulti though is that the CArray stuff rather than int8 @array[10] 19:48
19:48 nebuchadnezzar joined
timotimo i'm not sure if we support nativecast from int8 @array into CArray 19:50
Ulti a Perl6 binding for github.com/jfalcou/nt2 might be a fun one 19:51
I assume its all template based though :(
which means we cant
but thats full of nice SSE optimised code
19:52 buharin left 19:54 kaare_ left, bdmatatu left 19:55 rindolf left, dwarring joined 20:00 brrt left 20:03 molaf left 20:04 rindolf joined
RabidGravy goats! 20:04
20:06 sufrostico left 20:12 cdg joined 20:19 darutoko left 20:26 sena_kun left 20:30 huggable joined 20:32 sena_kun joined, sena_kun left 20:39 yqt joined 20:46 buharin joined
timotimo congoatulation! 20:47
RabidGravy having a bit of a Candi Statton moment 20:48
timotimo hm?
RabidGravy www.youtube.com/watch?v=P_-9J9QQBoA 20:49
ufobat good night :) 20:50
20:51 ufobat left 20:58 skids left
timotimo RabidGravy: i don't understand the reference :) 20:58
but it's a nice track 20:59
20:59 buharin left 21:00 cdg left, cdg joined
MadcapJake timotimo: 1 hour and 23 minutes :P 21:04
21:07 TEttinger joined
timotimo oh wow 21:08
but it does seem like my initial hunch was right on the money
m: say 221 / (60 * 23 + 60 * 60) 21:09
camelia rakudo-moar b05593: OUTPUT«0.044378␤»
timotimo less than 5% of the "final" time to run it
i expect you'll gain another one bajillion speed by replacing the regex with a uniprop invocation
m: say uniprop("O")
camelia rakudo-moar b05593: OUTPUT«Lu␤»
timotimo i'm not sure, but :Letter likely maps to uniprop($_).starts-with("L") ? 21:10
MadcapJake ok i'll give that a try 21:11
my channel approach is still really slow :( 21:12
timotimo right
maybe the overhead of one send per line is too great
perlpilot timotimo: for a second there I though you were implying that "vowel" was a unicode property
timotimo perlpilot: :) :)
not even close :D 21:13
MadcapJake timotimo: would you take a look and see if I improved the design: gist.github.com/MadcapJake/c29b76d...5da7c7f7a3 21:14
21:17 avar left, avar joined
timotimo i don't think you have to CATCH and break the vow 21:18
throwing an exception inside a start block already breaks that promise
21:18 zakharyas left
timotimo oh, you have a wrapper around that for some reason ?!? 21:18
oh! 21:19
MadcapJake just was going off an old advent on channels/promises
(lots is wrong in here) perl6advent.wordpress.com/2013/12/...-channels/
timotimo you're creating a task per line to be counted
that seems rather wasteful
and makes "count-worker" a misnomer
i'd've made like four or six workers that fight to receive values from the channel and count them 21:20
and at the very end, when the channel gets closed, they would return their result values and those would then be added up
21:21 avar left
masak 'night, #perl6 21:21
MadcapJake how do you mean fight? Like round-robin?
21:21 avar joined
lizmat night masak 21:22
timotimo no, each would try to .receive
gnite masak
21:23 Ven joined 21:24 rindolf left 21:27 prammer left 21:31 Ven left 21:37 pmurias joined
pmurias atom editor has the most Perl 6 support? 21:38
timotimo maybe not the most, but it does have a lot
mst all features of ex-vi.sf.net/ function as well for perl6 as for any other language I've used it with 21:39
timotimo some people expect more things from an editor than editing text :)
i, for example, like my code syntax-highlighted
pmurias having stuff in different colors helps tokenizing ;) 21:40
mst: are there any significant benefits of ex-vi over vim? ;) 21:41
21:41 cpage_ joined
timotimo i expect he's just recommending it because it's minimal-ish? 21:42
21:42 cpage_ left
mst pmurias: for me, "because typos result in a beep, rather than activating some random four letter command I was unaware of and thereby completely breaking me out of flow while I figure out wtf just happened" 21:42
21:43 jjido_ left
timotimo :D 21:43
thunderbird is super guilty of having keyboard shortcuts that activate without a modifier pressed and doing stuff that you have to undo if you even notice anything happened 21:44
i recently kicked those shortcuts out using some extension from 10 years ago
mst and having realised that I didn't actually use any features that weren't in the original ex-vi, it seemed a no-brainer to go that route 21:45
timotimo :) 21:46
pmurias mst: seems resonable
pmurias would love to someday have all the fancy java-ide-like autocompletion/variable renaming/error autocorrection for Perl6 21:47
arnsholt Speaking of editors, syntax highlighting is an interesting case. Experiments testing similar effects on natural language have actually shown them to be harmful to understanding in that case 21:48
yoleaux 15:15Z <azawawi> arnsholt: is Net::ZMQ still being maintained?
pmurias arnsholt: the natural languages have really diferent syntaxes then the computer ones 21:49
21:49 hotel_california is now known as hotel
hotel harmful to understanding how? 21:50
arnsholt .tell azawawi It's maintained in the sense that I'll accept patches and such, and help out to the extent that I have time. But I'm super-duper busy ATM, sadly, so I'm not actively hacking on it ATM
yoleaux arnsholt: I'll pass your message to azawawi.
21:50 grondilu left
hotel I could see highlighting being useful for like identifying different parts of a sentence, for example 21:50
arnsholt pmurias: Yeah, so it's not directly mappable, but it's not inconceivable that it's not very helpful for programming languages either
hotel doesn't get it 21:51
arnsholt I think that kind of thing is generally tested by measuring text comprehension after reading a text
tony-o did it test beginners or vim users?
hotel do you mean native speakers reading texts that have been highlighted?
arnsholt Yeah, native speakers reading texts where various parts of speech were highlighted in different colours 21:52
hotel well okay i can see how that's unhelpful
I was thinking about it in terms of learning a new language
timotimo i don't think the PoS gives you that much information in common sentences
in a garden path sentence, however, or buffalo buffalo buffalo buffalo buffalo buffalo ... 21:53
pmurias I could imagine a lot of possible ways to syntax highlight natural text.
like just highlighting the punctuation, or having every word in a different color 21:54
hotel imagine using highlighting to learn japanese
or a language with declension 21:55
pmurias I don't have any comprehension of japanese so no coloring would help that ;)
MadcapJake timotimo: I tried to refactor to create chunks in the reader, but I'm noticing something strange, the end result changes dependent on the chunk size 21:56
timotimo well, that's clearly bad :)
is that in the paste you already gave me?
MadcapJake yeah
hotel en.wikipedia.org/wiki/Grammatical_particle
timotimo i ... think that code would benefit from being scrapped and rewritten :P 21:57
MadcapJake lol
21:59 Skarsnik joined
MadcapJake what is it that you aren't liking? new tasks are created now for each chunk rather than each line 21:59
timotimo yeah, i'd've just made like 4 tasks instead
MadcapJake but why? 22:01
timotimo because that's less churn
ideally, the threads/workers would just go about their business and not be interrupted by being replaced with a different task, or by sending the summary off to the next channel or something 22:02
your chunk code looks like it could immediately be replaced by a call to rotor 22:03
it makes 0 sense to me to have a vow inside combiner 22:04
22:05 cpage_ joined
MadcapJake yeah I was wondering that, remember that is from 3 year old advent post. I'm assuming they intended it to be the indicator that the work was completed? 22:05
timotimo when you have a start block, there's no need to have promise + vow 22:06
if you don't have a start block, however, you will need that
the start block itself will already return a promise that has the vow handled by returning successfully or exceptioning out of the start block 22:07
MadcapJake ok cool, so that all of that was just doubling up on the needed promises
timotimo yes
that turns your combiner into just three lines instead of 9 22:08
maybe four lines
MadcapJake timotimo: is rotor lazy?
timotimo i believe so
do we still have the big performance difference between IO.slurp.lines and IO.lines?
MadcapJake printing the shakespear file: IO.slurp.lines.say => 0.28s, IO.lines.say => 0.18s 22:11
22:13 Sgeo joined 22:15 ZoffixWin left 22:19 aries_liuxueyang left, Relsak left 22:20 aries_liuxueyang joined 22:21 ZoffixWin joined, ZoffixWin left, ZoffixWin joined 22:22 kid51 joined 22:28 pmurias left
MadcapJake timotimo: from 1 hour and 23 minutes with naive to 8 minutes with my ugly channel code :) 22:29
22:33 tharkun left 22:34 hotel is now known as hotel|lethargy, lichtkind_ joined 22:37 bosscar joined 22:38 lichtkind left, grondilu joined
bosscar Is it possible to create windows executables from perl 6 scripts? 22:38
grondilu sure, at least .bat files 22:39
bosscar Thanks Grondilu... well i was looking for compiling all the dependenices into on .exe 22:40
grondilu well Perl 6 itself runs on Windows and it's compiled by Perl 6. So yeah, it's possible. 22:41
22:42 BenGoldberg joined
grondilu prodided you know all your compiling chain tools, you can script it. 22:42
bosscar i see thanks 22:43
22:45 tharkun joined 22:48 jeffrey joined 22:49 jeffrey left 22:56 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
timotimo that sounds a bit misleading ... 23:01
MadcapJake how so? 23:02
timotimo i don't think anyone has succeeded in making a single .exe for a perl6 script yet
MadcapJake modules are compiled, so how come regular scripts can't be? 23:10
23:10 wamba left 23:11 firstdayonthejob left 23:14 maybekoo2 left
BenGoldberg I'm sure they can be. But remember, compilation is only from perl6 to bytecode. 23:15
23:16 cpage_ left 23:19 itcharlie joined
BenGoldberg The ideal solution would be to find a way to include the compiled bytecode of the script and all of it's dependencies, and a perl6 runtime, in one single .exe file. 23:20
timotimo MadcapJake: they can already, but if you want to run them you have to -MYourScript -e '' 23:27
23:27 BenGoldberg left
timotimo and we don't yet have something good to locate/load the bytecode files directly from the executable 23:27
23:28 spider-mario left 23:29 BenGoldberg joined 23:30 BenGoldberg left
ZoffixWin Has anyone built a Bailador app using the Class-based API? Mine doesn't seem to be working :/ 23:30
self. in submethod BUILD() {} refers to the instance, right?
timotimo i didn't know bailador has anything class-y 23:31
yeah, in submethod build, you have self available
23:31 BenGoldberg joined 23:33 itcharlie left, Ben_Goldberg joined
ZoffixWin This is annoying. 23:33
23:33 BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
ZoffixWin files an Issue and moves on to something less frustrating 23:33
RabidGravy On windows, you could build a PE executable that does similar to what a .NET executable does and invoke the runtime and read the bytecode from the .text of the file 23:34
23:35 Ben_Goldberg joined
ZoffixWin And yeah, there's class-y example, but my copy-pasta of it doesn't seem to be working. Although, I had to figure out how to start it by copying sub baile {...} code: github.com/zoffixznet/Bailador/blo...ailadorapp 23:35
timotimo RabidGravy: or you could just concatenate a zip file with your .exe 23:37
because an exe's header is in the front, and a zip file's header is in the back (and all values are relative)
that's how python does it. i believe python.exe will automatically look for a zip file at its end and for modules contained therein 23:38
RabidGravy yeah, the self extracting zips do that 23:39
timotimo they, too, do that
MadcapJake is there a way to get how many CPU cores someone has? 23:41
RabidGravy on linux it's easy 23:43
23:44 Ben_Goldberg left, BenGoldberg left
RabidGravy grep '^processor' /proc/cpuinfo | wc 23:44
there's an MMC thingy on windows 23:45
MadcapJake I see three numbers (6 18 84) what do they mean? 23:47
(I'm guessing the first is how many cores)
RabidGravy yes
lines words characters 23:48
MadcapJake ohhh that's wc's output
grondilu I usually run top or htop for that 23:49
23:49 vike left
RabidGravy if you were just targetting linux then you could just use Linux::Cpuinfo 23:49
which just has num-cpus
23:50 vike joined
grondilu wonders if one day we'll have thousands of core in a consummer PC and if so, when. 23:52
*cores
RabidGravy you already do if you have a reasonably high-end graphics card ;-) 23:53
grondilu kind of, but not quite though. 23:56
timotimo yeah, they all execute in lock-step for everything 23:58
so an if-else will occupy the sum of all its branches rather than "between the longest and the shortest time of its branches"
23:58 bosscar left