Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-08

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 cpage_ joined #perl6
00:14 mack[m] joined #perl6
00:22 audiatorix joined #perl6
00:23 audiatorix Hey dudes. I'm still adjusting to 6's new regex system. Any idea why the following is producing this error?: No such method 'Letter' for invocant of type 'Match'
00:24 audiatorix my regex arg { <Letter>+ }
00:24 audiatorix my regex call { <arg>[\,\s*<arg>]* }
00:24 audiatorix 'aa' ~~  /<call>/ # error produced here
00:25 raschipi Where is letter defined?
00:25 audiatorix It's one of the defaults, no?
00:25 audiatorix Or does it need to be L?
00:25 audiatorix Same error with L
00:27 mr_ron joined #perl6
00:28 mr_ron rakudo: my regex arg { <:Letter>+ }; say so "abc" ~~ /<arg>/
00:28 camelia rakudo-moar 347da8: OUTPUT: «True␤»
00:28 audiatorix Ah, needs the colon
00:28 raschipi Yeah, it's missing the : to be a chaachter class.
00:29 audiatorix Right, so char classes need colons and other regexes do not
00:29 audiatorix Thanks
00:30 raschipi There's <alpha> without the colon too.
00:30 armin_ joined #perl6
00:30 raschipi as a predefined subrule as you asked for
00:30 audiatorix Yeah just saw that
00:31 audiatorix I was just testing out my knowledge before writing something more complicated to parse basically function calls
00:31 audiatorix making a templater
00:33 BenGoldberg joined #perl6
00:37 dj_goku joined #perl6
00:40 RID_1984 joined #perl6
00:41 RID_1984 left #perl6
00:41 kyan joined #perl6
00:41 AlexDaniel switching to another laptop is harder than moving to another place :-S
00:54 raschipi audiatorix: remember to call a predefined regex with a dot in front to supress capture:
00:54 raschipi m: say 'abc' ~~ /<alpha>+/; say 'def' ~~ /<.alpha>+/
00:54 camelia rakudo-moar 347da8: OUTPUT: «「abc」␤ alpha => 「a」␤ alpha => 「b」␤ alpha => 「c」␤「def」␤»
01:01 konsolebox joined #perl6
01:02 b2gills AlexDaniel: I was locked out of my password manager once, because I was using a laptop that I hadn't used recently. (I eventually found a way to get in)
01:03 AlexDaniel b2gills: :O
01:03 b2gills It required using the /info cmd on IRC to get an IP address to SSH into
01:05 AlexDaniel being locked out of your password manager sounds really horrible
01:06 AlexDaniel I do have backups of my passwords *somewhere*… maybe I should practice the emergency situation :-/
01:07 raschipi AlexDaniel: Make sure you can restore from your backups, it's important.
01:09 AlexDaniel well, my passwords is the only thing I have to backup. All code I write is in git repos (so also pushed somewhere), everything else I really don't care about
01:09 AlexDaniel not that I wouldn't be sad for a minute or two if I lose it, but I am not spending my time trying to create backups for it :)
01:11 raschipi Buy a strong box and store your passwords there.
01:12 AlexDaniel alternatively, just upload it to github… then I only have to backup my private key :D
01:13 raschipi How to you want to use your private key to access github without it's password?
01:14 AlexDaniel it can be a public repo
01:16 raschipi Instead make it passwordless, then. Then just keep it safe.
01:34 audiatorix Any idea why this regex is invalid?: -<[ \$ \, ]>+
01:34 audiatorix What I'm trying to achieve is "anything but literal $ or literal , one or more times"
01:35 geekosaur shouldn't that start with <-[ instead of -<[ ?
01:36 audiatorix Ah, so it should
01:36 audiatorix What's the logic behind that?
01:37 audiatorix [] on their own simply group
01:37 geekosaur same reason an older regex does something different with [-... vs. -[...
01:38 geekosaur <> is a meta-operation of some kind, - prefix means invert, [] is char class. vs. without the <>, [ ] is non-capturing group
01:38 audiatorix Ah okay, that's what I was thinking once I saw the answer
01:38 geekosaur the first character after a < in a < > is special, - inverts the metaop, . prevents capturing (used with named rules like <ws> or <digit>) etc.
01:39 geekosaur (this is oversimplifying a bit)
01:40 audiatorix Cool
01:40 audiatorix So, different question: in a grammar, how do I specify that, in a given place, either token A or token B may appear?
01:53 geekosaur A | B
01:53 audiatorix <A> | <B> ?
01:53 AlexDaniel yea
01:53 geekosaur with brackets around if it's part of a larger thing e.g. <foo> [ <bar> | <baz> ] <quux>
01:53 AlexDaniel or maybe || if you care about order and not about longest token matching
01:53 audiatorix And if I needed to use that more than once, would throwing it in a sub-regex make sense (so that a new token doesn't need to be created for it)
01:54 ilbot3 joined #perl6
01:54 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:55 raschipi audiatorix: I gave you the answer above, put them into another method but call it with a dot to avoid making the capture more complex.
01:56 raschipi m: say 'abc' ~~ /<alpha>+/; say 'def' ~~ /<.alpha>+/
01:56 camelia rakudo-moar 347da8: OUTPUT: «「abc」␤ alpha => 「a」␤ alpha => 「b」␤ alpha => 「c」␤「def」␤»
01:57 geekosaur joined #perl6
01:59 audiatorix Oh, so you did. My bad
02:17 noganex_ joined #perl6
02:17 dj_goku joined #perl6
02:39 llfourn joined #perl6
02:45 geekosaur joined #perl6
02:57 Cabanossi joined #perl6
03:13 snarkyboojum joined #perl6
03:42 Cabanossi joined #perl6
03:56 Cabanossi joined #perl6
04:15 dj_goku joined #perl6
04:18 raschipi audiatorix: Did my suggestion work?
04:36 kaare_ joined #perl6
04:43 Actualeyes joined #perl6
04:58 cpage_ joined #perl6
04:58 xtreak joined #perl6
05:19 audiatorix joined #perl6
05:23 khw joined #perl6
05:26 Cabanossi joined #perl6
05:45 ufobat joined #perl6
05:58 lowbro_ joined #perl6
06:07 ash_gti joined #perl6
06:25 zakame joined #perl6
06:26 leont joined #perl6
06:32 ChoHag joined #perl6
06:44 gigavinyl joined #perl6
07:01 jonas1 joined #perl6
07:11 Cabanossi joined #perl6
07:12 nattefrost joined #perl6
07:17 darutoko joined #perl6
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer: c108ce774f | (Zak B. Elep)++ | 2 files
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer: Split and rephrase lines in the footer
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer:
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer: The first paragraph/line was getting too long, so split it a bit and
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer: rephrase to emphasize source location and actions to either report
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer: issues and/or edit/fork.
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer:
07:24 Geth ¦ doc/split-and-rephrase-lines-in-footer: Fixes #1535.
07:25 Geth ¦ doc/split-and-rephrase-lines-in-footer: review: https://github.com/perl6/doc/commit/c108ce774f
07:25 Geth ¦ doc/split-and-rephrase-lines-in-footer: 4cff7ee700 | (Zak B. Elep)++ | lib/Pod/Htmlify.pm6
07:25 Geth ¦ doc/split-and-rephrase-lines-in-footer: :lipstick: phrasing for "from POD6 at perl6/doc"...
07:25 Geth ¦ doc/split-and-rephrase-lines-in-footer:
07:25 Geth ¦ doc/split-and-rephrase-lines-in-footer: "From POD6 from perl6/doc" sounds odd...
07:25 Geth ¦ doc/split-and-rephrase-lines-in-footer: review: https://github.com/perl6/doc/commit/4cff7ee700
07:35 leont joined #perl6
07:39 piojo joined #perl6
07:40 piojo Have others gotten this error when trying to build?: "Unhandled exception: Unable to allocate an array of 8 elements"
07:42 piojo The first instance of the error is:
07:42 piojo perl.exe -MExtUtils::Command -e cp 3rdparty\dyncall\dyncallback\\*.h .rakudobrew\moar-blead-nom\install\include\dyncall Unhandled exception: Unable to allocate an array of 8 elements    at <unknown>:1  (src/vm/moar/stage0/ModuleLoader.moarvm:)  from <unknown>:1  (src/vm/moar/stage0/ModuleLoader.moarvm:<dependencies+deserialize>)  from <unknown>:1  (src/vm/moar/stage0/nqp.moarvm:<dependencies+deserialize>)
07:42 piojo building on windows, and it worked last time I tried.
07:45 raschipi joined #perl6
07:45 travis-ci joined #perl6
07:45 travis-ci Doc build passed. Zak B. Elep ':lipstick: phrasing for "from POD6 at perl6/doc"...
07:45 travis-ci https://travis-ci.org/perl6/doc/builds/273197377 https://github.com/perl6/doc/compare/c108ce774f43^...4cff7ee700c1
07:45 travis-ci left #perl6
07:48 wamba joined #perl6
07:51 piojo_ joined #perl6
08:01 piojo_ lemme ask a different question: the *best* way to build, if I'm not lazy, is to set up different directories for each repository and build/install each one separately?
08:02 francesco_ left #perl6
08:02 piojo_ Or do developers also use rakudobrew? It can't tell whether it's versatile enough to find the commit that breaks the build, for example
08:04 raschipi I don't think anyone that builds on windows hangs around on IRC...
08:05 domidumont joined #perl6
08:06 zakharyas joined #perl6
08:07 raschipi piojo_: I think you're the closest thing to a windows expert as there is in Perl6.
08:11 El_Che stmuk_builds star on windows as well, so he probably knows more about the win build process
08:16 piojo_ raschipi: haha. Someone must have made perl6 run on windows!
08:17 piojo_ raschipi: oh, I see. is stackoverflow a better place to go for windows-specific questions?
08:18 dogbert2 joined #perl6
08:18 raschipi I have no idea where you'll fing perl6-on-windows users to help you, sorry.
08:19 piojo_ thanks. forget windows, then
08:19 piojo_ Is the right way to build perl6 to build nqp, moar, and rakudo one at a time?
08:20 piojo_ and to consider them separate projects which should be debugged (and git-bisected) totally separately?
08:22 piojo_ El_Che: is stumuk_ the person who makes star releases for win?
08:22 piojo_ *stmuk_, I mean
08:29 tyil is there a zef command I can use to make it install all deps from a given META6.json?
08:30 zakame cd to where the META6.json is then `zef install --deps-only .`
08:30 tyil thanks :>
08:34 Geth ¦ doc: c108ce774f | (Zak B. Elep)++ | 2 files
08:34 Geth ¦ doc: Split and rephrase lines in the footer
08:34 Geth ¦ doc:
08:34 Geth ¦ doc: The first paragraph/line was getting too long, so split it a bit and
08:34 Geth ¦ doc: rephrase to emphasize source location and actions to either report
08:34 Geth ¦ doc: issues and/or edit/fork.
08:34 Geth ¦ doc:
08:34 Geth ¦ doc: Fixes #1535.
08:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c108ce774f
08:34 Geth ¦ doc: 4cff7ee700 | (Zak B. Elep)++ | lib/Pod/Htmlify.pm6
08:34 Geth ¦ doc: :lipstick: phrasing for "from POD6 at perl6/doc"...
08:34 Geth ¦ doc:
08:34 Geth ¦ doc: "From POD6 from perl6/doc" sounds odd...
08:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/4cff7ee700
08:34 Geth ¦ doc: 3444fe4033 | (Rafael Schipiura)++ (committed using GitHub Web editor) | 2 files
08:34 Geth ¦ doc: Merge pull request #1541 from zakame/split-and-rephrase-lines-in-footer
08:34 Geth ¦ doc:
08:34 Geth ¦ doc: Split and rephrase lines in the footer
08:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3444fe4033
08:41 Cabanossi joined #perl6
08:46 stmuk_ piojo_: yes I build star on Windows every three months, although it's not my main platform of choice
08:47 piojo_ stmuk_: by the way, thank you for that service!
08:47 piojo_ stmuk_: so if I want to debug build problems, I should work with 3 separate repositories for nqp, moar, and rakudo?
08:48 stmuk_ yes and that applies to all platforms
08:48 sumdoc joined #perl6
08:48 sumdoc how to enabe autocompletion in Perl 6 REPL? Any idea?
08:49 sumdoc Autocompletion
08:50 piojo_ stmuk_: thanks. I assume the READMEs in the code are enough, without a lot of custom setup needed? (I'm not thinking modules, just the core perl6)
08:50 stmuk_ yes
08:51 stmuk_ I use mingw gcc as shipped with strawberry perl or MSVC should also work
08:51 raschipi sumdoc: You need linenoise.
08:51 stmuk_ at least for 64 bit (I don't think anyone has done a 32 bit build for a while)
08:51 raschipi https://github.com/hoelzro/p6-linenoise/#tab-completion
08:52 piojo_ stmuk_: thanks, that's what I'm using too. I'll try to get it working, or at least find the bad commit soon
08:52 stmuk_ https://ci.appveyor.com/project/rakudo/rakudo/branch/nom/job/m7e6fwo5hwnug90w suggests the windows build is fine
08:52 stmuk_ piojo_: I'll also try a build very shortly
08:52 piojo_ stmuk_: I think moar is the problem, not rakudo
08:53 xtreak joined #perl6
08:53 sumdoc raschipi linenoise or readline !! Which one better?
08:53 stmuk_ yes that's usually the issue
08:54 raschipi sumdoc: readline doesn't have tab completion.
08:54 sumdoc raschipi OK lemme build with linenoise
08:55 sumdoc raschipi what do you say about rlwrap?
08:55 mr-foobar joined #perl6
08:56 raschipi I use rlwrap, but it also doesn't have tab completion.
08:57 piojo_ raschipi: does rlwrap interfere with tab completion, if you use rlwrap+linenoise?
08:58 raschipi I never tried it.
08:58 piojo_ and can linenoise be configured for <esc><backspace> to delete a whole word like it does with readline?
08:58 piojo_ eh, I should just read the docs. I'm sure it's answered somewhere
08:59 raschipi zakame: your code is in effect now, go have a look.
08:59 zakame thanks raschipi !
09:01 zakharyas joined #perl6
09:06 sumdoc raschipi OK I am going with Linenoise. But what was good about rlwrap than linenoise u r using rlwrap. Just a curiosity!!
09:07 raschipi I don't install modules.
09:07 AlexDaniel joined #perl6
09:07 sumdoc raschipi Thanks
09:12 rindolf joined #perl6
09:18 raschipi Oh oh...
09:19 raschipi https://docs.perl6.org/routine.html has a ton of 404 links...
09:20 raschipi https://docs.perl6.org/routine/.= for example
09:21 Actualeyes left #perl6
09:21 telex joined #perl6
09:26 xtreak joined #perl6
09:29 tyil I'm trying to run perl6 on FreeBSD, but I got the error "Missing serialize REPR function for REPR VMException (BOOTException)"
09:29 tyil it runs fine on Funtoo
09:31 zakharyas1 joined #perl6
09:42 ggoebel joined #perl6
09:48 tyil also, how would I go about running a perl 6 program as a daemon?
09:49 zakharyas joined #perl6
09:50 xtreak_ joined #perl6
09:51 Skarsnik joined #perl6
09:53 eroux joined #perl6
09:53 stmuk_ tyil: I just built using rakudobrew on FreeBSD 11.1 and it worked fine for me
09:54 tyil hmm
09:54 stmuk_ maybe you have stuff hanging around from a older build?
09:55 tyil the program I'm trying to run is https://github.com/scriptkitties/musashi, the command Im using to run it is perl6 -I/home/musashi/musashi/lib /home/musashi/musashi/bin/musashi.pl6
09:55 sumdoc Linenoise build is failing in rakudo Any help?
09:55 sumdoc https://github.com/hoelzro/p6-linenoise/issues/22
09:55 tyil no, its a new vm with perl 6 built for the first time last night
09:55 mr-foobar joined #perl6
09:56 tyil if it matters, I did not use rakudobrew, but just cloned https://github.com/rakudo/rakudo and ran perl Configure.pl --gen-moar --gen-nqp --backends=moar
09:57 sumdoc Are there any dependencies for Linenoise?
09:59 stmuk_ sumdoc: just a C compiler
10:02 tyil stmuk_: if I run the program as a service (https://github.com/scriptkitties/musashi/blob/master/files/musashi.rc), it starts correctly
10:02 tyil but it doesnt run as a background service yet, so that would be my next issue
10:09 rindolf joined #perl6
10:11 dogbert17_ joined #perl6
10:12 margeas joined #perl6
10:15 mattp__ joined #perl6
10:17 Voldenet joined #perl6
10:17 Voldenet joined #perl6
10:26 ShalokShalom_ joined #perl6
10:26 Cabanossi joined #perl6
10:27 stmuk_ piojo_: yes I can reproduce the windows build failure "Unhandled exception: Unable to allocate an array of 8 elements"
10:35 NewOne joined #perl6
10:43 HoboWithAShotgun joined #perl6
10:44 HoboWithAShotgun good day you wonderful people. what's the perl 6 way of constraining a class' attribute?
10:45 Skarsnik has Int $.attribute ?
10:45 HoboWithAShotgun like i want a "has $.radians" that will only accept values between -pi and + pi
10:45 timotimo if you want extra constraints, define a subset type and use that there
10:45 timotimo m: subset Radians of Real where -pi < * < pi; class A { has Radians $.r }; say try A.new(r => 1); say try A.new(r => 4)
10:45 camelia rakudo-moar 347da8: OUTPUT: «A.new(r => 1)␤Nil␤»
10:46 Skarsnik fun
10:47 Juerd -pi to +pi? Why not 0 to tau?
10:48 timotimo actually, any value between -Inf and Inf is a value in radians :P
10:49 Juerd Sure, but if you're limiting, wouldn't it make sense to limit that to 0 <= r < tau?
10:49 timotimo m: say tau
10:49 camelia rakudo-moar 347da8: OUTPUT: «6.28318530717959␤»
10:50 piojo_ stmuk_: thanks. I intend to do a git rebase, but I won't be able to until monday
10:51 xtreak joined #perl6
10:56 notbenh joined #perl6
10:58 HoboWithAShotgun ah, my code involves triangles, so only values between 0 and 90° make sense
10:58 HoboWithAShotgun 180° sorry
11:00 mr-foobar joined #perl6
11:00 HoboWithAShotgun but it works, thanks. at first tests failed, but then i realized <= instead of <
11:00 HoboWithAShotgun + i need
11:09 Cabanossi joined #perl6
11:11 ilbelkyr joined #perl6
11:15 cog_ joined #perl6
11:16 HoboWithAShotgun allright, i now have this class: https://hastebin.com/kinucobije.pl which allows values between -360 and 360 degrees
11:17 HoboWithAShotgun how do i now derive Angle::Triangle from that wich is identical only so it limits between 180 and -180
11:18 mr-foobar joined #perl6
11:20 HoboWithAShotgun also, can i override the error message that i get when i assign an ivalid value to my subtype?
11:20 Skarsnik probably with subset again ?
11:21 * HoboWithAShotgun goes rtfm
11:21 Skarsnik m: class A { has $.x}; subset B of A where $.x < 20; say try A.new( a => 30; say try B.new( B => 30);
11:21 camelia rakudo-moar 347da8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable $.x used where no 'self' is available␤at <tmp>:1␤------> 3ss A { has $.x}; subset B of A where $.x7⏏5 < 20; say try A.new( a => 30; say try B␤    expecting any of:␤        term␤»
11:21 Skarsnik m: class A { has $.x}; subset B of A where $.x < 20; say try A.new( x => 30; say try B.new( x => 30);
11:21 camelia rakudo-moar 347da8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable $.x used where no 'self' is available␤at <tmp>:1␤------> 3ss A { has $.x}; subset B of A where $.x7⏏5 < 20; say try A.new( x => 30; say try B␤    expecting any of:␤        term␤»
11:26 timotimo https://github.com/zoffixznet/perl6-Subset-Helper
11:41 Cabanossi joined #perl6
11:48 timotimo stmuk_: did you see what i wrote in #moarvm?
11:54 mr-fooba_ joined #perl6
12:03 stmuk_ timotimo: I have now!
12:04 stmuk_ I have to go out shortly but can quickly look now and slowly look later
12:04 timotimo OK!
12:04 timotimo i hope it'll be enlightening
12:08 [Coke] (windows) I have a build I run occasionally.
12:11 [Coke] updated rakudo, rebuilding...
12:12 [Coke] (also if you're having a windows build issue, msvc or gcc?)
12:17 galx joined #perl6
12:19 esh joined #perl6
12:23 sumdoc joined #perl6
12:24 sumdoc I have updated the blog. Added about mounting the folder. https://sumdoc.wordpress.com/2017/09/06/how-to-run-perl-6-notebook/
12:25 [Coke] I can't duplicate a win64 failure with strawberry perl, msvc, and nom/master/master
12:26 Cabanossi joined #perl6
12:27 galx how can I use perl6 on WinXP
12:27 galx ?
12:28 timotimo oh, huh, i don't know if anybody has tried that before
12:29 timotimo have you tried just building it and seeing where it fails?
12:29 galx no, but I can try
12:29 [Coke] ... xp?
12:30 galx I have an old laptop with winxp installed
12:30 galx i know it's crazy yeah :)
12:30 timotimo building rakudo will need more than 1gb of ram
12:30 jnthn If it's 64-bit then can always try one of the MSIs
12:31 timotimo huh, i wasn't actually aware that windows xp already came in 64bit variants
12:31 timotimo but i guess 64bit processors are not new at all
12:32 galx it's 32
12:32 [Coke] https://github.com/rakudo/rakudo/blob/nom/docs/windows.md might help
12:32 galx thank you!
12:33 [Coke] ... you may not have a version of VS2017 you can install; it is possible to build just using strawberry perl's toolchain.
12:33 jast windows xp x64 is fairly rare
12:33 timotimo we don't require a very new visual studio
12:33 [Coke] (ugh, also my MD formatting is wonky there, if anyone wants to try to clean that, I'd appreciate it. :|
12:34 [Coke] timotimo: right, 2017 was just the one available in the demo copy of windows I grabbed.
12:41 cgfbee joined #perl6
12:51 astj joined #perl6
13:01 cdg_ joined #perl6
13:02 okl joined #perl6
13:02 astj joined #perl6
13:11 Ptolemarch joined #perl6
13:11 Cabanossi joined #perl6
13:12 AlexDaniel joined #perl6
13:14 itaipu joined #perl6
13:19 eliasr joined #perl6
13:38 sumdoc --
13:40 mr-foobar joined #perl6
13:42 radvendii joined #perl6
14:11 Cabanossi joined #perl6
14:22 Kyo91_ joined #perl6
14:35 sumdoc Is there a perl 6 package to work with web API?
14:39 moritz HTTP::UserAgent
14:41 Cabanossi joined #perl6
14:42 * moritz back from vacation
14:52 cdg joined #perl6
14:57 cdg_ joined #perl6
15:01 itaipu_ joined #perl6
15:02 timotimo also WWW and the curl bindings
15:05 b2gills .ask TimToady I would like your input on a document for implementors of Perl 6 dialects since there are currently 2 that I know of https://gist.github.com/b2gills/7e2781dfd781368b63337c59bd751115
15:05 yoleaux b2gills: I'll pass your message to TimToady.
15:05 setty1 joined #perl6
15:05 donaldh joined #perl6
15:08 itaipu joined #perl6
15:11 Cabanossi joined #perl6
15:22 itaipu_ joined #perl6
15:31 geekosaur joined #perl6
15:33 cdg joined #perl6
15:40 mr-fooba_ joined #perl6
15:40 HoboWithAShotgun I managed to create a Num variable that contains 10 which is not equal to 10
15:41 Cabanossi joined #perl6
15:41 timotimo cool, what's your num - 10?
15:47 HoboWithAShotgun 1.77635683940025e-15
15:47 HoboWithAShotgun but then why does it print as 10?
15:48 HoboWithAShotgun p6: my $l = sqrt(2) * 10; my $d = 45; my $r = $d / 360 * tau; my $y = sin( $r ) * $l; my $x = sqrt( $l**2 - $y**2 ); say $x == $y;
15:48 camelia rakudo-moar e5a600: OUTPUT: «False␤»
15:49 HoboWithAShotgun the trig functions and tau probably produce rounding errors
15:53 HoboWithAShotgun p6: my $l = sqrt(2) * 10; my $d = 45; my $r = $d / 360 * tau; my $y = sin( $r ) * $l; my $x = sqrt( $l**2 - $y**2 ); say $x; say $y;
15:53 camelia rakudo-moar e5a600: OUTPUT: «10␤10␤»
15:53 tbrowder .tell nine I just filed issue #101 with Inline::Perl5; failure using Expect::Simple
15:53 yoleaux tbrowder: I'll pass your message to nine.
15:53 HoboWithAShotgun see? outputs as 10 even though x is 10.00000000...whatver
15:54 HoboWithAShotgun half an hour wasted
15:55 pyrimidine joined #perl6
15:57 cdg joined #perl6
15:58 cdg joined #perl6
15:58 HoboWithAShotgun .tell mum I gonna be late for dinner
15:58 yoleaux HoboWithAShotgun: I'll pass your message to mum.
16:00 piojo2 joined #perl6
16:04 mr-foobar joined #perl6
16:07 skids joined #perl6
16:08 kaare_ joined #perl6
16:11 Cabanossi joined #perl6
16:16 cdg joined #perl6
16:18 cdg_ joined #perl6
16:18 cdg joined #perl6
16:27 astj joined #perl6
16:33 ilmari tbrowder: works for me
16:34 ilmari This is Rakudo version 2017.08-79-g4b02b8aad built on MoarVM version 2017.08.1-110-gab28683b2
16:34 kerframil joined #perl6
16:36 cdg joined #perl6
16:38 ilmari how do you get the version of a loaded module in perl6? like perl5's Foo->VERSION or $Foo::VERSION?
16:39 ugexe in perl6 its just $*REPO.need(CompUnit::DependencySpecification.new(:short-name<Foo>)).distribution.meta<ver>
16:41 Skarsnik 'just'
16:41 ilmari ah, so intuitive
16:41 ilmari very discoverable
16:41 moritz we might want a shortcut for that :-)
16:42 ugexe also it only works for ::Installable repos, ::FileSystem ones dont set a CompUnit.distribution
16:43 ugexe https://github.com/rakudo/rakudo/pull/1132 would allow it to work with ::FileSystem however.
16:44 ugexe the short-cut would be to somehow hook up META6.json info to ::Foo.^ver
16:46 ilmari huh, doesn't perl6's -M take an import list?
16:47 ugexe i dont think our -M does anything but take the short name
16:49 ugexe e.g. `-M "Test:ver<6.c>"` does not work while `-e 'use Test:ver<6.c>` does
16:49 * ilmari wanted to write a V module like perl5 has
16:49 ilmari perl5 -MV=Foo # shows all versions of Foo in @INC
16:51 ugexe all versions of Foo in @INC doesn't mean the same thing as in perl6 though
16:53 ilmari all versions in $*REPO.repo-chain?
16:54 ugexe let me rephrase: it wouldnt suffice for determining which version of something will get used
16:55 ugexe i guess thats the same as @INC though with use lib, so nm
16:56 zakharyas joined #perl6
16:57 ingy I just noticed that: perl6 -e 'say "ok" while True' | head
16:58 ingy doesn't terminate like perl5 does
16:58 ilmari Unhandled exception: Failed to write bytes to filehandle: Broken pipe
17:00 ilmari but exit status zero?!
17:00 ingy that's bash
17:00 ingy the exit code of head
17:00 ilmari doh
17:00 ugexe m: say $*REPO.repo-chain.map(*.?installed()).grep(*.defined).map(*.Slip).grep({ .meta<name> eq "Test" || (.meta<provides>{"Test"}:exists) }).map(*.meta<ver version>.first); # this is the logic part anyway
17:00 camelia rakudo-moar e5a600: OUTPUT: «(v6.c)␤»
17:01 ingy I don't get the broken pipe
17:01 ingy it just hangs
17:01 ilmari yes, with set -o pipefail (not popefail, as I first typed) it shows exit status 1 from perl6
17:01 ilmari which version?
17:01 ilmari This is Rakudo version 2017.08-79-g4b02b8aad built on MoarVM version 2017.08.1-110-gab28683b2
17:01 ingy python -c 'while True:print("ok")' | head   # gives a broken pipe
17:02 ingy yes | head   # seems like nice behaviour
17:02 ingy This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
17:02 ingy on mac
17:02 ilmari perl5 exits with status 141 but no message
17:03 ingy so does `yes` !
17:03 ingy 141
17:03 ingy that's a 13
17:04 ingy 141 - 128
17:04 ilmari which is SIGPIPE
17:04 ilmari but now, pubtime!
17:05 ingy so that's probably what perl6 should do
17:05 ingy if anyone cares
17:05 pyrimidine joined #perl6
17:07 TimToady joined #perl6
17:11 Cabanossi joined #perl6
17:18 domidumont joined #perl6
17:35 bdmatatu joined #perl6
17:36 espadrine joined #perl6
17:41 Cabanossi joined #perl6
17:55 pyrimidine joined #perl6
17:58 pmurias joined #perl6
17:59 pyrimidi_ joined #perl6
18:04 pyrimidine joined #perl6
18:11 Cabanossi joined #perl6
18:12 pyrimidine joined #perl6
18:12 astj joined #perl6
18:20 mr-foobar joined #perl6
18:20 pyrimidine joined #perl6
18:25 BooK I'm testing radical changes to Bool by taking all concerned lines from src/Perl6/Metamodel/BOOTSTRAP.nqp and in src/core/Bool.pm and s/Bool/Foo/ to test them faster, and in isolation, without needing to recompile between attempts
18:25 BooK is that something that could work?
18:26 BooK Right now, I get: Type 'stub' is not declared. Did you mean 'Sub'?
18:26 BooK so I assume I need to load some definition for stub
18:26 jnthn For code in CORE.setting it's often a fine approach
18:26 jnthn For something that is so bootstrap-sensitive, there's a very high chance of things not working when put back later
18:27 jnthn `stub` is actually a non-standard language extension only in NQP, for the sake of the bootstrap. It doesn't exist in real Perl 6.
18:27 jnthn So that bit can't really be copied out, but you could simulate it with a stub class in full Perl 6
18:27 jnthn my class Foo { ... }
18:27 cdg_ joined #perl6
18:28 BooK ok
18:29 BooK the line I was replacing was:  my stub Bool metaclass Perl6::Metamodel::EnumHOW { ... };
18:30 BooK so just dropping the stub would do it
18:36 cono is there any way to define alternation in regexp with backtracking ?
18:36 yoleaux 6 Sep 2017 12:43Z <Zoffix> cono: the latest and greatest Rakudo has a fix for your issue. You should be getting your Any again: https://github.com/rakudo/rakudo/commit/d0d105b8b6
18:37 cono already seen this, thanks :)
18:38 cono https://gist.github.com/cono/30bd6392856626771c747ddaa29471b0 so, I want if <number> fails it backtrack and tries <tree-op> token
18:41 cono | - longest, || - left associated, I want some "\\" which going to be left associated but with backtracking, so if first token in alternation fails, it tries next one
18:42 kaare_ joined #perl6
18:44 cono in this case: 1 + 2 + 3, will be something like expr( tree-op(tree-op(number(1), op('+'), number(2)), op('+'), number(3)) )
18:48 ash_gti joined #perl6
18:49 andrzejku joined #perl6
18:50 pecastro joined #perl6
18:51 jnthn cono: Are you writing this in a token/rule?
18:51 jnthn ah, you linked code and I missed it :)
18:51 Geth ¦ doc/molecules-patch-2: 65cf7b1d1b | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
18:51 Geth ¦ doc/molecules-patch-2: Fixed three space indent
18:51 Geth ¦ doc/molecules-patch-2: review: https://github.com/perl6/doc/commit/65cf7b1d1b
18:53 BooK how can I initialize a sigilless version of Bool to do the equivalent of the stub in npq? I think  my \Bool2 := ...; and then I can call the stuff found in bootstrap on that new name, the first of which would be Bool2.HOW.set_base_type(BooK, Int);
18:53 Aaronepower joined #perl6
18:54 BooK etc
18:54 kaare_ joined #perl6
18:54 BooK I want to first build a Bool2 identical to the regular Bool, and then tweak it so that it can do the Enumeration role, and we can remove the duplication
18:55 jnthn BooK: Probably something like Metamodel::EnumHOW.new_type(:name('Bool2'))
18:55 jnthn cono: The thing is that token (and rule) mean that backtracking state should *not* be retained
18:55 jnthn cono: || if a regex will indeed backtrack
18:55 jnthn cono: If you replace token with regex in the first 3 rules it seems to work out
18:56 moritz or maybe my \Bool2 = Bool but Enumeration;
18:56 Geth ¦ doc: d15be280c7 | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
18:56 Geth ¦ doc: Does this resolve #1538?
18:56 Geth ¦ doc:
18:56 Geth ¦ doc: Does simply removing the `if` statement resolve #1538?
18:56 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d15be280c7
18:56 Geth ¦ doc: 65cf7b1d1b | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
18:56 Geth ¦ doc: Fixed three space indent
18:56 Geth ¦ doc: review: https://github.com/perl6/doc/commit/65cf7b1d1b
18:56 Geth ¦ doc: c0596fe916 | (Jonathan Worthington)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
18:56 Geth ¦ doc: Merge pull request #1540 from perl6/molecules-patch-2
18:57 Geth ¦ doc:
18:57 Geth ¦ doc: Does this resolve #1538?
18:57 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c0596fe916
18:57 BooK moritz: the plan is to test writing a different implementation of Bool, without having to recompile every time I change a thing
18:57 BooK so writing Bool2 without depending on Bool explicitely, just copy-pasting
18:58 * jnthn bbl
19:00 BooK m: BEGIN { use nqp; my \Bool2 := Metamodel::EnumHOW.new_type(:name<Bool2>, :base_type(Int)); Bool2.HOW.set_base_type(Bool2, Int); }
19:00 camelia rakudo-moar e5a600: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤An exception occurred while evaluating a BEGIN␤at <tmp>:1␤Exception details:␤  5===SORRY!5=== Error while compiling ␤  Base type has already been set for Bool2␤  at :␤»
19:01 cono jnthn: thanks! :)
19:02 BooK m: BEGIN { use nqp; my \Bool2 := Metamodel::EnumHOW.new_type(:name<Bool2>); Bool2.HOW.set_base_type(Bool2, Int); }
19:02 camelia rakudo-moar e5a600: ( no output )
19:02 BooK mmm
19:03 BooK I think that failed later
19:04 astj joined #perl6
19:05 Actualeyes joined #perl6
19:06 smls joined #perl6
19:09 BooK right, it gave me: getstaticcode requires a static coderef
19:09 grqung joined #perl6
19:10 BooK I guess I'm now deep in the guts, and my only operation tool knowledge relates to a spoon
19:11 skids joined #perl6
19:11 moritz if you install methods with add_method or so, you might needs to wrap the code in nqp::getstaticcode()
19:13 pmurias_ joined #perl6
19:15 lancew joined #perl6
19:19 BooK moritz: the error comes from this line: Bool2.HOW.add_method(Bool2, 'key', nqp::getstaticcode(sub ($self) { nqp::getattr_s(nqp::decont($self), Bool2, '$!key'); }));
19:19 tbrowder ilmari: my bad, my Inline::Perl5 was too old--an upgrade fixed it.  I think I'll add a cron job to upgrade all modules every week or so...
19:19 BooK so I guess the question is "how do I make that sub a static coderef?
19:19 tbrowder .tell nine my version was too old, closing issue 101
19:19 yoleaux tbrowder: I'll pass your message to nine.
19:21 BooK (going to lose network soon, the plane is about to take off)
19:24 moritz BooK: looks good to me, assuming that $!key is set up correctly first
19:27 lancew joined #perl6
19:29 notbenh joined #perl6
19:31 pyrimidine joined #perl6
19:31 zakharyas joined #perl6
19:39 pyrimidine joined #perl6
19:41 Cabanossi joined #perl6
19:41 jcallen joined #perl6
19:48 Cabanossi joined #perl6
19:50 domidumont joined #perl6
19:55 astj joined #perl6
20:03 moritz how do I access the actions object inside a grammar?
20:05 Semp__ joined #perl6
20:06 itaipu joined #perl6
20:13 perlpilot joined #perl6
20:13 moritz ah, self.actions
20:17 Geth ¦ doc: 9826038dd1 | (Moritz Lenz)++ | doc/Type/Cursor.pod6
20:17 Geth ¦ doc: Document Cursor.actions
20:17 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9826038dd1
20:22 kerframil joined #perl6
20:24 Geth ¦ doc: c65e01f3a8 | (Moritz Lenz)++ | doc/Type/Match.pod6
20:24 Geth ¦ doc: Document Match.actions
20:24 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c65e01f3a8
20:24 moritz book-driven development
20:25 TEttinger joined #perl6
20:26 Cabanossi joined #perl6
20:46 astj joined #perl6
20:49 Cabanossi joined #perl6
20:55 BooK while in the plane I played around with IO::Socket::INET, and got this strange behaviour
20:55 BooK This code: say "Accepted {IO::Socket::INET.new(:localhost<localhost>, :localport(4444), :listen).accept}";
20:56 BooK does what's expected when running `telnet localhost 4444`, but hangs with `nc localhost 4444`
20:56 Skarsnik does localhost is ipv6?
20:56 BooK more importantly, nc dies this: localhost [127.0.0.1] 4444 (?) : Connection refused
20:57 BooK the default for INET is ipv4
20:57 Skarsnik connect does not pass the Inet family for example
20:58 Skarsnik I would not be surprised listen does not the then xD
21:00 Skarsnik yep it's ignored
21:01 ugexe :localhost<127.0.0.1>
21:01 BooK Skarsnik: so telnet is doing ipv6 and nc ipv4 ? and perl6 defaults to ipv6 ?
21:01 Skarsnik moar does not use the sa-family from Rakudo at all
21:02 Skarsnik BooK, moar will get what is the first sa family the system return for localhost
21:02 itaipu joined #perl6
21:02 geekosaur actually that would be a bit odd because telnet6 is not quite the same protocol
21:02 Skarsnik for me it's ipv6
21:03 geekosaur hm, looks like linux's does merge them these days though
21:03 geekosaur so you'd want to verify with: telnet -4 ...
21:04 Skarsnik not sure if that should be fixed or just documented x)
21:06 BooK you're saying that the socket new gets the famiky from the name rsolution?
21:06 Skarsnik yes
21:07 Skarsnik https://github.com/MoarVM/MoarVM/blob/master/src/io/syncsocket.c#L302 and https://github.com/MoarVM/MoarVM/blob/master/src/io/syncsocket.c#L270
21:07 BooK so even if I passed an explicit family it would overriden by the one from the resolution
21:08 Skarsnik yes, since it's never used
21:08 Kyo91_ joined #perl6
21:08 BooK well if name resolution returns several candidates, it could look at the family and pick
21:08 Skarsnik I think IO::Socket::INET is not really the focus but more IO::Socket::Async
21:10 BooK I think it should be vonsidered a bug and will try to write it up
21:11 Skarsnik I could patch up since I already added stuff in that (to add source address and source port in connect)
21:12 galx joined #perl6
21:23 galx m:
21:25 galx I have a problem
21:25 galx https://pastebin.com/vMvRFr8M
21:26 galx I want `a` token to match "abc def" and `b` token to match "etc."
21:26 galx but it fails anyway
21:26 galx how to do that correctly?
21:41 Danishman joined #perl6
21:43 AlexDaniel joined #perl6
21:44 BooK Skarsnik: reading your links now
21:45 BooK oh so it's in MoarVM?
21:45 Cabanossi joined #perl6
21:46 okl joined #perl6
21:46 BooK where is the link between rakudo and moarvm done? nqp?
21:48 Skarsnik probably rakudo/core/io/Socket/INET.pm6 ?
21:48 Skarsnik there is no nqp side for connect
21:49 MasterDuke BooK: generally yes, nqp:: ops are implemented by moarvm
21:49 cono m: grammar Grammar { regex TOP { ^^ <a> <ws> <b> $$ }; regex a { <word>+ % <ws> }; token word { <alpha>+ }; regex b { <alpha>+ "." }; }; Grammar.parse("abc def etc.").say
21:49 camelia rakudo-moar 591b93: OUTPUT: «「abc def etc.」␤ a => 「abc def」␤  word => 「abc」␤   alpha => 「a」␤   alpha => 「b」␤   alpha => 「c」␤  ws => 「 」␤  word => 「def」␤   alpha => 「d」␤   alpha => 「e」␤   alpha => 「f」␤ ws => 「 」␤…»
21:49 cono galx: ^^
21:50 Skarsnik buggable, find listen
21:50 cono by doing <alpha>+ % "something> you are asking to make <alpha> "something" <alpha> "something" up to infinity
21:50 Skarsnik don't remember wich bot allow to grep in the code x)
21:50 BooK right, https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Socket/INET.pm#L122 and https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Socket/INET.pm#L132
21:52 BooK so in there, there is a default of PIO::PF_INET i.e. IPv4
21:52 cono and rule also should be changed to regex, to make backtracking mechanism possible
21:52 MasterDuke Skarsnik: greppable6 searches all the ecosystem modules
21:52 BooK but the name resolution is not done there
21:52 Skarsnik yeah and moar does not get this info
21:52 BooK note sure what $PIO is here: https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Socket/INET.pm#L117
21:52 MasterDuke s: IO::Socket::INET.new, 'listen'
21:52 SourceBaby MasterDuke, Something's wrong: ␤ERR: Type check failed in binding to parameter '&code'; expected Callable but got Nil (Nil)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e line 6␤␤
21:53 BooK s: IO::Socket::INET.new, :listen # I think
21:53 SourceBaby BooK, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')'␤at -e:7␤------> <BOL><HERE><EOL>␤
21:53 BooK s: IO::Socket::INET.new( :listen ) # better
21:53 SourceBaby BooK, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')'␤at -e:7␤------> <BOL><HERE><EOL>␤
21:54 MasterDuke s: IO::Socket::INET.new, \(:listen)
21:54 SourceBaby MasterDuke, Something's wrong: ␤ERR: Earlier failures:␤ Nothing given for new socket to connect or bind to. Invalid arguments to .new?␤  in block <unit> at -e line 6␤␤Final error:␤ Cannot resolve caller sourcery(Failure, Capture); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
21:54 BooK anyways
21:54 Kyo91_ joined #perl6
21:58 BooK https://github.com/perl6/nqp/blob/master/src/vm/moar/QAST/QASTOperationsMAST.nqp#L2047 # this is where the link is made, right?
21:59 Exodist joined #perl6
21:59 Cabanossi joined #perl6
22:01 BooK Skarsnik: https://github.com/MoarVM/MoarVM/blob/master/src/io/syncsocket.c#L231-L233 # this look interesting
22:01 perlpilot cono: I dunno ... using token like that is a good habit to get into.  It's only the `a` rule that really needs backtracking.
22:01 cono BooK: you can look to my series of ticket to add get_port op: https://github.com/MoarVM/MoarVM/pull/602, there is a cross links between moar nqp and rakudo
22:02 cono perlpilot: a and TOP
22:03 cono b should token, agree
22:03 cono should be*
22:04 Skarsnik BooK, na it's just to tell you the returned type for this function is not good if you get a ipv6 stuff, but it kinda work since the 2 struct for ipv4/ip6 start the same
22:05 Skarsnik anyways, time for bed ^^
22:05 perlpilot m: grammar G { rule TOP { <a> <b> }; regex a { <word>+ % <.ws> }; token b { <word> \.  }; token word { <.alpha>+ }; }; say G.parse("abc def etc.");
22:05 camelia rakudo-moar 591b93: OUTPUT: «「abc def etc.」␤ a => 「abc def」␤  word => 「abc」␤  word => 「def」␤ b => 「etc.」␤  word => 「etc」␤»
22:06 BooK cono: well, I'm not wanting to add a new op, just fix this one
22:06 pyrimidine joined #perl6
22:07 cono perlpilot: heh, thanks. works indeed
22:08 BooK well, I disagree with Skarsnik: MVM_io_resolve_host_name is what returns the socket to be used, and if the Perl6 IO::Socket::INET gave a family, that should be a hint on which to pick when there's a choice
22:09 BooK https://github.com/MoarVM/MoarVM/blob/master/src/io/syncsocket.c#L242 # result here is a linked list
22:09 BooK but moar just picks the first item in the list
22:10 BooK I'd say that family should be passed, and the first item in the list that match the family spec is return
22:10 BooK and still the first is no family is given
22:10 cdg joined #perl6
22:10 BooK do I make sense ?
22:12 BooK struct addrinfo has this as its last item: struct addrinfo *ai_next;
22:12 BooK "The items in the linked list are linked by the ai_next field."
22:13 BooK luckily, MVM_io_resolve_host_name is not used it too many places
22:22 dogbert2 joined #perl6
22:24 shadowpaste joined #perl6
22:40 wamba joined #perl6
22:44 astj joined #perl6
22:59 Sgeo joined #perl6
23:10 cdg joined #perl6
23:13 raschipi joined #perl6
23:15 BenGoldberg joined #perl6
23:18 BooK writing a moarvm bug report for the issue
23:18 BooK the problem is that it requires a signature change, I think
23:24 BooK https://github.com/MoarVM/MoarVM/issues/683 # I hope this makes sense
23:28 raschipi BooK: Makes sense, but can't it be solved by having a multi? If one uses the old call, and if they send the list they would ge the new one?
23:28 cdg joined #perl6
23:29 BooK raschipi: in which language? nqp?
23:30 BooK rakudo should definitely use the new call, because it's supposed to ask for a specific family
23:31 BooK I understand changing the signature of MVM_io_resolve_host_name creates some compatibility problems, but I'm not versed enough in C or MoarVM to propose a good solution to that
23:37 BooK https://design.perl6.org/S32/IO.html#IO%3A%3ASocket%3A%3AINET # I see this was not the most fleshed out part of the design docs
23:41 raschipi I have to mention there's a RIGTH THING™ to do when picking an AF_INET  family to communicate: happy eyebals, RFC 6555
23:56 Lac joined #perl6
23:59 geekosaur joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo