Live CEOing Ep 758: Language Design Review of Root, FiniteFieldElement, and More

Stephen Wolfram leads a design review of Wolfram Language features with his team. They discuss how root objects should look on screen, including icon placement and click-to-copy behavior. The group also explores new language constructs called co-identity and co-composition and how they might work with pattern matching.
Chapters
Okay. Hello, everyone. Welcome to a Wolfram language design review. I think this is the tail end of some version 14 review of part of our language completeness and consistency series. All right, first up is a pet peeve of mine for a while, which I'm looking forward to seeing a great new version of. This is the formatting drum roll. I want to see this. Oh, Is this what we agreed? This, this superscript thing?
It's pretty close to what we agreed. You suggested that we stick it in actually in the circle, but I'm both worried about the scalability of that even more than I'm worried about the scalability of this. And, you know, at 100 magnification, it's pretty hard to read the four.
I see.
My only question is, would it not make more sense to have it be on the other side of the circle? Given that, then. Then it would look more like a fourth root type thing. Do we have design folk here? Do we have Jeremy here?
Yeah, I'm here, but I can't speak to, like, fourth root.
No, I understand. But look, let me show you what we're emulating. Okay, so if I do. Gosh, how do I get that in? I'd say X and I. I do the root. How do I get to the root position.
And then control five to get to the.
Okay, so that's the way that a fourth root is portrayed. Okay, yeah, right.
But it's the root. I mean, but it's not necessarily a fourth. Right. It's a root of a fourth order polynomial. I mean.
Yeah, right. I mean, it's slightly. But. But to me, this. Look, it's like it's to the power four. Whereas if it was. I mean, if somebody could just mock this of just trying to put. My idea was. Okay, my idea was to have the four. Look, see if I could do it. Okay. So this was my idea to take this, take that thing. I don't know whether I can do this, but let's just make a canvas. Am I going to be able to do this? May be beyond my abilities here, but I was thinking that we would put the four crossing the circle. Like.
Yeah, I. I just think that's crazy, both from an implementational point of view and from a readability point of view. I mean, right, you've blown that up to what, font size?
No. Okay, so, I mean, let me. Let me unblow it. I mean, and.
I mean, you're already at 125% magnification.
Okay, Jeremy. What? What?
No, I mean, that was the mock. Was an overlay, but I think I had it on the right. And you need to add a glow or something behind the. So it would work. Let me find it.
Right. And I mean, don't forget that, you know, this can easily be, you know, a hundred or a thousand. I mean.
How do I get. Is there a way we could have click to copy for this thing here?
Possibly. Although why would you want it? I mean, you can just select it and copy.
I don't know. And the font here is really ugly, but other than that, I, and, and we don't usually have. I mean, that's a code font. Why the heck do we have a, A comment and a code font? But I like this functionality in general.
Okay, well, because I was focused on content and not getting every single detail. Styling detail.
Right. Okay, but, but, but that's what we're here for. So let's, let's.
Well, you asked why and I was answering your question.
Yeah, okay, fine, fine. And so this thing. Go ahead, Jeremy.
Yeah, I mailed that mock if you want to take a look at it.
Okay.
Okay. So that's the previous one with the.
Overlay, but it would have to, I think, really think it should go on the left. Do we have other mathy people here?
I, I kind of agree. The left looks kind of more reasonable. I mean, this looks like, like I said to the power four.
Yeah. Jeremy, could we. Okay. It's high.
Right?
Right.
So let me, let me, let me, let me point out that, you know, 4. For transcendental equations, I put infinity, so certainly wouldn't make sense on the left. So we would either.
I don't see that that's bad on the left. I think it's fine on the left. I think it's rather the, the, the.
Infinity at the root that. That doesn't make any sense to me.
I think that nothing makes sense. But the infinity is a nice idea.
Well, it makes, to me. It makes sense on the right because we're talking about an infinite degree polynomial. Right, right. An analytic function is just an infinite degree polynomial.
I understand. That's why I think it makes sense in the left because it's a, it's a root of an infinite degree polynomial. So it's kind of like the infinite root because you're trying to get down to that value in a polynomial with X to the infinity plus whatever.
Okay.
I mean, but, but I have a different question, which is big numbers here. Do you have examples of that?
So I don't have very big numbers. I have.
Oh, there's 50 okay, there's 50.
Right. And you can see already at 50 it. Right. I mean, you couldn't fit that in the. In the circle.
No, I, I understand that. We need a solution here. I just don't think. I think my immediate response was it's to the Power 4 here, which just seems wrong. Okay, implementation. Let me just ask you this. If. If we were trying to do this overlay thing, is it. Is it easy to implement or is it like unbelievably hard to implement?
I think an overlay would be pretty difficult to implement, you know, unless we, you know, unless we did. Unless we did like 1 through 9 and then 10 plus.
And.
Right. It's.
John, can you comment? Is John here?
Yeah, yeah, I'm here.
So can you comment on how one would do this with an overlay box or whatever?
So you're. You want to overlay the number. Sorry, I'm confused. Are you talking centered now or left or right or what are you talking about?
Let's just say on the left, but mostly overlaid over the circle.
Yeah, well, I mean, essentially, yes, it can be done with overlay and spacer, quite reasonably spacer or invisible, either one. But I, I think Itai's concern is that getting it to look really, really good for an arbitrary digit length, he's concerned about.
Yeah, right.
So if. So. So, yeah, I guess if I, If I can leak into the left like that, then that's less of a concern.
I like this a lot. Meaning wise. Devendra, do you want to comment on that?
Yes, I totally agree. This looks more correct. And if you can't see it at large enough numbers, I think that's okay. I mean, people don't write root objects for 10th or 12th roots even, you know, so third, fourth is.
Two digits is enough. If we went beyond two digits, I'd be perfectly happy to just see a dot, dot there or something like that.
Yes. And I think, because that's the kind of people whom we are trying to cater to with this type setting. So I think that's fine. But I really like. Yeah, I think I like it as design overall. But this one aspect, I think change to the left looks, it also gets out of the way of the numbers, you know, basically the actual decimal approximation over there.
So one thing to say just about the tweaks around this specific. Or, you know, exactly what we're looking at is the. So for the. I mean, in this case, it's really covering up the circle. The best that the front end can do. Well, you know, without going Deep into hackery is going to be essentially the black box rectangle around those digits. So this looks actually like it's even a bit tighter than that. And I'm not sure it would be quite that tight, if you understand what I'm meaning.
And is it obvious that we don't want to just make this a piece of graphics?
Well, I, I mean, like make, create like two through nine or whatever.
And, or no, I was, I was thinking that we render it as graphics, maybe. That's stupid, right?
Well, I mean, that is a graphics. Right. The, the. The circle is a graphics. And. And I could either attempt to put, you know, the four on top of it or integrate it as a, you know, text directive inside of.
I think it should be a text directive inside the graphics to me.
Okay.
I think that's a much more likely, you know, so long as there's no rendering time.
Well, and so it would be a directive that has a. It either has a background or there would be an additional rectangle to make it.
To make it obscure the circle.
Yes. The additional rectangle is problematic because you need to measure exactly the size of the. Of the fonts.
John, wouldn't a GLOW or something like that work? Yeah, I don't think you need to.
One of our modern background.
Well, I mean, the problem is that GLOW is in order to do it enough to get the entire inside of the zero. It might go farther than you want outside of the zero, if you know what I mean.
And doesn't it like use the GPU and crazy stuff like that?
What is. I'm sorry, I guess I'm behind at times. Can somebody explain to me what GLOW.
Is like drop shadowing in that family? It's. It's a pixel shading effect.
I see.
Yes.
You're behind the times. Wait a minute. Why is this not.
Yeah.
Do I have to put it in the graphics?
And, and it's. And it's not. It's not glow. It's. It's. It's Halo.
Hello? Where is it? Do I say in text primitive there? Yes.
Yeah, yeah.
Come on.
You said a background. The. That's not the way you use drop shadowing. Just open the documentation.
Oh, it's a directive inside.
It's like red.
It's.
Yeah.
Why does this open in. In the web documentation?
Because you probably don't have the 14.1 documentation installed yet.
Right?
It's a prototype.
You only got the 14.1 builds installed this morning, so I'm not surprised you don't have the document. I'll Mention that to Roger.
Okay. Why doesn't anything go yellow here? Sorry, I'm just worrying about this. So that's yellow.
In that case, it's because of the mismatched brackets.
This is.
But why is this not yellow?
Because you have unbalanced brackets, and this is a feature in the prototype builder.
I know what this is. I'm just. I'm confused by why. I mean, this may explain what some things that I've been utterly confused by in. In the way that this whole. So, I mean, this is still yellow.
Yes, because you have balanced brackets. And you have balanced brackets. Now, if you delete one of those brackets, things will start turning. Not yell.
I see. But I get back to yellow. This is nice. Now I understand this better, John.
Okay.
This is really not bad. And I like the effect of having I see the pink goes with the pink of this.
Yep.
Yeah. Yes, exactly.
This is quite nice.
Wow.
Good idea. Okay. Any case, that wasn't what we were looking for here, but. But what we're looking for here is. Is. Okay, it was very small there, but. But you get the message, Right? It's just a. It's just a different form of shadowing, haloing, whatever else. Oh, and I like the fact that when it goes red, to what extent is this consistent? When it goes red from a syntax error, is that consistent with the pinking? Okay, so that's pink.
Yeah.
And now let me try and evaluate it. And what was. Now. Now it's. It's repinked. I mean, that. That pink is the same pink that I had before, or that's now a different pink.
You know, it probably isn't exactly. That's more of a red.
Yeah, that's.
But this. This behavior is. Is not new.
I know that, but I'm saying it could be consistent with the. The thing. Okay, so that's. Now, I don't understand. Okay, so that's pink. And then when it's errored out. Go ahead.
Yeah.
It seems right, that it's not quite aired out yet.
Right?
You're still editing. You can fix it. It's not quite set in stone that it's a problem.
I agree. I think it's pretty good.
Yeah. Well, I mean, any way you slice it, this isn't going into 14. There's more subtlety than what we've covered here, and I want to make sure that we've plumbed the depths of it.
I'm sad because I think it's really nice. Okay. In any case, we'll get some version of this. I Think beyond two digits. I mean, do we try and go to three digits? Maybe, and then, I mean algorithmically beyond two digits. Are we still swimming or is this thing like grinding to a halt when it gets me up beyond about two digits in the exponents?
What do you mean by this thing?
I mean root objects. If I had a root object with.
Do you mean grinding on the rendering of it? No, no, no.
I mean in the algorithmic side of it.
Okay.
You can go up to millions. I mean, we have examples with root. With degree, million root objects.
Okay, well, then I think we need something.
How. What.
What would be our overflow thing? I mean, I think the infinity for the transcendental is kind of cool. But what is our large but finite. Is it dot, dot, Is it a single digit? Dot, dot? Is it N?
Yeah, I was thinking I. It would just be like, what. Whatever our cut off is. If our cutoff is 99, then we'll then have a greater than 99 as the arbitrary.
What about. Okay, question. This is a math question. I mean, what's more important, the first digit or the last digit in the exponent?
The first. I mean, starting from the left. You mean, like. Yeah, because, I mean, you want to.
Get a sense of. No, I think what's actually important, the two things that are important are either the number of digits or the last digit because, you know, it certainly matters if it's an even or odd. Yeah. You know, just knowing that the first digit is three, but not knowing if that's, you know, 30 or 30,000 is.
Fine. I think. Audience.
I wonder if we could have something like 14 or whether that would be even more confusing. Or we could have like, dot dot five.
Right?
Yeah, we could have dot dot five or. Yeah, I don't know that we want to go that big. We could do sort of a short style, you know, first digit, number of missing digits.
Yeah, that's too complicated. I don't think we need that. Okay. Yeah, I think we should go. Okay. Okay, so let's. All right, so I think we've agreed what that's going to look like. Now. Let's talk about this. Do we need the circle? Yes.
Okay.
Yeah, I thought of that too.
Yes, we need it. It's a branding thing because it isn't exactly a root and it's not, you know, you're not taking the root of this thing. It's just a. It's just an iconic element.
Yes.
Okay. Okay, so let's talk about this. This is fine. But. Okay, so first it says root Here.
Right. I don't understand.
Yeah, go ahead.
The reason for that is that there are, well, there are at least two different heads that will use that icon. And we're going to be using a similar sort of styling, although with a different icon for finite field. So my thought was that we would have a heading with the, with the head, just much like we do in information and whatnot, and then, you know, details. So, for example, if you looked at one of the system of equation things, that. Then. You'll see that my sentence does not start with capital root.
Yeah, okay, but I understand that I, I'm. I guess I'm asking. I was sort of thinking this would be a raft of some kind that just says. I mean, I, I just don't understand why this wouldn't be. Click to copy here. Because that's the main event of. I want the, the, the, you know, polynomial out of this thing. Minimal polynomial. I mean, what else could I want from it? From this root object, the degree, the minimal polynomial. Those are the things, right?
For. If it's a polynomial, then those are probably the things you want. Yes.
If it's a transcendental expression, what do I want then?
Then you might want the multiplicity. If it's a root cluster, you might want to have the, the computed approximate location.
But presumably I can get that from n.
Well, you can get, you can get the equation using first, right?
Yeah, but I don't want to do that.
Your whole objection was that you didn't want to do this programmatically.
Well, I want to know how to do it programmatically. I didn't know how to do it programmatically. I had no idea that I could just use first on this. Most, you know, raw objects don't let you just use first.
It's not a raw object.
Well, I didn't know that. Looks like a raw object, walks and talks like one, but it isn't a raw object. Okay, so it's all right. Normally with summary boxes, don't we have kind of like a more tabular thing like equation colon?
So that's the alternate styling that's a few rows above that I only did for the polynomial. Polynomial case, which is, you know, I didn't think it would necessarily scale as well, but if you think this is a better look, I can, I can go in this direction.
What other things other than univariate polynomial?
There's univariate polynomial, there's transcendental equation. There's transcendental. Well, it's the five things that are listed there Right. Transcendental equation. Transcendental root cluster.
Sorry, where is.
Okay, I see Triangular polynomial system and system of transcendental equations.
What the hell are these here?
Those are the two polynomials that make up the. The. The triangular system.
And why isn't that just in a list?
Because I thought, well, if they're large, I think the scale is better only.
If you can click to copy them. I mean, I don't want to have to go and click and this and then that and assemble that and so on. Okay. I strongly prefer this, but the fonts are wrong. Okay. I mean, Jeremy, we've done so many of these things like this before. I mean, we tend to use the Sans text font. Right, for these kinds of things. Am I right?
It's on mute. But, yeah, I used it in that first case. We looked at it under alternate styling. I mean, so we just apply that visual style. I think that looks like source with a.
But, but, but, but, but. This is. We normally use some kind of Helvetica, like, you know, compact font. Not this kind of code font. We don't want a code font. We certainly don't want a code font for a piece of text Here. We can have a code font for this. But I mean. Okay, this is not hard, guys. It's really not hard.
And summary boxes. I think we always use code font.
Not for labels, though. Should be Source Sans Pro vs labels.
It's possible. It's been a while since I've dug into those.
Just text font.
Yeah.
And I'm not sure why we're not just going vertical for everything here.
Going vertical for everything.
I. I don't know why we have this vertical path. I think that's a mistake. I. I think it's just going to be confusing, you know, given that I. I just.
I just thought it would. Would be, you know, wasteful, especially if. If you think the main event is the polynomial.
Well, okay, fair enough. I mean. All right, okay, I agree. This is reasonable. This is reasonable. It's just that this is such an ugly font, it put me off.
Okay.
This looks okay to me. Okay, but, but, I mean, in, in the case of something. But everything should be labeled, and I think it should have collective copy. Okay. No real reason. It doesn't. Well, I mean, and if the polynomial.
Is huge, you don't want to manually.
Try to select it to copy anyway. Yeah, yeah.
Actually, actually, that reminds me of something that crossed my mind earlier. Is there ever a case where the polynomial is so huge we may not want to show it in its entirety?
I think. Yes, that's right.
There probably is. I don't know what that case is. Well, you can click on my°50 polynomial there. Right. I mean, that's.
Yeah, that's not highly useful.
Yeah. So there might be some kind of size limiter, iconized type thing that once again, would have a click to copy around it.
Right. Where the click to copy is really the main event. Okay. Finite fields.
Right.
So this is taking the. Basically the existing object, but applying this styling to it, which is what we.
Right.
And if we want to switch to the. Some more summary boxy style, you know, that's easy enough to. To do.
Yeah. I think this is basically good. And I think this is much more compact. I don't remember what we had before, but this is much more compact than that. Yeah.
Well, if you copy that into another notebook, it'll go to the current styling and.
Oh, yeah, this is unbelievably much better. The new. However, I'm wondering if there's any way we can sort of separate off. You know, I wonder whether we could have a vertical separator inside the lozenge box here between the F3 and the two, which we effectively have in this case by having the circle around the thing. But I'm just suggesting a. You know what I'm saying? A vertical.
Yeah, just. Just a pipe like I was using above.
Yeah. Except that I think it should span the. The from floor to ceiling.
Okay. Depending on how that's. Well, I might need to change my implementation in order to do that, but. Well, so. Okay, so if you literally want it from floor to ceiling. I don't know how to do that because if I were with a grid box in there inside the.
How can we do this?
Yeah, sorry, my. My attention wandered a bit. What. What do you mean by floor to ceiling?
From the. From the lower to the upper.
You want what from floor to ceiling?
I want a separator line that's blue.
Ah.
Ah. Okay. Okay. Yeah. So. Itai, you should talk to Lou. This is not easy. He's done things that are a bit like it and it's. He can tell you the hacks to make this work.
Right. I mean. Right. The point is that, you know, it's a. Right, there's a frame box there with a rounded corner. So if we. Even if we were to stick to a grid, then it won't get all the way to the top.
Jeremy, does it need to get all the way to the top and bottom.
Or if it's the full height of the.
Yeah, I Think if it's very close, it's fine. I don't think it's, it's not going to kill us to miss a pixel or two there.
Well, and I think it might be possible to glue two frame boxes together and you can individually control the rounding on frame box corners.
Okay.
Okay.
Now you know that may, if selectability is an issue, that's going to mess up selectability. But of the contents. But there are options. We can figure it out.
All right, ready to, ready to go on to the next item? Yep. Okay.
So basically I did what was easy to do in terms of the width coloring. There. There is a hard thing. You know, this is like, you know, a half a day's work and I knocked out 90% of it. But the remaining 10% is, you know, a multi day project, which is that it. Just to be clear that in that first example, the A on the right hand side should have been great green because it's being scoped by. Because the, the A and the second.
Argument, two nested widths. Right. If, if you copy that first input and in the second argument add a width bracket.
Yeah. So that is the correct coloring. But getting, you know, the front end's syntax highlighting system is fragile and getting this sort of thing to work requires real effort. But, but what we're proposing is that we've got this much working and that while it's, you know, in some fundamental sense it's not correct, it might be good enough to finally document for 4.1.
4.1 or even 14.0.
I'm not going for it. I don't like this very much. I really think we should try and get this right. I think this is very confusing. When I write code and I have blue variables in there, it bothers me a lot. This is one of my few places where I can kind of make sure things are scoped correctly. I really don't think it should get blown up like this. I mean, I'm sorry. I wish it was.
Well, I mean, you don't have to apologize, except that you left a very distinct impression that compromises were acceptable. When we last talked about this, I.
Did not internalize just what level of compromise this was. I mean, in other words, I really don't think this is a good idea to leave something blue here. I mean, even if you could turn it black, I'd be happy. But I doubt you can do that.
By the time I could do that, I could turn it any color I want. Yeah.
Look, I think we should plan on this for 14.1 and we should try and get it right. I just don't think we should let people have something where, you know, we've gone to so much trouble. And by the way, I mean, this case here, I would like to see some of those things. Red, I mean, that's clearly.
But it's not red. I mean, why would it be red?
Because it's wrong. Because.
Why is it wrong?
Because you can't have a width with just an X there.
Well, sure, but we don't have that level of coloring.
Yes, we do. We have plenty of coloring like that.
No, we don't. Give me one example.
Doesn't plot color like that. Doesn't. Well, we should have that coloring. I mean, this is not probably for this meeting, it's probably for the user assistance discussion. But it will be great if that colored red. That would catch errors I've made.
Right. And we do have some coloring about single equals versus double equals.
Yes, but I'm just saying.
But, but, but it's a, you know, I have filed bug reports about how incredibly fragile and buggy to the point.
Okay, fine, but it's better than nothing. And the fact is that the error that is, you know, the current with error of saying with, you know, X equals one, you know, X, Y. That should turn red. And it does in the previous version. And you know, because that should be X semicolon Y. And I mean, I think we're losing something by not having that turn red. And it should turn red. I mean, this case. Look, okay, I'm sorry, I'm sorry.
Well, this, this says this is not turning red because we've.
Right, I know, but I'm saying we know that the syntax for with is brace symbol equals blah blah. It has to be that if it isn't that it should turn red.
Well, and so I'll just take that as a given here. But you know, as a more general note, I mean, this is the sort of thing where, you know, I'm pretty good with our language, but I don't spend all of my time language lawyering all the details. And there's, you know, there are cases where it's not clear clear to me where, you know, I mean, like, for example, the second argument of plot is typically a list, but you can't pass something else. But you can find ways to write legitimate plot statements that work without that. And I, you know, I'll just take what you're saying as a given for width, but for anything else, I mean, there's a certain level of language lawyering that I would need some assistance with.
Okay, this is.
And, and I just put something in the chat.
Yeah.
Oh, yeah, sorry about that. Ins and outs. But yep. So my, my point is it's pro. It's possible to programmatically create a correct with.
Yep, yep.
I mean, this is where user assistance should be going is, is being able to tell whether you're doing this or whether you're doing this. I mean, yeah, you can programmatically feed things in and you know, I mean, that's the question.
Right, so. So you can't unconditionally color that.
I know, but. But the fact is it's 99% of the time it's a mistake. And that's what we're doing. That's the whole point of syntax coloring. You know, do we think that this is. I mean, I think it's worth. I don't know. I don't know. And you know, if we had a mechanism to switch off the syntax coloring, in other words, if it came up red and we had a raft essentially, which said, like spell correction, turn off the syntax coloring.
We do have, you know, various syntax colorings are exposed in the preferences dialogue.
When there are way too global.
But in some cases, people have wanted global. I mean, people have wanted, for example, to say no every time I put a single equal in the first argument of if I don't ever want to hear about that again.
I know, I know, I know, because that's my stuff. But I think it's much more common that people are going to want to do this. And that will be a really nice feature. I mean, in other words, we would be able to do a lot more reddening if we had a mechanism like spell correction to kind of ignore that reddening. See what I'm saying?
So, I mean, there's a philosophical issue around this, which is, I mean, fundamentally there are two ways to be looking at code. One is code as boxes and the other is code as symbolic expressions. And the reason why it's difficult to make changes in the front end syntax highlighting is because the front end syntax highlighting can only look at boxes.
Yep.
And so, and in part, there are.
Times that's the only possible thing because you're in the middle of typing things. So there is no.
Right, exactly.
Whereas, for example, the, the, the static analysis story is looking at symbolic expressions.
I'm. Well, I'm aware.
And so, yeah, I mean, we have to think about how much work we're willing to invest in looking at things at boxes where, you know, getting Something to work is just like 10 times as much effort.
I know.
And I'm not saying that to specifically disagree with a specific proposal you were making. I'm just saying there is a general.
I would like to make the following comment. If it came through asynchronously like spell checking does, and reddened this on an asynchronous pass, I'd be perfectly happy.
Right.
Once the expression is complete, do an asynchronous pass, or once this section of the expression is complete. In other words, you clearly know you're admitting you know because you're yellow or you're pink. Right. So in, in the case where it is yellow, then do an asynchronous, you know, pass. Is that crazy?
Well, I mean, that's where we talked about taking the static analysis story. But. But static analysis is presently. Is presently underpowered in. In development resources, so.
Right.
Which we need to talk about separately. But that's a different issue. But I think that's what I would do. I mean, if it's. If it. If it is so much harder, I think it is more. Okay, two points. First of all, the ability to switch off a reddening. And second of all, the. I think that really opens up a lot of opportunities. And second of all, the asynchronous pass. Sandra on our live stream is asking about an obvious question in a nested with. With the same variable. I think that's okay. I don't see a problem with that.
Right.
That's no different from if you did two or would that. Would that not work?
I actually, actually don't know what would happen if you did it with the proper nested widths.
Now let's find out.
Yeah, that could probably break. You did it with nested widths.
It does not break the front.
So the internal renaming mechanism recognizes them as local variables. And. Yeah, so then I think the behavior is fine. Right. Because those are at the same level of scoping. So I think this behavior is entirely sensible.
Okay, but.
But that raises actually another subtlety in terms of the ideal with syntax highlighting. The ideal with syntax highlighting would, in. In the case that Sander raises, would color the second a red as an advisory that, that you're doing something maybe you didn't intend.
Which I think.
Exactly. As with the nested case that's unseen.
I don't think that's bad.
Yeah, I think, I think you are doing something wrong if you duplicate the variables. Even if it works. And I'm surprised that it works. I'm surprised it didn't become with three equals four.
And there are lots of these scope conflict cases where a thing works. But the purpose of the syntax highlighting is you may not realize what you just did.
And I would compare it to the case where, where I say with a equals a because A is a module variable. And. But, but now I need to inject it into a held expression. And so I. And so I like saying with a equals a because it's. Because I'm making it clear that I'm injecting it. But it. The A in the. The width variable turns red because it duplicates a module variable.
Right, right. Okay, let's, let's keep going here.
Okay, well, so, I mean, that's one thing that tells me is. Yeah, so I guess I'll just keep this out as an unmerged branch then. Until, until more work goes into it.
I think we need to. And I think we need to do more work though. But I really do think these two.
People can continue to blame me for not having varag with so sadly, there you go.
I think the work is important and I think that this, you know, the things we just described are, you know, worthwhile directions. All right, let's quickly try and talk about co identity says.
Right, so this was a suggestion from Nick, which you can see there. It's the thing which when eaten by anything gives the head. So Ian sort of mentioned that he. Right, so just like identity and composition commute with F goes to map of F then co identity and this co composition operation, he commute with the mapping between, you know, x and co mapping stuff onto X.
Okay, so let's just remind ourselves. So comap of F X like this goes to this.
Yep.
Okay, so what is co composition?
So co composition is the thing that if you. Well, it's defined right there.
Yeah, I can see it. I mean, to me this is part of the family of issues of sort of head related patterning or nested, you know, because we, we don't have just like we have double blank to represent an arbitrary sequence of arguments. We don't really have anything to represent F of F of F of F of F any number of nested times. Which seems like it's related to this. Or am I wrong? I mean, this would give us that. I mean, in other words, this isn't quite that. What is? If I were to say, let me just go ahead and do this. Well, actually I'm not even sure I can do this, but I mean, if I were to say F blank of co composition of X double blank what the heck would that do? Or is that irrelevant? What would that be defined as? I mean, that's. Isn't that an arbitrary.
It would be something like, you know, F at. At reverse of list. Well, no, not even that.
No, it isn't that. It's like a. It's like a fold, isn't it?
Right. Yeah.
Like a north. Right. It would evaluate immediately. But if you hold this pattern, then it's just gonna be. Well, whatever it is, co composition doesn't do anything useful here.
Okay, but I mean, what I'm looking for is something that has a pattern that matches F of X of F, you know? Okay, so let's say I wanted to match F of X, X, X, X, X. How would I match that? What is that pattern? Or that's one pattern. Or F of F of F of F of F of F, whatever it is of X.
Right. And, you know, I don't think co composition or chiral identity have much to say about this.
I had something like this implemented in the patterns I think I called the deep pattern or something like this. So that you can. It's more related to the repeated, but you go in depth rather than in width of your expression.
Yes. I mean, it's like kind of like head repeated. Does that make any sense?
Well, it doesn't have to be a head, I think just any expression.
Well, but then you kind of construct, I mean.
Right. I mean, head repeated would match one of those, but not the other. Right. In one you have a repeated head, and the other you have a compound head of, you know, repeated sub valueness or something.
But we don't have a patent for this. We don't have a patent for either of these things.
No.
Okay, but you say that's irrelevant to co identity.
Correct. Because co identity, you know, just like map, you know, just like default map lives at Level 1 and CO and comap by default lives at lives at level one. So does co identity and identity.
Okay, so if I say map identity onto X and Y, I get X and Y. And are you saying that if I comap co identity.
Second argument. So you'd have like list fg?
Yep.
Oh, my gosh.
Right. And I'm. You know, I don't think that either Ian or I are clamoring for this, but, you know, it is something that exists given. That can exist given.
Okay, so that's the minimal case. Right. Which is maybe what you were giving there.
Yep.
Anybody who thought they were dealing with traditional math functions, which they better not have, because transformation rules for symbolic Expressions aren't really that, that will be deeply blown up and. Okay, anybody know, in, in the category theory world, is this the thing? If F is a morphism, this is kind of objectifying the morphism somehow, if that makes sense. Turning the morphism into an object.
Right. Well, it's, it's, Right, it's looking at the, you know, it's looking at the functionals, you know, element goes to F applied to element. And this is sort of the identity functional for that.
Right.
This is an argument based head extractor.
Yes.
A very weird object.
So what would be F ofCO identity comma 1? Exactly what you wrote.
Yeah, yeah.
Yeah.
So I'll point out this is possible because you can have more than one argument, but you can't have more than one head.
Indeed.
Because our expressions are trees, not dags.
Yep. Right.
And that returns unevaluated, just like F of identity would return unevaluated.
Right. That, that's the same. That's the CO of this.
Yep.
And likely the, Is there a way, Because identity of identity. Gives you, you know what I'm saying? Identity of identity gives you identity. What's the co version of that?
So what you're doing there is, you're saying composition of identity comma identity, Right?
Yep.
If you did co composition of co identity and co identity, that's the CO of that.
All right. What's the use case for this creature?
Right, so Nick came up with that one use case, which is the final bullet point. I don't know if that's really that compelling.
Yeah, it's not very common, but the idea is just every time you have this kind of active property just returns the same kind of object. It may be useful. It's like whether you have to mutate it or you don't, if you have some condition. So usually in the usual case with identity, I often write like if some condition satisfies, I do something and if I, I just apply identity.
Yeah, I agree, I agree. Yeah.
So that's a common case for co identity. I'm unaware of a use case for co composition which is like feed in arguments one at a time.
Right.
But co identity, what's really weird is this is returning ahead. It's one thing to return the argument, you know, nothing happened, it's just identity, it just passes through. But to return ahead, that's really weird.
Agreed.
I, I, I think this is for wfr for right now. I think it's worth us, you know, when we really are feeling very sort of, you know, theoretically inclined. I think we should tackle. I think we should consider both this. These cases here and multi level up values and whether there's a way to represent those. And these are somewhat related, I claim, because by the time you have these stacks, head stacks, you know, if you could paternify a head stack, you are effectively patronizing, you know, something which would. Because an up value you could think of as blank. A blank. A blank blank. A blank of F of. Let's see, what am I thinking of? Yeah, I mean, you can think about it as some kind of pattern for the head stack, can you not? All right, I think I should run off here, but I think. I think this is not a thing for right now. Although we should wfr both co identity and co composition because they are interesting language constructs and it's a great exercise for thinking about this, but not for right now.
Okay, before you finish, I have. I have one other micro point about the. With highlighting.
Yep.
I. I was just writing this up from my notes and I realized that if you want red highlighting, you don't want to. And I just want to make sure that we're on the same page here. I don't think you ever want to highlight the final argument. What you want to highlight is things that aren't the final argument, that aren't list assignments.
Yep, I agree.
And so in your, like with A, B, C, D, you would highlight a B and C as red. The D would not be.
That's what I think. Yeah, that's exactly what I think. Okay, sounds good. All right, see you guys soon. Bye.
Bye.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






