Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm Set by Zoffix on 27 July 2018. |
|||||||||||||||||||||||||||||||||||||||
vrurg | jnthn: It demoes that $.a could fail in methods too. | 00:00 | |||||||||||||||||||||||||||||||||||||
Anyway, I still don't see why submethod should be limited in using `$.a`? Maybe I'm missing something, but it's just a shortcut for self.a which just works. | |||||||||||||||||||||||||||||||||||||||
jnthn: I noted it in the ticket: all tests and spectests are passing if I lift this limitation. I would consider allowing it as it definitely provides more good with no harm. | 00:03 | ||||||||||||||||||||||||||||||||||||||
jnthn | vrurg: That just means we're missing spectests covering the behavior. | 00:04 | |||||||||||||||||||||||||||||||||||||
Commented on the rationale in the ticket. This is not an accident. It was discussed and decided on way back. | |||||||||||||||||||||||||||||||||||||||
It's a pity that it didn't receive spectests at the time, though. | 00:05 | ||||||||||||||||||||||||||||||||||||||
Sleep time here; 'night | |||||||||||||||||||||||||||||||||||||||
vrurg | g'night! | 00:07 | |||||||||||||||||||||||||||||||||||||
AlexDaniel | more operators?? | ||||||||||||||||||||||||||||||||||||||
vrurg | AlexDaniel: extension for .+: .- for reverse MRO order. Because I didn't find any good analog for .* I came up with .?- which logically pulled in .?+ | 00:09 | |||||||||||||||||||||||||||||||||||||
AlexDaniel: tests are in github.com/perl6/roast/pull/581 | 00:11 | ||||||||||||||||||||||||||||||||||||||
AlexDaniel | I'm just wondering, do these have to be operators? I understand that's kinda their nature, but I'll never in my life remember the difference between them | 00:22 | |||||||||||||||||||||||||||||||||||||
vrurg | AlexDaniel: because you never used them. :) | 00:23 | |||||||||||||||||||||||||||||||||||||
More precisely: never needed. | |||||||||||||||||||||||||||||||||||||||
AlexDaniel | that's absolutely true, yes | ||||||||||||||||||||||||||||||||||||||
do you think they'll be used often? | |||||||||||||||||||||||||||||||||||||||
.? is ok, but everything else… uhhh | 00:24 | ||||||||||||||||||||||||||||||||||||||
vrurg | A MOP method? But there .+ already. I just slightly modified it and made all four share same base method. | 00:25 | |||||||||||||||||||||||||||||||||||||
AlexDaniel | yeah, but maybe it's .+ that is in the wrong :) | ||||||||||||||||||||||||||||||||||||||
vrurg | .* is extensively used in spectest | 00:26 | |||||||||||||||||||||||||||||||||||||
AlexDaniel | and .*… | ||||||||||||||||||||||||||||||||||||||
vrurg | They do make sense for submethods anyway. My best example is a custom app built from a number of roles/classes implementing certain functionality. Each role/class provide their own command line options. Instead of manually collecting them I can call cli-opt submethod and get a list of definitions. | 00:29 | |||||||||||||||||||||||||||||||||||||
AlexDaniel | these remind me so much of perl5's $… vars | ||||||||||||||||||||||||||||||||||||||
vrurg: right, IRC::Client is doing something similar if I recall correctly | 00:30 | ||||||||||||||||||||||||||||||||||||||
vrurg | Operator look very much natural here because $app.-cil-opts( ... ) is way much tidier than $app.^batch-call('cli-opts', \( ... args ... )) | ||||||||||||||||||||||||||||||||||||||
AlexDaniel | I like the second one more | ||||||||||||||||||||||||||||||||||||||
vrurg | Ah, worse: $app.^batch-call('cli-opts', \( ... args ... ), :reverse) | ||||||||||||||||||||||||||||||||||||||
AlexDaniel | it's longer, but we're fine with longer things :P | 00:31 | |||||||||||||||||||||||||||||||||||||
vrurg | "To whom how" ;) | ||||||||||||||||||||||||||||||||||||||
I'm usually anti-op too, but here I just like it. | |||||||||||||||||||||||||||||||||||||||
AlexDaniel | it's cute | ||||||||||||||||||||||||||||||||||||||
but unreadable | 00:32 | ||||||||||||||||||||||||||||||||||||||
vrurg | No worse than $a (-) $b, anyway. | ||||||||||||||||||||||||||||||||||||||
AlexDaniel | a bit worse, actually | 00:33 | |||||||||||||||||||||||||||||||||||||
I mean, the unicode one kinda sucks too | |||||||||||||||||||||||||||||||||||||||
but otherwise it's a well-known notation | |||||||||||||||||||||||||||||||||||||||
and your example is just an ascii alternative | 00:34 | ||||||||||||||||||||||||||||||||||||||
and we do have things like (elem) which are ok-ish | |||||||||||||||||||||||||||||||||||||||
also, it's literally set subtraction, so that makes sense too | 00:35 | ||||||||||||||||||||||||||||||||||||||
vrurg | BTW, I hate it's unicode ∖ which with many fonts no different from \ | ||||||||||||||||||||||||||||||||||||||
If you need to work with method calls extensively, those will also make sense. ., .+, .- fail if no method found, respectively .?, .?+, .?- don't | 00:37 | ||||||||||||||||||||||||||||||||||||||
I mean, I didn't want any linenoise. And initially I was more like kidding about .?-, but then it seemed like logical. | 00:38 | ||||||||||||||||||||||||||||||||||||||
AlexDaniel | that's nice, yeah | ||||||||||||||||||||||||||||||||||||||
ok, well, I don't know :) | 00:39 | ||||||||||||||||||||||||||||||||||||||
vrurg | Actually, would there be a non-unicode reverse-order analog for .* – I would use it for shortness. But... | 00:40 | |||||||||||||||||||||||||||||||||||||
In either case, the PR is much more than those ops. Unless I miss something, it fully implements github.com/perl6/problem-solving/issues/103 and I didn't belive I could manage it. ;) | 00:42 | ||||||||||||||||||||||||||||||||||||||
00:45
anatofuz left
00:46
anatofuz joined
00:53
anatofuz left
01:01
lucasb left
01:09
anatofuz joined
01:20
MasterDuke left
01:50
AlexDani` joined
01:51
Kaiepi joined
01:54
AlexDaniel left
02:20
squashable6 left
02:23
squashable6 joined,
ChanServ sets mode: +v squashable6
02:51
anatofuz left
02:52
anatofuz joined
02:58
anatofuz left,
epony left
03:08
anatofuz joined
03:28
softmoth left
03:35
anatofuz left
03:41
anatofuz joined
03:46
anatofuz left
04:43
ZzZombo joined
05:01
anatofuz joined
05:03
anatofuz left
05:08
ZzZombo left
05:09
ZzZombo joined
05:29
anatofuz joined
05:33
anatofuz left
05:41
anatofuz joined
05:45
anatofuz left
06:14
ZzZombo_ joined
06:16
ZzZombo left,
ZzZombo_ is now known as ZzZombo
06:20
anatofuz joined
06:27
anatofuz left
06:37
epony joined
06:56
anatofuz joined
07:36
anatofuz left
07:37
anatofuz joined
07:42
anatofuz left
07:47
anatofuz joined
07:52
anatofuz left,
epony left,
anatofuz joined
07:54
epony joined
08:00
anatofuz left
08:02
anatofuz joined,
anatofuz left
08:10
anatofuz joined
08:20
anatofuz left
08:21
anatofuz joined
08:36
ZzZombo_ joined
08:39
ZzZombo left,
ZzZombo_ is now known as ZzZombo
|
|||||||||||||||||||||||||||||||||||||||
nine | On the one hand one needs to be very careful to not have things like Failures serialized, on the other hand I constantly run into "Cannot invoke this object (REPR: Null; VMNull)" | 08:43 | |||||||||||||||||||||||||||||||||||||
Even more frustrating since the things that definitely cannot be called are subs like "say" and "note", which robs me of my primary debug tools | 08:44 | ||||||||||||||||||||||||||||||||||||||
08:46
ZzZombo_ joined
08:48
ZzZombo left,
ZzZombo_ is now known as ZzZombo
08:50
anatofuz left,
anatofuz joined
|
|||||||||||||||||||||||||||||||||||||||
nine | Apparently there's an issue with EXPORT here. Can be easily reproduced with: echo 'sub EXPORT() { Map.new("&foo" => sub () { note "foo!" }) }' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | 08:54 | |||||||||||||||||||||||||||||||||||||
Same happens with: echo 'my package EXPORT::DEFAULT { our sub foo() { note "foo!" } }' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | 09:01 | ||||||||||||||||||||||||||||||||||||||
This however works just fine: echo 'our sub foo() is export { note "foo!" }' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | 09:02 | ||||||||||||||||||||||||||||||||||||||
As does this: echo 'my package EXPORT::DEFAULT { }; BEGIN EXPORT::DEFAULT.WHO<&foo> := our sub () { note "foo!" }' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | 09:08 | ||||||||||||||||||||||||||||||||||||||
Note that the BEGIN is essential in this case | |||||||||||||||||||||||||||||||||||||||
And a "no precompilation;" fixes all cases | 09:09 | ||||||||||||||||||||||||||||||||||||||
09:14
epony left
09:15
epony joined
09:19
anatofuz left
09:29
ZzZombo left
09:41
anatofuz joined
09:45
anatofuz left
09:59
anatofuz joined
10:03
ZzZombo joined
10:04
anatofuz left
10:24
softmoth joined,
AlexDani` is now known as AlexDaniel,
AlexDaniel left,
AlexDaniel joined
11:43
squashable6 left
11:47
squashable6 joined,
ChanServ sets mode: +v squashable6
13:50
vrurg_ joined
13:53
eaterof joined,
tony-o_ joined,
DrForr_ joined
13:55
literal_ joined,
eater left,
tony-o left,
vrurg left,
kawaii left,
literal left,
DrForr left,
[Coke] left,
mornfall left,
vrurg_ is now known as vrurg,
[Coke] joined,
[Coke] left,
[Coke] joined,
kawaii joined
13:58
mornfall joined,
epony left
14:04
lucasb joined
|
|||||||||||||||||||||||||||||||||||||||
[Coke] | . | 14:32 | |||||||||||||||||||||||||||||||||||||
|Tux| |
|
14:51 | |||||||||||||||||||||||||||||||||||||
nine | Wait....what?! | 15:42 | |||||||||||||||||||||||||||||||||||||
nine@sphinx:~/test/precomp12> echo 'BEGIN Rakudo::Internals.EXPORT_SYMBOL(q<&foo>, ["DEFAULT"], sub () { note "foo!" })' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | |||||||||||||||||||||||||||||||||||||||
foo! | |||||||||||||||||||||||||||||||||||||||
nine@sphinx:~/test/precomp12> echo 'BEGIN { Rakudo::Internals.EXPORT_SYMBOL(q<&foo>, ["DEFAULT"], sub () { note "foo!" }) }' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | |||||||||||||||||||||||||||||||||||||||
Cannot invoke this object (REPR: Null; VMNull) | |||||||||||||||||||||||||||||||||||||||
TreyHarris | statement BEGIN vs block BEGIN would differ in this case in... hm, they should be semantically equivalent in the end. but they aren't semantically equivalent in terms of what the phaser must do, right? Because of the closure? | 16:14 | |||||||||||||||||||||||||||||||||||||
nine | Apparently, everything's fine as long as an exported sub is declared in the top level lexical scope of the comp unit. | ||||||||||||||||||||||||||||||||||||||
But then, so is BEGIN { sub foo() is export { note "foo!" } } | 16:17 | ||||||||||||||||||||||||||||||||||||||
TreyHarris | I am right here, yeah? Been awhile since I've looked at rakudo internals, but phaser BLOCK vs phaser STATEMENT do actually work by constructing a closure of the block and executing it, it's not some special-case macro thing that immediately ingests the block and treats it just like a phaser statement? | ||||||||||||||||||||||||||||||||||||||
nine | AFAIK yes | 16:18 | |||||||||||||||||||||||||||||||||||||
16:34
patrickb joined
|
|||||||||||||||||||||||||||||||||||||||
nine | Looking at the block vs. statement versions with --target=ast, I see definitely more fixup code for the statement version. | 16:55 | |||||||||||||||||||||||||||||||||||||
Ok, I'm beginning to form first vague suspicions | 17:01 | ||||||||||||||||||||||||||||||||||||||
There's this comment in Perl6::Actions for begin_time_lexical_fixup: | 17:02 | ||||||||||||||||||||||||||||||||||||||
When code runs at BEGIN time, such as role bodies and BEGIN blocks, we need to ensure we get lexical outers fixed up properly when deserializing after pre-comp. To do this we make a list of closures, which each point to the outer context. These survive serialization and thus point at what # has to be fixed up | |||||||||||||||||||||||||||||||||||||||
I think these fixups are not propagated down to nested blocks. And they are missing entirely for EXPORT subs which are also run at BEGIN time (of the caller) | 17:03 | ||||||||||||||||||||||||||||||||||||||
TreyHarris | that sounds rather plausible | 17:04 | |||||||||||||||||||||||||||||||||||||
17:04
epony joined
|
|||||||||||||||||||||||||||||||||||||||
nine | Yes, yes indeed! The issue is definitely limited to subroutines in lexical scope. Calling methods OTOH is just fine. | 17:22 | |||||||||||||||||||||||||||||||||||||
I can get it to work by turning this: [flat $self, |@args] into: List.new($self, @args.Slip).flat.Array | 17:23 | ||||||||||||||||||||||||||||||||||||||
Like this example demonstrates, it's just hard to find all the implicit subroutine calls in Perl 6 code... | 17:24 | ||||||||||||||||||||||||||||||||||||||
17:34
looker joined
17:37
looker left
|
|||||||||||||||||||||||||||||||||||||||
vrurg | nine: can you get it fixed? | 17:44 | |||||||||||||||||||||||||||||||||||||
nine | vrurg: given enough time...probably. Do I have that time? That's the more difficult question | 17:48 | |||||||||||||||||||||||||||||||||||||
vrurg | :( :( :( It's a kind of issue affecting lots of code around. I'm not well-enough known with with area to do something about it. | 17:50 | |||||||||||||||||||||||||||||||||||||
github.com/rakudo/rakudo/issues?ut...en+closure | 17:51 | ||||||||||||||||||||||||||||||||||||||
nine | vrurg: given your endeavours into the MOP and role composition, I don't doubt your ability to fix something like this. It's just a different area that you'd have to dig into. My whole understanding of this part of the code comes from making BEGIN time EVAL work. Which I started without knowing anything really. | 17:53 | |||||||||||||||||||||||||||||||||||||
It usually comes down to time, effort and patience | 17:54 | ||||||||||||||||||||||||||||||||||||||
vrurg | nine: I was able to track similar case down to a lost closure long ago. But no more. Serialization is still some magic for me. ;) | 17:56 | |||||||||||||||||||||||||||||||||||||
Maybe you're right and it's time to start digging this fields... | |||||||||||||||||||||||||||||||||||||||
nine | And yes, this area really could use some love. Our support for BEGIN time code really feels half baked still | 17:57 | |||||||||||||||||||||||||||||||||||||
vrurg | *field | ||||||||||||||||||||||||||||||||||||||
My biggest problem is lack of understanding how exactly contexts/frames work. No docs, no papers... Tracing MOP is much easier because it's mostly introspectable. | 17:58 | ||||||||||||||||||||||||||||||||||||||
nine | No docs, no papers, but you got the implementation instead :) | 18:05 | |||||||||||||||||||||||||||||||||||||
Serialization is actually not that magical. There's a serialization context for the currently compiled comp unit. That's just a pile that objects get added to (via $*W.add_object or $*W.add_object_if_no_sc mostly). At the end of compilation, this pile is dumped into the precomp file. | 18:10 | ||||||||||||||||||||||||||||||||||||||
What makes issues surrounding serialization so hard to debug is usually just that the objects on this pile don't have any connection anymore to the code that caused their addition. So it's hard to say, _why_ something got serialized. | 18:11 | ||||||||||||||||||||||||||||||||||||||
18:12
epony left
18:17
epony joined
|
|||||||||||||||||||||||||||||||||||||||
nine | And just for completeness: there's also something called "repossession". This comes into play, when during compilation, we load an object from another comp unit (read: from a module we loaded) and this object gets modified in some way. We then have to dump this modified version into the precomp file as well, even if it didn't originate in this comp unit. | 18:18 | |||||||||||||||||||||||||||||||||||||
vrurg | nine: Thanks! That sorts out some bits in my head. | 18:19 | |||||||||||||||||||||||||||||||||||||
afk& | |||||||||||||||||||||||||||||||||||||||
nine | So the current comp unit sort of takes possession of the modified object. The VM tracks modifications to objects from other serialization contexts (modules) and does this repossesion thing automatically for us. In some cases we don't want that and that's what the obscure scwb ops are about. | 18:20 | |||||||||||||||||||||||||||||||||||||
18:31
MasterDuke joined
19:04
Kaiepi left
19:24
patrickb left
19:26
committable6 left
19:27
committable6 joined
|
|||||||||||||||||||||||||||||||||||||||
vrurg | nine: perhaps, you've convinced me to give it a try. R#2897 is a good and simple candidate for the starting point. | 20:05 | |||||||||||||||||||||||||||||||||||||
synopsebot | R#2897 [open]: github.com/rakudo/rakudo/issues/2897 VMNull in add_method in indirect use | ||||||||||||||||||||||||||||||||||||||
20:06
leont joined
|
|||||||||||||||||||||||||||||||||||||||
nine | vrurg: yeah, looks exactly like the issue with echo 'sub EXPORT() { Map.new("&foo" => sub () { note "foo!" }) }' > A.pm6 && echo 'use A; our sub test() is export { foo }' > B.pm6 && perl6 -I. -e 'use B; test' | 20:36 | |||||||||||||||||||||||||||||||||||||
21:03
Kaiepi joined
|
|||||||||||||||||||||||||||||||||||||||
Geth_ | rakudo: patzim++ created pull request #3224: Add BuildTools installation assistant |
21:10 | |||||||||||||||||||||||||||||||||||||
rakudo: f7b4d71f46 | (Patrick Böker)++ | 2 files Add BuildTools installation assistant Add a script to help with installing the MSVC compiler needed to install binary packages on Windows. Also adapt the documentation to explain when a compiler is needed and how to install it. |
21:12 | ||||||||||||||||||||||||||||||||||||||
rakudo: 1fef78388c | (Patrick Böker)++ (committed using GitHub Web editor) | 2 files Merge pull request #3224 from patzim/msvc-installer Add BuildTools installation assistant |
|||||||||||||||||||||||||||||||||||||||
21:16
leont left
21:45
leont joined
22:09
anatofuz joined
22:17
anatofuz left
22:37
anatofuz joined
22:39
softmoth left
22:44
anatofuz left
23:16
Kaiepi left
23:33
lucasb left
23:58
leont left
|