Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-09-11

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

All times shown according to UTC.

Time Nick Message
00:59 astj joined #perl6-dev
01:00 Geth ¦ roast: skids++ created pull request #309: Unskips and various roast cleanups
01:00 Geth ¦ roast: review: https://github.com/perl6/roast/pull/309
01:00 Geth ¦ roast/master: 16 commits pushed by skids++
01:00 Geth ¦ roast/master: review: https://github.com/perl6/roast/compare/bae1108d8f...bcc599cc1b
01:02 dalek joined #perl6-dev
01:08 cognominal joined #perl6-dev
01:55 ilbot3 joined #perl6-dev
01:55 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
02:54 * AlexDaniel looks at https://github.com/perl6/roast/commit/a743fe353b9e5b718959c648944f7d24f9ec925f and scratches his head
02:54 AlexDaniel that's not the first time the behavior of state vars in code blocks is changed, and again I wonder how many people were relying on this behavior…
03:15 AlexDaniel .tell samcv Hey. I'm looking at https://github.com/perl6/roast/commit/640d40ee81c1cd728d1127bfaf6648082c4b03a5 and I can't quite understand it. To me it seems like the previous test was explicitly testing Malayalam combiners on a random character, but now it's two combiners on nothing. I guess the previous version wasn't really “unanchored” and the current version is, but the way behavior has changed is really confusing. So if
03:15 AlexDaniel previously it was possible to match some combiner with <:smth>, now it's not? Is it something we want to change within 6c? (asking because it needs errata change)
03:15 yoleaux AlexDaniel: I'll pass your message to samcv.
03:15 AlexDaniel .tell samcv previously it was possible to match some combiner with <:smth>, now it's not? Is it something we want to change within 6c? (asking because it needs errata change)
03:15 yoleaux AlexDaniel: I'll pass your message to samcv.
03:16 samcv hello
03:16 yoleaux 03:15Z <AlexDaniel> samcv: Hey. I'm looking at https://github.com/perl6/roast/commit/640d40ee81c1cd728d1127bfaf6648082c4b03a5 and I can't quite understand it. To me it seems like the previous test was explicitly testing Malayalam combiners on a random character, but now it's two combiners on nothing. I guess the previous version wasn't really “unanchored” and the current version is, but the way behavior has changed is really confusing.
03:16 yoleaux So if
03:16 yoleaux 03:15Z <AlexDaniel> samcv: previously it was possible to match some combiner with <:smth>, now it's not? Is it something we want to change within 6c? (asking because it needs errata change)
03:16 AlexDaniel ha, yoleaux didn't manage to fit the first part in one message
03:17 samcv well it should match the base character so i'm not sure why it acted that way before. it changed when i updated the unicode database. so unicode may have changed things
03:17 samcv i mean it doesn't make much sense to match against the combiners, unless the combiners aren't attached to any base character
03:18 samcv but it used to test that InMalayam would match if it was a CJK character with a in malayam combining glyph
03:18 samcv which didn't make much sense
03:18 samcv i mean it's a pretty old file
03:18 TimToady joined #perl6-dev
03:19 samcv m: say "á\c[combining caron]" ~~ /<:Mn>/
03:19 camelia rakudo-moar 7da0c2: OUTPUT: «Nil␤»
03:19 samcv like this doesn't match
03:19 samcv even though combining caron is Mn
03:20 samcv m: say "á\c[combining caron]" ~~ /<:InCombining_Diacritical_Marks>/
03:20 camelia rakudo-moar 7da0c2: OUTPUT: «Nil␤»
03:20 samcv this doesn't match either
03:20 samcv neither did "á\c[combining caron]" ~~ /<:InCombining_Diacritical_Marks>/ match in older versions
03:21 samcv i have no clue why that test passed before. but in no other cases does it work like that to my knowledge. it seems like it was a mistake
03:21 samcv that just happened to work maybe
03:22 AlexDaniel indeed
03:22 samcv i'm guessing
03:22 samcv i fixed it when i made property values distinct per property :P
03:22 AlexDaniel m: say "\c[combining caron]" ~~ /<:Mn>/
03:22 camelia rakudo-moar 7da0c2: OUTPUT: «「̌」␤»
03:22 samcv since the block didn't change at all
03:22 AlexDaniel m: say "\c[combining caron]" ~~ /<:InCombining_Diacritical_Marks>/
03:22 camelia rakudo-moar 7da0c2: OUTPUT: «「̌」␤»
03:27 Geth ¦ roast/6.c-errata: 592a8d8c47 | (Samantha McVey)++ (committed by Aleks-Daniel Jakimenko-Aleksejev) | S05-mass/properties-block.t
03:27 Geth ¦ roast/6.c-errata: Fix InMalayalam test
03:27 Geth ¦ roast/6.c-errata:
03:27 Geth ¦ roast/6.c-errata: Previously this test was a CJK base with a Malayalam extending character.
03:27 Geth ¦ roast/6.c-errata: Replace it so the base character is also Malayalam.
03:27 Geth ¦ roast/6.c-errata:
03:27 Geth ¦ roast/6.c-errata: IRC discussion: https://irclog.perlgeek.de/perl6-dev/2017-09-11#i_15144609
03:27 Geth ¦ roast/6.c-errata: review: https://github.com/perl6/roast/commit/592a8d8c47
03:29 AlexDaniel .tell Zoffix toaster plz
03:29 yoleaux AlexDaniel: I'll pass your message to Zoffix.
03:38 samcv i think i almost have fixed the problem where prepend doesn't work right. like "\c[arabic number sign]1" ~~ /:m 1/
03:38 samcv nice
03:41 samcv yay
03:42 * AlexDaniel is thinking that unicode support in rakudo would've been garbage without samcv
03:42 samcv :P
03:43 samcv it was pretty good, now it's just more better
03:43 samcv thanks for the compliment though :)
03:48 samcv if all the codepoints are prepend i'll set it to 0 (the index of the base character) otherwise it's whatever codepoint is after the last prepend in the synthetic
04:07 samcv u: { .uniprop('Prepend') }
04:08 unicodable6 samcv, U+0000 <control-0000> [Cc] (control character)
04:08 unicodable6 samcv, U+0001 <control-0001> [Cc] (control character)
04:08 unicodable6 samcv, Cowardly refusing to gist more than 5000 lines
04:08 samcv u: { .uniprop-bool('Prepend') }
04:08 unicodable6 samcv, U+0001 <control-0001> [Cc] (control character)
04:08 unicodable6 samcv, U+0000 <control-0000> [Cc] (control character)
04:08 unicodable6 samcv, Cowardly refusing to gist more than 5000 lines
04:50 ugexe m: while note ++$ { my $a := gather { loop { take 1 } }; for 0 { await start { $a[0] }, start { $a[0] } } }
04:50 camelia rakudo-moar 7da0c2: OUTPUT: «(signal SEGV)1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤31␤32␤33␤34␤35␤36␤37␤38␤39␤40␤41␤42␤43␤44␤45␤46␤47␤48␤49␤50␤…»
04:52 ugexe m: while note ++$ { my $a := gather { loop { take 1 } }; await start { $a[0] }, start { $a[0] } }
04:52 camelia rakudo-moar 7da0c2: OUTPUT: «1␤Tried to get the result of a broken Promise␤  in block <unit> at <tmp> line 1␤␤Original exception:␤    Cannot call method 'push' on a null object␤      in block  at <tmp> line 1␤      in block  at <tmp> line 1␤␤»
05:02 ugexe debug symbols + gdb show the segfault at a few different array access points
05:03 MasterDuke i just ran it with perl6-gdb-m a couple times and it always pointed to src/6model/reprs/VMArray.c:148
05:06 ugexe yeah thats one. i've also gotten src/core/compunit.h:9, src/gc/wb.h:8, and src/6model/reprs/MVMMultiCache.c:418
05:07 MasterDuke oh, just got MVMSpeshLog.c:54
05:09 MasterDuke just did about 10 runs with MVM_SPESH_DISABLE=1, always src/6model/reprs/VMArray.c:148
06:23 [Tux] This is Rakudo version 2017.08-106-g7da0c2159 built on MoarVM version 2017.08.1-150-g0b81969d
06:23 [Tux] csv-ip5xs        1.429 -  1.530
06:23 [Tux] test            10.015 - 10.187
06:23 [Tux] test-t           3.487 -  3.624
06:23 [Tux] csv-parser      11.059 - 11.462
06:56 lizmat Files=1223, Tests=67636, 291 wallclock secs (11.13 usr  4.54 sys + 1971.26 cusr 207.84 csys = 2194.77 CPU)
07:03 Geth ¦ rakudo/nom: 0ca5ffa408 | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/BUILDPLAN.nqp
07:03 Geth ¦ rakudo/nom: Use more idiomatic push rather than @a[+@a]
07:03 Geth ¦ rakudo/nom:
07:03 Geth ¦ rakudo/nom: Should be faster as well, although that doesn't matter much at compile
07:03 Geth ¦ rakudo/nom: time.
07:03 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0ca5ffa408
07:24 masak ok -- hi -- so I have another one. just golfed it.
07:24 masak m: constant C = hash(D => sub () { say "OH HAI" }); C<D>()
07:24 camelia rakudo-moar 0ca5ff: OUTPUT: «OH HAI␤»
07:24 masak if you put the `constant C = hash(D => sub () { say "OH HAI" })` bit in a module and import the module, you get an error.
07:24 masak `Cannot invoke this object (REPR: Null; VMNull)`
07:25 masak something BC-related, p'haps?
07:25 masak jnthn: ping ^
07:27 nine timotimo: Thinking about your "i find it bad enough that we start the compiler at run time when we use nativecall", that's only necessary because when the native trait is applied, we may not yet know about the returns trait. We only need to be able to run code _after_ the sub is fully declared.
07:28 masak m: constant C = sub () { say "OH HAI" }; (C)()
07:28 camelia rakudo-moar 0ca5ff: OUTPUT: «OH HAI␤»
07:28 masak shorter golf ^
07:32 masak "[BUG] Subs in constants don't survive through module boundary in Rakudo" <-- if I were in a position to submit this one to RT
08:08 dogbert2 joined #perl6-dev
08:10 geekosaur is it that, or compile vs. runtime fun?
08:11 geekosaur hm, on second thought I suspect this is SC related
09:04 Skarsnik joined #perl6-dev
09:07 lizmat good *, #perl6-dev!
09:08 lizmat timotimo: what is the way to trigger the BUILDALLPLAN 12 case: container_initializer ?
09:09 lizmat timotimo: apparently, that is being set if %cont_info<build_ast> is set, by
09:09 lizmat but I can't find where *that* is set, so I wonder if this is a piece of dead code >
09:09 lizmat ?
09:09 ggoebel joined #perl6-dev
09:13 Skarsnik releasable6, status
09:13 releasable6 Skarsnik, Next release in 5 days and ≈9 hours. 1 blocker. Changelog for this release was not started yet
09:13 releasable6 Skarsnik, Details: https://gist.github.com/5059886f6536c810d0ded7733e84f670
09:33 [TuxCM] joined #perl6-dev
09:38 Geth ¦ rakudo: Gnouc++ created pull request #1154: Supress line number if throw X::Package::Stubbed
09:38 Geth ¦ rakudo: review: https://github.com/rakudo/rakudo/pull/1154
09:39 Geth ¦ roast: Gnouc++ created pull request #310: Add test for stubbed class
09:39 Geth ¦ roast: review: https://github.com/perl6/roast/pull/310
09:45 Skarsnik Who is in charge of this release ? x⁾
09:46 Skarsnik and how did I do this fancy parenthesis xD
09:47 geekosaur ⁾ for me is <compose> ^ )
09:51 Skarsnik oh it's ^ + ) for me
09:51 Skarsnik interesting, ^ is a composer for stuff
09:52 geekosaur "dead key"
09:52 geekosaur in X11 parlance at least
09:53 Skarsnik can only do ⁼⁾⁻⁽ and 2 others that does not show on this font/os
09:56 Skarsnik m: say 2²
09:56 camelia rakudo-moar 0ca5ff: OUTPUT: «4␤»
10:02 lizmat timotimo: found it (re container_initializer)
10:08 raydiak__ joined #perl6-dev
10:09 Geth ¦ rakudo/nom: 760530a524 | (Elizabeth Mattijsen)++ | 2 files
10:09 Geth ¦ rakudo/nom: Remove action 13 from BUILDALLPLAN
10:09 Geth ¦ rakudo/nom:
10:09 Geth ¦ rakudo/nom: In BUILDALL this is a noop, so don't put it in the BUILDALLPLAN
10:09 Geth ¦ rakudo/nom: to begin with.  And since we now removed that, we don't need to
10:09 Geth ¦ rakudo/nom: support this in Mu.BUILDALL either.
10:09 Geth ¦ rakudo/nom:
10:09 Geth ¦ rakudo/nom: This should have some effect minor effect on memory usage, and
10:09 Geth ¦ rakudo/nom: maybe some noticeable effect in build times of objects with attributes
10:09 Geth ¦ rakudo/nom: that don't need initialization.
10:09 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/760530a524
10:13 |Tux| joined #perl6-dev
10:30 jnthn masak: fwiw, I think that one already is in RT
10:53 llfourn joined #perl6-dev
10:58 jnthn lizmat: I think you got a patch in relating to https://rt.perl.org/Ticket/Display.html?id=132030 ?
11:00 jnthn lunch &
11:01 Skarsnik hm if I understand this fh are not closed when exiting the sub?
11:01 Skarsnik like sub foo { my $fh = open "blabl"} I need to close $fh at the end?
11:03 ilmari Skarsnik: yes, because perl6 doesn't use reference counting, so doesn't provide timely destruction
11:04 ilmari LEAVE { $fh.close } should do the trick
11:04 Skarsnik but should the gc close the handle when it will free $fh?
11:04 ilmari it will, but there's no guarantee as to when that will happen
11:19 lizmat jnthn: indeed RT #132030 has been fixed using proposed method one (keeping list of open files)
11:19 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=132030
11:20 lizmat jnthn: mind you, not on the JVM, as nqp::filenofh is not implemented there
11:44 skids joined #perl6-dev
11:47 awwaiid joined #perl6-dev
11:49 nine And cannot be implemented
11:49 nine At least not without rewriting large parts of I/O
11:59 AlexDaniel joined #perl6-dev
12:11 jnthn We didn't implementing buffering on JVM either
12:15 jnthn *impleemnt
12:16 jnthn So it's not a big deal
12:55 Skarsnik_ joined #perl6-dev
13:01 AlexDaniel Skarsnik_: I am, why?
13:39 pyrimidi_ joined #perl6-dev
13:50 skids joined #perl6-dev
14:01 astj joined #perl6-dev
14:10 astj joined #perl6-dev
14:11 Skarsnik_ joined #perl6-dev
14:13 Skarsnik__ joined #perl6-dev
16:02 Ven`` joined #perl6-dev
16:10 skids joined #perl6-dev
16:22 ilmari speaking of reference counting: https://xkcd.com/1888/
16:25 dogbert17 joined #perl6-dev
16:45 pyrimidine joined #perl6-dev
16:48 pyrimidi_ joined #perl6-dev
16:50 pyrimidine joined #perl6-dev
16:58 robertle joined #perl6-dev
17:38 ggoebel joined #perl6-dev
17:52 TimToady nine: so maybe that's another good reason to get rid of the returns trait in favor of -->
17:52 yoleaux 8 Sep 2017 15:05Z <b2gills> 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
17:54 TimToady b2gills: it is good to have those principles out where people can see them, in short, "Don't ever put the user or the compiler in a situation where they don't know what language they're running."
17:54 TimToady nine: or at least restrict nativecall to using -->
17:55 TimToady of course, we could always just say it's a DIHWIDT if 'native' comes too early too
18:00 nine We could add such a restriction in a NativeCall:api<2>
18:00 nine Except that use NativeCall; (as documented) doesn't specify an API version at all
18:01 Skarsnik I don't like the --> syntax x)
18:01 Skarsnik (yes, very useful input)
18:02 nine Skarsnik: well what use is the whole "multiple ways to do things" mantra when one cannot make use of it?
18:03 nine What we could do however is have the Native trait compile at compile time if the signature is already complete and fall back to runtime if it isn't. Then it's still backwards compatible.
18:03 Skarsnik I must be missing a bit of the conversation, what is the issue with returns ?
18:04 Skarsnik hm the code in the native trait is run at compile time. you mean the CALL-ME creation?
18:05 nine Skarsnik: the native call site in MoarVM is created through the nqp::nativecallbuild OP the first time a native sub is called. Doing that at the time the native trait is applied doesn't work in the case of sub foo() is native(Str) returns Int { * }
18:05 nine In that case the return type is not yet known at the time the native trait is applied.
18:06 Skarsnik hoo I though returns was just another way to write -->
18:06 Skarsnik so with --> you know the return type?
18:07 nine apparently :)
18:07 Skarsnik dunno when I wrote https://github.com/rakudo/rakudo/blob/nom/lib/NativeCall.pm6#L234 I remember having the return type at compile time
18:08 nine The returns trait just calls $target.signature.set_returns($type)
18:09 Skarsnik m: INIT { say "hello"}; use NativeCall; sub foo is native returns Int {*};
18:09 camelia rakudo-moar 760530: OUTPUT: «hello␤»
18:10 Skarsnik that shoud have returned an error, interesting
18:10 Skarsnik m: INIT { say "hello"}; use NativeCall; sub foo is native(---> Int)  {*};
18:10 camelia rakudo-moar 760530: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Prefix - requires an argument, but no valid term found␤at <tmp>:1␤------> 3}; use NativeCall; sub foo is native(---7⏏5> Int)  {*};␤    expecting any of:␤        prefix␤»
18:10 Skarsnik m: INIT { say "hello"}; use NativeCall; sub foo is native(--> Int)  {*};
18:10 camelia rakudo-moar 760530: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Prefix -- requires an argument, but no valid term found␤at <tmp>:1␤------> 3"}; use NativeCall; sub foo is native(--7⏏5> Int)  {*};␤    expecting any of:␤        prefix␤»
18:11 Skarsnik duh, it's not the syntax for --> ?
18:12 nine m: INIT { say "hello"}; use NativeCall; sub foo(--> Int) is native {*};
18:12 camelia rakudo-moar 760530: OUTPUT: «Potential difficulties:␤    The returning type of 'foo' --> Int is erroneous. You should not return a non NativeCall supported type (like Int inplace of int32), truncating errors can appear with different architectures␤    at <tmp>:1␤    ------> 3…»
18:14 Skarsnik Oh yeah I am dumb
18:14 geekosaur is native(...) looks in ... for the symbol
18:14 geekosaur kinda hard to distinguish that from a proto
18:14 geekosaur er, a signature
18:15 Skarsnik nine, could you fix the test? (04/18-sig) and replace the returns with --> ?
18:36 timotimo nine: is the returns thing in place if you put it before is native perhaps?
18:42 pyrimidine joined #perl6-dev
18:47 pyrimidine joined #perl6-dev
18:51 pyrimidine joined #perl6-dev
18:54 pyrimidine joined #perl6-dev
18:56 ggoebel joined #perl6-dev
19:00 pyrimidine joined #perl6-dev
19:07 AlexDaniel joined #perl6-dev
19:08 pyrimidine joined #perl6-dev
19:08 AlexDaniel .
19:20 hoelzro joined #perl6-dev
19:21 robertle joined #perl6-dev
19:23 hankache joined #perl6-dev
19:52 gfldex joined #perl6-dev
19:53 gfldex is IO::Handle.lines supposed to work on fifos?
19:55 gfldex i'm getting Original exception:
19:55 gfldex It is not possible to seek this kind of handle
19:55 gfldex in block <unit> at bin/fifo-test.p6 line 7
19:57 timotimo hm, why do we try to seek in there?
19:58 mst presumably because lines does a seek-to-start to get all the lines?
19:58 gfldex it throws after the first input line is delivered
19:59 timotimo hm, not sure if it should. i'd expect to be able to read a few bytes and then start consuming lines
20:00 gfldex source: https://gist.github.com/gfldex/7d89ad2b17746e39a0f53934c57bb6a8
20:00 gfldex I can't RT that because RT doesn't like my e-mails anymore
20:01 timotimo i suppose just "radio-fifo-in".IO.lines won't do it?
20:02 gfldex I can try
20:05 gfldex .emit "name".IO.lines; just quits after reading 2 lines
20:05 gfldex .emit for "name".IO.lines; # even
20:07 perlpilot joined #perl6-dev
20:08 gfldex .emit for $fifo-in.lines; # quits after reading just one line
20:09 timotimo huh, that's certainly weird
20:09 timotimo i must admit i haven't used fifo ... i think ever?
20:11 ugexe maybe https://github.com/rakudo/rakudo/blob/760530a524a525f6a0d4f6ba6e5716b6591211c6/src/core/IO/Handle.pm#L470 needs to have a conditional instead of a try
20:12 timotimo what would you condite on?
20:12 timotimo having an attribute "is this a fifo"?
20:12 timotimo it shouldn't give you the error though :\
20:13 ugexe in moarvm its here https://github.com/MoarVM/MoarVM/blob/41e1b7cef56e29263762037dd0e5d38049affbfa/src/io/syncfile.c#L102
20:19 Brock joined #perl6-dev
20:21 timotimo is it really this specific sink-all? it shouldn't be sinking at all
20:31 JimmyZ joined #perl6-dev
20:33 ilmari[m] joined #perl6-dev
21:02 geekosaur really, you should have a fallback for seek failed (terminals/ptys, pipes, fifos, sockets, character special files)
21:04 geekosaur it's a common thing, ylou should not blindly assume seekable and then come up with ways to detect the exceptions beforehand
21:05 geekosaur especially since you cannot distinguish a fifo except by moderately tricky open behaviors that require a cooperating second opener *and no non-cooperating ones* which means in practice you can't do those tests.
21:06 geekosaur hm, actually I guess stat/fstat catches fifos. pipes are harder, ptys vs. ttys/serial ports vs. (say) parallel ports, ... just don't get into that business, it will only make you cry
21:18 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/09/11/2017-37-collating-sorted/
21:18 ugexe joined #perl6-dev
21:28 perlpilot_ joined #perl6-dev
21:31 samcv is there a way to `require` something that hasn't been installed with zef?
21:31 samcv or impossible?
21:31 samcv like something in a lib folder for example
21:31 nativecallable6 joined #perl6-dev
21:31 releasable6 joined #perl6-dev
21:38 geekosaur -Ilib ?
21:38 geekosaur or use lib 'lib'
21:48 Geth ¦ roast/6.c-errata: c554b68d92 | (Jonathan Worthington)++ (committed by Aleks-Daniel Jakimenko-Aleksejev) | S04-declarations/state.t
21:48 Geth ¦ roast/6.c-errata: Correct bad state expectation
21:48 Geth ¦ roast/6.c-errata:
21:48 Geth ¦ roast/6.c-errata: Due to a compiler bug, the closure here was not being cloned by its
21:48 Geth ¦ roast/6.c-errata: outer scope. This caused various nasty thread safety bugs, and has now
21:48 Geth ¦ roast/6.c-errata: been rectified. However, this test depended on the buggy behavior.
21:48 Geth ¦ roast/6.c-errata: review: https://github.com/perl6/roast/commit/c554b68d92
21:51 jnthn AlexDaniel++
21:57 samcv Geth, that won't work
21:58 samcv you can't use lib in modules
21:59 geekosaur oh, that was completion fail. was wondering...
22:00 samcv require works for thinks installed with zef. cause i'm guessing it's installed to compunits or something?
22:00 geekosaur I think if you are using modules "out of place" you're expected to use -I. but I'd have to know more details (and unfortunately would then likely hit the limits of what I know)
22:02 geekosaur https://docs.perl6.org/language/modules#Finding_Modules ?
22:03 samcv it's just in a folder though
22:04 samcv so the question is to get it to work without having it installed
22:05 geekosaur hm. I thought that worked for random uninstalled modules
22:06 lizmat good night, #perl6-dev!
22:06 geekosaur maybe we really do need the dummy CUR for not-properly-installed stuff. would have to error out on things like :ver and :auth since it can't deal with them, and would probably need to keep its own precomp and precomp on first use
22:06 samcv https://github.com/samcv/test
22:06 samcv this is what i'm trying
22:07 geekosaur (we had someone around the other day who was whiny about not being able to arbitrarily hotpatch any file on the system, including having a rant about OS package managers being evil)
22:07 samcv the require fails in lib/main.pm6
22:07 samcv night lizmat !
22:09 jnthn samcv: ooc, is it specifically require that's having issues, and use works?
22:09 samcv yes just require
22:11 samcv i mean it actually doesn't work when i do use
22:11 samcv because it can't find bar with ::( )
22:11 jnthn The require itself doesn't fail though?
22:11 samcv but if i comment out that line. and only leave the require. then yes that doesn't work
22:11 samcv the require is what fails yes. if i change the rquire for use, then it fails on the line below
22:11 timotimo lizmat: i find it strange to have the "ipython perl6 notebook in docker" once as a blog post and once as a tweet
22:12 jnthn samcv: ah, I see the problem
22:12 samcv maybe it wants me to refer to it as something other than bar, i don't know? or maybe i need to add module unit or something?
22:12 jnthn sub bar ($str) is export {
22:12 jnthn That's a lexical sub bar being exported
22:12 samcv need a diff name?
22:13 jnthn I think if you add at the top
22:13 jnthn unit module bar;
22:13 jnthn And then make it our sub bar($str) {
22:13 jnthn Then it'll work out
22:13 jnthn ::($var)::{"&$var"}($str); is just a package lookup
22:13 samcv ok cool
22:14 timotimo lizmat++ # weekly again
22:16 samcv hmm jnthn Cannot find method 'Any' on object of type Str
22:16 jnthn hmm
22:16 samcv ah it's not getting it back hold on
22:17 committable6 joined #perl6-dev
22:22 pyrimidine joined #perl6-dev
22:23 samcv jnthn, how can i dump all symbols?
22:23 samcv cause ::($var) is an object
22:23 samcv i'm just getting any back when i try to do the lookup
22:24 pyrimidi_ joined #perl6-dev
22:27 timotimo you'll probably want ::.keys or maybe .WHO.keys
22:28 ugexe don't you have to `our` something you want to access with ::name?
22:29 timotimo oh, mhm
22:29 pyrimidine joined #perl6-dev
22:29 timotimo but we also have MY:: for example
22:29 timotimo and ::('$var') is MY:: i think
22:30 samcv not getting anything
22:30 samcv oh wait nvm
22:31 samcv ::($var)::.WHO.keys.say; i got the sub
22:31 samcv if i put `our` on the sub
22:32 jnthn 22:13 < jnthn> And then make it our sub bar($str) {
22:32 jnthn ;)
22:32 pyrimidi_ joined #perl6-dev
22:33 samcv yeah i still can't use it though
22:33 samcv ::($var)::{"&bar-sub"} this doesn't work
22:33 samcv do i need to use some other way to access it?
22:34 samcv ah .WHO{ } works
22:34 jnthn ::("$var::&bar-sub") probably works too
22:36 pyrimidine joined #perl6-dev
22:41 pyrimidine joined #perl6-dev
22:41 samcv now i get undeclared routine bar-sub used
22:41 samcv heh
22:42 samcv oh oops that was my bad
22:43 ugexe why not import the symbol? require ::("bar") <&bar>
22:43 samcv yay got it
22:46 pyrimidine joined #perl6-dev
22:46 samcv can <&bar> be a variable?
22:46 samcv i could not get that to work
22:47 jnthn <...> is literal syntax
22:47 jnthn Would have to be {$name-here} or so
22:48 samcv jnthn, that creates a block object
22:49 pyrimidine joined #perl6-dev
22:51 ugexe m: BEGIN my $foo = q|&bar|; require ::("XXX") << $foo >>; ::("&bar")()
22:51 camelia rakudo-moar 760530: OUTPUT: «Could not find XXX at line 0 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Repository::AbsolutePa…»
22:52 geekosaur samcv, afaik that's just a list of expressions at that point
22:54 geekosaur although it's entirely possibl nobody implemented or tested the general case; I know various other documented things with respect to importing are missing
22:55 ugexe m: BEGIN my $foo = q|&source-file|; BEGIN "lib/XXX.pm6".IO.spurt(q|unit module XXX; sub source-file is export { $?FILE }|); require ::("XXX") << $foo >>; say ::($foo)()
22:55 camelia rakudo-moar 760530: OUTPUT: «Could not find XXX at line 0 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Repository::AbsolutePa…»
22:55 ugexe m: BEGIN use lib 'lib'; BEGIN my $foo = q|&source-file|; BEGIN "lib/XXX.pm6".IO.spurt(q|unit module XXX; sub source-file is export { $?FILE }|); require ::("XXX") << $foo >>; say ::($foo)()
22:55 camelia rakudo-moar 760530: OUTPUT: «/home/camelia/lib/XXX.pm6 (XXX)␤»
22:56 jnthn samcv: I meant after the ::('module-name').WHO or so
22:57 jnthn samcv: But what ugexe is suggested is a better way :)
22:57 jnthn *suggesting
22:57 samcv ok cool. so use << >>
22:57 pyrimidine joined #perl6-dev
22:58 skids joined #perl6-dev
22:58 ugexe a list of strings
22:59 ugexe "$foo", "baz"; also works
23:00 samcv that doesn't seem to work
23:00 samcv hm
23:00 samcv it says
23:00 samcv Use of uninitialized value $subname of type Any in string context.
23:00 samcv Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
23:00 samcv in any statement_control:sym<require> at /home/samantha/perl6/share/nqp/lib/Perl6/Grammar.moarvm line 1
23:00 ugexe m: BEGIN use lib 'lib'; BEGIN my $foo = q|&source-file|; BEGIN "lib/XXX.pm6".IO.spurt(q|unit module XXX; sub source-file is export { $?FILE }|); require ::("XXX") "$foo"; say ::($foo)()
23:00 camelia rakudo-moar 760530: OUTPUT: «/home/camelia/lib/XXX.pm6 (XXX)␤»
23:01 samcv the valua isn't known at compile time ugexe
23:02 samcv like this https://github.com/samcv/test/blob/master/lib/main.pm6
23:03 samcv if i do <<$modulename>> then i get a different error during compilation about uninitialized value used in a string context
23:04 samcv but with the comma it seems to be doing the correct thing but it can't handle it not being defined yet
23:05 jnthn Sleep here; 'night
23:06 timotimo night jnthn
23:09 ugexe yeah kinda weird it can delay knowing the ::("XXX") but not the << $subname >>
23:10 timotimo but the sub is supposed to be installed in the lexical scope and that's compile-time?
23:10 timotimo or am i misunderstanding?
23:12 ugexe well if `require ::($foo)` can install that name at runtime, why can't subs be imported from it at that time?
23:14 pyrimidine joined #perl6-dev
23:14 timotimo when you require ::($foo) you can only access its contents indirectly, though?
23:14 timotimo the part after that, the names you want to import, is supposed to give you these thigs as lexical symbols
23:15 timotimo and then how is the code supposed to use it :)
23:15 timotimo require ::($mymodule) (prompt "which sub to take?"); i-guess-this-sub-maybe-exists-now(); # how is this supposed to work?
23:17 ugexe ah yeah
23:17 pyrimidi_ joined #perl6-dev
23:17 [TuxCM] joined #perl6-dev
23:21 ugexe m: my $foo = q|&source-file|; BEGIN "lib/XXX.pm6".IO.spurt(q|unit module XXX; our sub source-file is export { $?FILE }|); require ::("XXX"); say ::("XXX::$foo")()
23:21 camelia rakudo-moar 760530: OUTPUT: «Could not find XXX at line 0 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Repository::AbsolutePa…»
23:22 ugexe m: use lib 'lib'; my $foo = q|&source-file|; BEGIN "lib/XXX.pm6".IO.spurt(q|unit module XXX; our sub source-file is export { $?FILE }|); require ::("XXX"); say ::("XXX::$foo")()
23:22 camelia rakudo-moar 760530: OUTPUT: «/home/camelia/lib/XXX.pm6 (XXX)␤»
23:23 timotimo heh.
23:24 ugexe m: my $foo = q|&source-file|; BEGIN "lib/XXX.pm6".IO.spurt(q|unit module XXX; our sub source-file is export { $?FILE }|); require "/home/camelia/lib/XXX.pm6"; say ::("XXX::$foo")()
23:24 camelia rakudo-moar 760530: OUTPUT: «/home/camelia/lib/XXX.pm6␤»
23:27 timotimo i'm a little surprised you are able to use IO at begin time even though restricted setting :)
23:31 geekosaur restricted setting isn't very
23:32 timotimo quite true
23:50 Geth ¦ roast: skids++ created pull request #311: Add tests for RT#129008
23:50 Geth ¦ roast: review: https://github.com/perl6/roast/pull/311
23:50 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=129008
23:50 Geth ¦ roast: 9a09b4ee15 | skids++ | S02-literals/pairs.t
23:50 Geth ¦ roast: Add tests for RT#129008
23:50 Geth ¦ roast: review: https://github.com/perl6/roast/commit/9a09b4ee15
23:50 Geth ¦ roast: d762a6f017 | skids++ (committed using GitHub Web editor) | S02-literals/pairs.t
23:50 Geth ¦ roast: Merge pull request #311 from skids/rt129008
23:50 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=129008
23:50 Geth ¦ roast:
23:51 Geth ¦ roast: Add tests for RT#129008
23:51 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=129008
23:51 Geth ¦ roast: review: https://github.com/perl6/roast/commit/d762a6f017
23:59 MasterDuke joined #perl6-dev

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