Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
00:07 reportable6 left 00:25 sena_kun left 00:33 sena_kun joined 01:08 reportable6 joined 01:53 frost joined 03:52 frost left 04:21 squashable6 left 05:24 squashable6 joined 06:06 reportable6 left 06:07 reportable6 joined
Nicholas good *, #moarvm 07:05
japhb Good *, Nicholas! 07:08
07:17 TheAthlete joined
jnthnwrthngtn moarning o/ 07:44
Nicholas \o 08:07
The thermometer claims that it is above zero, but lots of ice outside disagrees
jnthnwrthngtn No ice to be seen here. Just looks grey and miserable 08:22
MasterDuke these headlines annoy me so much. "UK weather: Heavy snow and -7C Arctic blast on its way". actual prediction for my area..."chilly weather with maybe a touch of frost" 09:08
jnthnwrthngtn Yeah, snow is forecast for me far more than it happens. 09:09
MasterDuke jnthnwrthngtn: btw, you might find this interesting dakkak.dev/pdf/wolfram-compiler-cgo20.pdf 09:16
unrelated, but i wonder if we can use things like github.com/python/pyperformance and foss.heptapod.net/pypy/benchmarks to jumpstart our own benchmark collection 09:21
lizmat regarding unsigned integers at HLL level 09:46
I was thinking that maybe UInt would be a subclass of Int? 09:47
instead of a subset?
and that something like "my $a = 42" would codegen to a UInt, rather than an Int? 09:48
the reason I'm asking is handling of AT-POS candidates
having an UInt candidate that is a subset, wouldn't help much with performance, or would it? 09:49
jnthnwrthngtn I'd not sure it should be a subclass of Int since it's more restricted, not more capable 09:51
MasterDuke: Any particular part of it that's especially worth reading? 09:53
lizmat jnthnwrthngtn: but it couldn't be the other way around, could it? I mean, when we don't have a UInt candidate for something, we would want the Int candidate to be selected ? 09:54
jnthnwrthngtn Right, it doesn't make sense that way around either :) 10:08
I ain't convinced subclass makes sense either way, is what I'm saying. 10:09
Question is whether we want the candidate explosion that follows from them being both nominal types
I also doubt we can get away with changing 42.WHAT to not be Int 10:10
lizmat well, if a UInt would dispatch to an Int if there is no UInt handler, that would be pretty contained, no ?
well, if UInt would be a subclass, we would get away with that ?
jnthnwrthngtn Well, only if we think it's OK to invalidate every single tutorial where 42.WHAT says Int. 10:11
MasterDuke class Integer[::T] {}; class Int is Integer[Signed] {}; class UInt is Integer[Unsigned] {} 10:12
jnthnwrthngtn Well, probably just role Integer {} but yeah, if both were to be nominal types there'd be an overarching role
It really depends if we consider UInt as something you explicitly opt in to, and it's usually singed all the way 10:13
Or if we have them just popping up as a regular thing 10:14
In the latter case the ergonomics are much harder to nail down
Nicholas I don't know how to be helpful here. But "Int" isn't a native int, IIRC, so it doesn't have maxima? 10:15
so Int can hold all values that UInt can hold? 10:16
lizmat indeed
jnthnwrthngtn Yes
Nicholas then it feels like UInt is a subtype of Int, which can hold 50% of the (countable infinity) of values 10:17
machine sized `uint` and `int` are different. And I don't know if that previous sentance helps there
MasterDuke jnthnwrthngtn: re the wolfram paper, not sure it's detailed enough for any part to be a complete blueprint for a new rakudo/moarvm capability, probably something just to skim if you get bored 10:18
lizmat Nicholas: well, that's how UInt has been defined: subset of Int where * >= 0
jnthnwrthngtn Well, yeah, that's really the heart of the matter here: should UInt be an actual concrete type that something can possess, or remain as a subset type. 10:19
Nicholas OK, I dont' feel competant to answer that. Or even have a good idea what questions to ask. Clearly it's OK for 42.0 to be distinct from 42 (but numerically equal) so it seems that either answer "subset" or "concrete" is valid 10:21
jnthnwrthngtn I mean, I figure you could argue that Int should be a subtype of Rat on the same "holds a countable infinity of its values" basis, but we've instead drawn the lines on the basis of representation 10:26
lizmat a large part of accessing positionals is the check for >= 0
if that does not have to be in HLL code (like it is now), that would be of real benefit for performance, I would think 10:27
that's my main interest in this
jnthnwrthngtn I don't think the "in HLL code" bit is really significant; if UInt is a type something is, then we get to elide the check entirely anywhere. If it's not, we have to do it somewhere. 10:33
lizmat so you're thinking some kind of dispatch ? 10:39
jnthnwrthngtn No, don't think that really comes into it. I mean, new-disp is also into types things are 10:42
(Rather than properties of values) 10:43
Also we're not really set up to deal with properties that are "learned" from conditionals, e.g. if we have a branch and there's a check against a variable there, we don't have the infrastructure to propagate that knowledge to each side of the branch 10:47
SSA doesn't do that
SSI does, by introducing another function on top of phi (called rho, who knows why) that versions variables at split points 10:49
I implemented SSI on a $dayjob program analysis project a couple of years back.
There are csots. 10:50
10:52 TheAthlete left
Nicholas What else uses rho to mean something. Chi is popular already. (No, I can't remember the order of the Greek alphabet. Or even everything in it. I had to look this up) 11:01
as in, chi is next after phi 11:02
m: my $name = "Φ"; say ++$name
camelia Χ
jnthnwrthngtn Just wait a few more months and there'll be a rho variant of COVID-19 :P 11:03
.oO(finally learning the greek alphabet one mutation at a time)
Queation is: why do we need something to retain its UIntness and are the alternatives for solving those issues? 11:16
There were none for uint vs int. We need to know at every layer what we're dealing with so we hllize correctly and so we knlw the alllwed ranges 11:17
I dont know if the same is true for UInt vs Int (I really dont, this is an olen question)
Geth MoarVM: MasterDuke17++ created pull request #1652:
Jit iscont_u, missed in the recent uint work
lizmat m: use nqp; my $l := nqp::list_u(1,2,3) # nine: is that an oversight ? 11:22
camelia ===SORRY!===
No registered operation handler for 'list_u'
nine If we need a list_u, then it needs implementing. There are a lot of TODOs like push_u 11:24
lizmat how is 'my uint @a' implemented then ? 11:25
or is this just a matter of "publishing" as nqp ops ?
nine Thats a native unsigned array. native_arrays.pm6 11:26
I think list_i and co are just bootstrappy ways to declare natively typed arrays. You can get the same through the 11:27
jnthnwrthngtn nine: Well, from the VM point of view, it's mostly a case of us being largely set up to specialize by type, and so if we want to know a boxed value is unsigned and take advantage of that in specializations then we'd need it to be conveyed by the type. 11:28
nine: However, the language design questions that arise from that are really tricky.
(Somewhat on their own, especially in the context of having had UInt has a subset type to date) 11:29
MasterDuke just updated github.com/MoarVM/MoarVM/pull/1650 to address Nicholas++'s comments and pull in his fixes 11:48
11:52 linkable6 left
MasterDuke wow, that reproducible build test just got very flappy in the past week or so 11:58
Geth MoarVM: 7044d53cc8 | (Daniel Green)++ | 2 files
Jit iscont_u, missed in the recent uint work
MoarVM: c66cee7ec1 | MasterDuke17++ (committed using GitHub Web editor) | 2 files
Merge pull request #1652 from MasterDuke17/jit_iscont_u
12:07 reportable6 left 12:08 reportable6 joined
MasterDuke nine: do you have any idea if nqp or rakudo is more likely to be at fault for the reproducible build problem? 12:14
12:25 frost joined 12:26 frost left 12:35 TheAthlete joined
MasterDuke i have logs from both the nqp and rakudo builds with the first line of a backtrace every time a hash is iterated 12:53
12:54 linkable6 joined
MasterDuke 452 lines in nqp, 684 lines in rakudo 12:54
but i don't know if there's an easy way to know which to investigate further 12:55
13:04 frost joined 13:44 frost left, linkable6 left 13:46 linkable6 joined 14:15 frost joined 15:15 linkable6 left 15:17 frost left
nine No idea, no 16:11
16:27 evalable6 left
MasterDuke anyone have an objection to github.com/MoarVM/MoarVM/pull/1651 ? 16:27
lizmat that's some interesting info here: lgtm.com/projects/g/MoarVM/MoarVM/?mode=list 16:28
MasterDuke yeah, but it's just the python code it found, it doesn't know how to build the project to analyze the C 16:29
(which is what the config file enables) 16:30
you can see it works here lgtm.com/logs/a66a536182bcc0450a3f...3/lang:cpp but it doesn't the nice alerts ui for the test results
for some reason i haven't been able to get it to build nqp with the jvm backend to analyze the java 16:31
17:18 linkable6 joined 17:48 dogbert11 left 18:06 reportable6 left 18:07 reportable6 joined 19:07 linkable6 left 19:30 evalable6 joined
Geth MoarVM: 9fb8ec9165 | (Daniel Green)++ | lgtm.yml
Add an lgtm config file

So lgtm.com/projects/g/MoarVM/MoarVM/ can build and provide alerts for the C source.
MoarVM: 817b735044 | MasterDuke17++ (committed using GitHub Web editor) | lgtm.yml
Merge pull request #1651 from MasterDuke17/add_lgtm_config_file
MasterDuke if anybody has an objection to ^^^ feel free to revert, but what i've seen of their analysis has been decent, so i'm curious what it finds in moarvm 19:55
lizmat m: my uint $a; sub foo { $a = 0 } 20:49
camelia ===SORRY!===
p6decontrv expects a QAST::WVal as its first child
lizmat shortest golf of issue Xliff found
m: my uint $a = -42; $a.say
camelia 18446744073709551574
lizmat m: my uint $a = -42; say $a 20:50
camelia -42
lizmat hmmm
20:50 TheAthlete left 20:59 Colt left
gfldex m: my uint $a = -42; $a.Str.put; put $a.Str; 21:12
camelia 18446744073709551574
MasterDuke `my uint $a; sub foo { $a = 0 }` doesn't give that error with `--optimize=off` 22:46
gist.github.com/MasterDuke17/0efb4...91033cf780 a diff of `--target=optimize` for `my uint $a;` and `my int $a` shows almost no difference. except in one spot a `QAST::Op(decont_i)` in the int version and a `QAST::Op(p6decontrv)` in the uint version 22:49
oh, may have figured it out 22:58
huh. `===SORRY!=== 23:01
No registered operation handler for 'decont_u'`
23:08 linkable6 joined
Geth MoarVM: MasterDuke17++ created pull request #1653:
Jit some more missing `*_u` versions of ops