Live CEOing Ep 665: Language Design in Wolfram Language [SplitBy, VertexSizes, and More]

Stephen Wolfram reviews Wolfram Language design decisions: deprecating a mistaken operator form for SplitBy, adding graphics primitives for packed multi-points with per-element sizes and colors, designing a Create Notebook Overlay UI element with modal options, and naming raster resampling as raster interpolation.
Chapters
Okay. Hello, everyone. We're here for Wolfram Language Design Review, part of our Language Completeness and Consistency series. And we've got a few topics here. All right. Split by and gather by.
Right. So we talked about these last time and about adding an operator form. And then we noticed, then I pointed out that they have a document. Why don't you just click on the links that will take you straight to the relevant note.
Okay. All right. I was. I was nervous that it would go okay, brilliant. Well, that's pretty stupid. That's just stupid.
I. I don't think it's completely stupid. Right. I mean, if you have. Right. If you have a function that calls split by and you add an optional argument for a sorting function, then you don't need to special case the. You know, when it's not provided.
Right.
You can just.
Oh, but then why don't you use split in that case?
Because you're calling split by and you don't want to special case. Right. Instead of add, you know, adding special case for the case where no function is provided.
You mean you. You're up in the higher in the pipeline. You have a function which is going to have a, you know, deficient argument that you then want to assume as identity. This is a horrible case. This is, that we made a mistake here.
Yeah.
That doesn't seem like a realistic thing that would happen.
I. I understand special casing is an issue sometimes it doesn't seem like it would be here. Meaning I think we made a mistake, too.
Okay.
So I think we should back out this mistake. I think the thing we should do first is. I agree we can't do this immediately, but let's. At least for a version, let's try and, you know, kill that note and generate a warning message on a one argument. On the one argument form.
Okay.
And then in a couple of versions, we can. We can. If we didn't hear any. If no pitchforks arrived, we can back out the mistake. I doubt anybody's used this. But we don't know for sure. Okay, let's just think about it for a second. What would be the. I mean, it would. It would do something heinously wrong if they had used it.
If they had used it and we changed it.
Right?
Yes.
Okay, so let's deprecate and generate a message. Drat. Shouldn't make those kinds of mistakes. Be interesting to go back to the notes and figure out why we made that mistake. Just out of curiosity, somebody could just do it. Look at the source control system and just look what what, what caused that to be? I mean, I just like to know because I think it's an obvious mistake.
Well, I mean, this is from version seven. You didn't even have operator forms then, so I don't know that it was an obvious mistake.
I see. Do we not have any operator forms in version 7?
No, I don't think so.
When did sort by get one?
Oh, much later.
Much later.
Okay.
Yeah. Well, okay, so we didn't future proof ourselves properly. The.
I mean that aspect of working on split by and gather by.
I don't remember, I guess why we.
Made that decision at all.
Well, we should go look at the source code just, just for out of curiosity, see if there's any information. What's that?
Do people know off the top of their head what an empty list does? Right, so we do provide the possibility of. No, no, no, no. In the second argument. Right. You can give a list of arguments of functions in the second argument.
I would hope it would do. No splitting.
Yeah, that's what I would.
Okay.
Okay. All right, onward to the next point.
Okay, so open the documentation for points I have.
Okay. I mean, I also have some inline examples there.
What's, well, no, I, I, I'm, well, I'm starting off. You don't have to open the authoring page, just the documentation.
Okay. Nobody liked my pun about what's the point here? Never mind. Okay.
And details and options. So this is, there's a bit of a camel's nose issue here. Notice that point takes two options, vertex colors and vertex normals. And this made a lot of sense because vertex colors and vertex normal, even though points don't have vertices, but you know, you can have multi point objects. And being able to specify colors using basically the same syntax that you would for polygon made a lot of sense.
Which is what I'm illustrating with my, my example on the left.
Yeah.
But then it segues into this thing that makes, that does something completely different for polygons.
Well, it's not completely different. Right. The point is that pure color, it just sort of bleeds in.
Okay.
Yeah.
So.
In the context of the ASTRO developments that we're doing now, we're being asked to support multi points where you can specify sizes. This has no analog in line or polygon. And if one were to look at the options of points, one would say, well, maybe vertex sizes is the right thing. Although, you know, now the camel's nose is all the way into, you know, the camel is in the tent with the hump. You know, it's Reminding us that these, these were never vertices to begin with. And you know, maybe it still makes sense, I don't know. But then, and then in addition to the naming issue, there's also just a little bit of, you know, discussion about how this should actually work. So I haven't written anything up. You know, I thought, you know, given.
The issue is that the astronaut project wants to use multi points.
Yes.
Rather than individual points.
Correct.
Right. Because then you're unpacking it. Right. So you have a thousand stars and instead of one array you have a thousand points.
Okay, so this is an implementation issue. At that level.
At that level, yes.
And I mean, don't we have all sorts of packing stuff that is, I mean, like for graph and for other things. I mean, I don't quite understand because if you took it apart, okay, you're going to want to operate on that. Okay, is a point structure the end of the road or are you going to want to take it and operate on it?
Well, I, I'm waiting in the context of Astro or.
But I think that.
Right.
The point structure is, is sor of the end of the road. Right. Just, just like the way we write we in geoposition, right. We, you know, we pack in as many points into a single position as we can. Because otherwise. Right. The performance is just both time and memory is just not tenable.
Well, I mean, look, the fact that that's an issue. It's, it's at some level it's like column oriented versus row oriented storage of things. It's, you know, with the data container framework we will.
No, no, no, because.
Right.
It's the difference between having one array and having a gazillion arrays each with a, with a non array head, which.
Is I, and I understand that idea, but I thought the data container was going to be capable of having just like it can have quantities of having non array heads in its effectively columns.
Well, even supposing that were possible, which I, I'm not ready to concede.
That.
Doesn'T change the fact that not all of these points are the same size. And right now in graphics, the only way you have to change that size is to have two separate points and have a point size or absolute point size in between them.
Right, well.
Or a style wrapper.
Or a style wrapper. So. Right. So I, I don't see how the, the, the future array helps us in, in any way.
I mean, I mean one could imagine, you know, a, an array where the things in the first column of the array are head point size. And the things in the second column of the array are head point. I suppose.
Yeah, I think that's. Yeah. I mean, that's. That's not really buying us something because that's a weird special structure again.
And, and. And not only that, but, you know, the thing of head point size is going to be of dimension one, and the thing of. Of head point is going to be of dimension 1, comma 2, 1 comma 3, or 1 comma 2, depending on your.
Let's make a couple of comments here. So in graph, we have vertex style and vertex colors and vertex size, Right? Graph has that.
Yes.
Maybe we should use that for this.
Okay. I don't know anything about vertex size. Let me look that up.
Go ahead. Say random graph.
The syntax conflicts with what you want here.
Why? Oh, I see. Because it doesn't have a list of sizes, right?
Well, it doesn't put a list. It means something else.
Yeah, it's X and Y.
Wait a minute. Vertex size?
Really?
What?
No, no, it's a. It's a list of rules of like vertex, blah, goes to size, block.
Or.
That's a possible. Possible. Right. So you can give sort of a uniform size, but I think if you give a. If you want to specify. It's a list of rules, which is.
Yeah, no, I understand. It's like one arrow, you know, whoops. One arrow, one, four arrow one. Otherwise they're defaults. Yeah, so it's a different setup. It's a sparse array. Closer to a sparse array.
Yep.
And my point was you can also have a list on the right hand side of the rule.
That means X and Y.
There's also scaled and nearest.
Yeah.
What's nearest?
You do list the string nearest in the first element.
Which means what?
You.
You specify a size relative to the distance to the nearest vertex.
Gosh, I should use that more. Anyway, okay, so this is a good reason to not have vertex sizes. It's just going to be super confusing. Okay, right.
And the sort of. The other obvious name is point sizes, but given what point size. Point size mean. That's right. So what do we call this thing?
Okay, so my feeling is, Okay, I'm going to make a claim. My claim is that if we're really going to do this, that it should be something that is more like point and then a list of the coordinates, you know, And then.
An optional second argument. Is that where you're headed?
Yeah, that's kind of where I was heading. But let me just see something here. I mean, I don't like it very Much. But I mean, I could imagine an optional second argument that's an association of, you know, of lists where each one gives the, know, the point size, the point color, whatever, type thing. How does that mechanism relate to things that are used for meshes and so on?
I. Charles.
Charles can.
You don't think I can answer that?
Charles is supposed to be here, but was he Avery? We. Did we make them on call for some reason or is he just like.
Yeah, let me message Charles because I.
Think he's the only person who could really answer that question.
I mean, there are situations in which we sort of. Okay, will the user ever see this, whatever it is that we produce for this?
Well, I mean, it would be preserved in the input form.
Sure. But I mean, if I look at a graph, for example, in input form. Right. I mean, that graph, I guarantee is quite, you know, nothing.
Nothing like what you typed in.
Right? Yeah.
I mean, that's pretty unsavory.
Right?
I mean, I, I could imagine users who wanted to use this.
Use what?
I. I think George Herbert Walker Bush would want to use this. What for his thousand points of light.
Oh.
But no, I mean, I. Right. I mean, I. Well, certainly.
Actually, Sander makes a very interesting point on a live stream here. He says one of the second argument, like disk and circle for point, which raises the interesting question, why are they points, not disks?
Actually, Astrographics is currently using disks.
So why do you want to use points? I mean, disks already have this idea. Oh, do disks have the idea? Can you have a multi disk?
But then we have the problem with the colors. We have to insert colors in front of them one by one. So the idea is to handle quickly sizes and colors.
Well, but that's because you have this hack in points of using vertex colors for colors. I mean, if you had the same hack in disk, you could do colors the same way in disk, except.
Well, disk isn't a multi disk.
Right.
Could it be.
The ambiguous cases?
Yeah, yeah, that's. That's the problem is the ambiguities.
Why? I mean, you know what it is? Because you look at the first argument and therefore you know what you're looking for in the second argument.
Do you not necessarily have two disks?
No.
And the second argument is a list is a pair. Is that X, Y, or is that.
You know, primarily for what you are generating, not what a user is typing in? We can deal with putting more wrapping to disambiguate. Well, okay, so the issue is that what we really want to do, I mean, at some level, what we need is a multi version of the general primitives. I mean, so right now we would say, you know, style, blah, blah, blah, comma, point size, whatever it is. Okay. Okay, I've got a crazy idea for you. What if there was a style function inside style? So you go here, you have the primitives and what if you had something here? Okay, the idea is roughly this.
It wouldn't be RGB color.
What would it be?
It would be. Oh, well that's, that's actually the weird thing is that we've never, we've never said exactly what these options are. We never documented exactly what these options are. I mean there's a. RGB color is ahead, right?
So this.
Oh, I know, but point size ahead as well. But what I'm saying here is what?
No, no, no, because RGB color, there isn't an RGB color option. RGB color, there is a point size option.
No, there isn't point sizes.
As far as the, far, as far as the front end is concerned. There is.
Okay, that's a different story.
But there is, but, but, but, but there is no RGB color option. There is an option for the colors of points, the colors of the face of a polygon, the back face of a polygon, that sort of thing.
You're talking about a different layer of the design than this.
I, I, I may be, but the point being is that it's, it's not RGB color.
Okay, fine, fine, whatever. Doesn't matter because it's going to get translated anyway for the front end. Okay, so what I'm suggesting here, it's not quite the right setup, is a thing for multi points, for multi primitives that basically is like a data container for styles, okay, that has these packed lists that say this function. Do you see what I'm saying? I mean this is, this is literally responding to the. Let's make a data structure, it's similar to this thing here. Let's make a data structure that we can represent serialized. And it's not completely crazy, but it's probably not something you're going to want to type in.
Yeah, I mean I, I guess you're saying it's basically applying the left hand side of a rule as a function head to mapping rather across the values on the right.
Right. Look, I'm suggesting a thing that has the same level of relationship to graphics that this has to graph, which is, you'd never type it in. Because I'm still not understanding. I mean, I don't think, you know, for this is primarily an output story, isn't it, Jose?
For me it is. Yes, indeed.
Well, and in terms of the user expectations, I agree with you that it's very unlikely that someone would expect to successfully read this. But I do expect the occasional user to want to create it, Create and use it, because they have the same kind of problem that we have, which is they want something at scale to work smoothly.
Yes. And one day I think we'll be able to do that just with our standard symbolic primitives. But I agree this is a good intermediate. But. So I mean, you know, look, here's. Here's a possibility, not necessarily beautiful. So we have the notion of directive. Right. Actually, here's an idea. Okay, so right now, directive, I could say in my graphics, I believe I can just say something like directive red. And that's equivalent to just saying red. Right.
Directive is effectively flat.
Right. But so now I have the question, what if I had. Does directive flatten lists that are inside it?
Directive doesn't have any evaluation rules, I think.
Okay, but what do we expect this to do?
Blue.
Okay, so here's my question. What about the possibility of a multi directive which can be given a list of things. Ok. And for jollies, it could actually allow a multi argument form in which you could just say point size. Blah. Ok. A multidirective expects to map across a multi primitive here.
And only a multi primitive. Right. So not the equivalent list of, you know, point expanded out.
Sandra is asking reasonable question. Why doesn't point size just allow a list of values and just work?
Well, a. I'm not sure it would be possible, but maybe, I mean, just in terms of, you know, getting the right level of lists. Well, why?
Well, I mean, I think that's basically equivalent to what you just proposed. But instead of having a multi directive, we have multi directives.
Every directive can be multiplied.
Yeah.
I think there's one place where that will definitely fail, which is the. No, I was thinking this hackavola fact that that works, which we did because it was too painful to always have to be applying RGB color to things.
Well, but RGB color 0.4 doesn't mean anything.
It should be pointed out by the way, that directive does this though.
Does what?
Works either with a list or. Or without.
That.
That of course doesn't need to define what multi directive would do. But I. I'm just raised that as an issue.
I mean, I guess the question is.
Avery is pointing out the directive of a list says it's equivalent to directive of the non Lisp Verogs.
Yeah, that's. That's what I mean. Yeah. So.
So coming back to Steven's matrix idea or you know, data container idea. Is there something there, John, with, you know, the template box support that Jason.
With. I'm sorry, with what again?
Jason's template box support that he just added.
Input box.
Sorry, Template.
Oh, template. Oh, oh.
That comes back to Steven's style function sort of, but goes even farther.
Well, so you could, you could maybe avoid the kernel overhead. So my understanding is that there's significant overhead example to make boxes and you could probably use that to remove the make boxes overhead. It's unclear to me. I mean, my concern is that you might have purchased that at the cost of increased front end overhead. Template boxes are not as efficient as they should be yet. I mean they're wonderful and we use them all over the place. But. But they have a bit of a scaling problem.
Okay, let's.
Let's zoom out for a second.
Can I. Well, I just wanted to make sort of two points which are one, I mean points RGB color of 0.4 doesn't mean anything, but certainly hue of 0.4 and gray level of 0.4 dollars. I don't think we can do this in general. The other is do point size or absolute point size take things like scaled or other things?
Yes, some of them do.
Okay. I mean, because one possibility is we only make point size a multi directive thing.
Well, and by the way, this, this raises the question which we haven't raised yet, which is what is the default thing? If you just gave a list of numbers, what is the default thing? Is it a point size or an absolute point size?
Yeah, I think that. Look, I'm much more partial to something which is essentially a packaging mechanism. Just like we have things like compressed graphics which are not intended for user consumption. This to me, what Jose needs is a thing which is for display. It is not, you know, in a pinch it's consumable, but it's not very consumable. How can I get a compressed graphics?
Really just list plot of a, or even any regular plot will do it. Just plot a sine wave.
But you'll only see it in the unformatted cell. Right. You won't see it in the actual boxes.
I see.
Yeah. This was done by the front end actually, not by the kernel.
But don't we transmit things in this form over WSTP and things.
No, over WSTP we send the packed array.
Right. That compressed data just represents a single packed array and in which case it's more efficient to just send the packed array.
All right.
Compressed data actually takes up more data than.
What I'm suggesting is that what we have. Is a thing. I just think about this for a second. Yeah. I mean this would be a direct. A multi directive that you could say style of, point of blah blah blah. A multi point comma multi directive, blah blah blah. And that would know that it's essentially threading itself. You could even call it threaded directive.
It's.
It's a very obscure thing, threaded directive. Because that's what it is. It's like threaded, isn't it? Sort of.
Sort of.
And then in here what we would do, I mean, I would suggest that we just say literally point size list. He wants another directive. You say threaded directive. Maybe threaded directive isn't the right name. You know, hue comma list. They're all packable, they're all whatever comments from people.
So. Sorry, go ahead.
Sorry.
I was going to ask about colors. So colors would take a matrix, right? It would be like a list of, of triples.
Yep.
Or quadruples if you want to add opacity. Yep.
No, but it will be, it will be a uniform non ragged array. I mean if you want it to pack and so on.
Yeah, of course.
But you're the one generating it, so you have control over that.
And you know, of course you need to make sure you don't do something silly like you know, and an array of reels, except for integer zeros and integer ones. You know, don't, don't do that.
And if you do this on its own, right, not inside of a style but right in front of the point, then if you had two multi points that would apply individually to each multi point, just like read on its own would.
Yeah, so that was actually the, the point that I was going to bring up is by, I mean, you know, technically no matter how we do this, I could find a way to express it in style, but by having its principal expression in style. I'll just point out that multi directive would apply individually to everything in the first argument, which might be a list of things.
Right. And each one would do that. I mean, in, in. I think. Okay, so I've got another possibility.
And I'm not saying that's fatal. I'm just saying that's a consequence to me.
That's sort of a good thing. Right. Just because I could put. Like I said, I could pop it out on its own and then I'd have, you know, if I had two separately randomly gener, you know, Two separately generated points. I wouldn't need to find the multi points. I wouldn't have to combine them. Assuming they were the same shape or, you know, wanted the same options. I could just have them next to each other.
Look, I think this is the right kind of direction. I think what we want to do is come up with a somewhat obscure thing which if somebody sees it in the input form is not horrifying, but it's nevertheless a sort of packing type construct that seem reasonable to people.
Yeah, yep.
If you know, it seems reasonable to me, I would, I would put more stake in John's and Brett's opinions than my own on this particular detail.
So Brett, I mean, I'm not opposed. I mean I have implementation concerns, but.
Well, why don't you guys think it through and you know, from my point of view, this is going to be primarily, you know, like graph. It's going to be something where the input form is not profoundly embarrassing, but it's not something a user will typically ever see.
Well, so Brett and I can hash this out and come back with a refined proposal in a future instance.
Let me by the way, say why users aren't going to see it and just make sure that we're on the way. Right. Same wavelength. I mean, so in the case of Graph, the reason users don't see that input form is because mostly they deal with a graph by just gulping the whole graph or they have accesses like edge list and so on. Right. So in the case of Astro Graphics, I'm assuming that most of the time users will deal with it. Oh, I've got a list of stars, things like that.
Well, the stars are part of the background. It's just that you want to say I want to see all the stars beyond magnitude 5 or something. And so it may be a thousand, two thousand, we are supposed to be able to see several thousand stars. So it would be nice to.
And the whole point is we just want to have some way of representing a packed version of that graphics primitive.
Right.
Because then we want to rotate the sky in a manipulate and we want it to be fast.
What I hear Jose saying, and please correct me if this sounds wrong, but that is that the Astro visualization stuff is like a lot of other visualization functions that it does a bunch of work and boils it down into fairly basic graphical result where you know, the original meanings are no longer you, you can't go back and dissect the image and say, you know, like, like in a plot, you can't go back and dissect the image and say, oh, this first line is actually, you know, a plotted sine wave or something like that.
Exactly. Yeah. So the, the stars are generated by Astrographics. Users will not say, give me these 2000 stars.
Right? But, but, but I presume, like geographics, the original input is still in there, right?
Yes, but the point is that the original input doesn't have the list of the 2000 stars, right? Yes, it may have something saying, give me the stars above magnitude 4.
I mean, basically what you're saying is you want to have a. Sorry, just one second. You want to have something which is like a background, but you want it to be in arbitrary graphics.
Exactly, yes. So Astro Graphics is vectorial, fundamentally, except for the galactic image that we put sometimes. I mean, this could be used also if for some reason we wanted to represent cities in the world in geographics with different colors and different sizes because they have different populations, could be used there too, but it's not that common.
But basically all of these things are background like images that you happen to want as resolution, independent graphics. Right. So I mean, maybe we should address that issue of how to get essentially a, a quotes background image that is, you know, of a large number of elements. Anyway, I, I don't think it matters much what this is. I think you can put it in some head, basically says, you know, background image or something, or background graphic or whatever you want to call it, and then just pack it in with, with some, you know, a packed graphics or something. I mean, even, even I would even consider something like.
Well, we already have graphics complex, which is maybe not exactly what you're describing.
But I was trying to remember earlier.
Yeah, yeah, it's the same sort of thing.
Exactly, exactly. So could we not reuse graphics complex for this?
I mean, that sort of comes back to the original proposal.
Yeah, So I mean, graphics complex is really about abstracting away location data, not style data. So that, that data element in the second, in the, in, in the second argument, that's, that's locations. It. We. And, and you can't make it be anything else. Now you can use those locations as polygons, lines, points, whatever, but they're locations.
Sorry, Say that again. Sorry.
Okay, so the second argument of graphics complex, those are XY or XYZ coordinates. They, they really, you know, they can't be things.
First argument.
Oh, first. Yes. Sorry, excuse me. First argument. Yes. You know, it really can't be things that like get past the style directives or anything.
No, I understand. So graphics complex itself is not going to cut it. Yeah.
We could add a third argument called. Which would be style data. Maybe. Maybe that doesn't make any sense.
Well, I mean, graphics complex already takes, you know, vertex colors, vertex, you know, whatever's.
Yeah, I mean, we actually, it's. It's a bit of a challenge for us to keep on top of ensuring that graphics complex with an arbitrary second argument can, you know, work with the options that are specified.
By the way Sandra is commenting that multi, point, disc, and circle will be welcome anyway. And I agree with that. I've really wanted that a bunch of times. Fix the radius, multi point, left, disk and circle.
Disk and circle. Okay.
So you want disk encircle to thread over the first argument.
That is correct. That seems like a very useful thing. I've sort of assumed that works many times and been disappointed that it doesn't.
Right. Although, again, there's the. There's the bread case of. Is that two circles, one of radius 5 and one of radius 6, or is it two ellipses?
No, no, no, no, no. We're not talking about the second argument. We're just saying the first argument. We're saying identical circles. If you want different circles, you're out of luck, but you just want many, many copies of the same circle.
Right.
I think each one's asking if you have a list in the second argument. So I think in that case.
In that case, you're getting a replication of that list for every circle.
Yep.
So everyone is an ellipse.
Okay, so you. So you're not allowed matrix cube things in the second argument, only in the first.
That's correct. That's correct. The first argument will be the only one that would multi, and I do think that's highly worthwhile. And I should have made that explicit point myself because I've run into that issue many times. I don't know about other. Our other graphics primitives, but it seems like a good thing to be able to do. All right, so we got two things. We got that.
Well, we.
I mean, we've been steadily pushing through all the graphics primitives where there were no ambiguities, but.
Yeah, well, okay, so I'm saying circle is like. There's no threaded. There's no multi. There's no multi. Multi. There's just multi. Positional.
Yeah, yeah, we can do that. That's straightforward.
Okay, then we should. Okay, so you guys need to make some proposal for this. I would recommend just a very packed object that is optimized for display and optimized for use and not. Don't worry too much about what it looks like. I mean, what it looks like in.
What the input form is.
Yeah, right. Exactly. Okay.
This one should be much more straightforward.
Okay, good.
It'll only take half an hour.
Okay. Prototype build.
Yeah. And there is a documentation page, futurized page that you can open.
What's happening here? Why is this not opening? I don't just dog slow.
Auto opening in the Docu Tools palette, which was unbelievably slow.
It may be that the kernel is crashing. If it's.
Okay. All right, so Create Lightbox.
Well, I don't know that I have up to date rough page. Maybe one of us can share if we have. If you want to see the actual examples in action.
I'm just excited to know what not this is. So.
So the model is create dialogue.
Okay. Okay. And how does this end? Only with user. Only with a user action.
Yeah.
How does Create Dialogue. Okay, so but there's no choice that you have, like Create Dialogue. You might expect that the dialogue would return something to do with what you picked in the dialogue.
It actually doesn't Create Dialogue totally does not do that.
Right. But something like input.
There are dialog functions that do that. Like Choice Dialogue does that. But Create Dialogue absolutely does not do that. And that's very intentional. But.
So Create Lightbox would again be a no information transmission. It's just a blocker.
Well, doesn't actually block the kernel.
And if not by default it could be. There's a proposed option to block the kernel, but it doesn't block it by default.
So what happens? So it brings up the Lightbox and then things are singing and dancing behind it.
Yeah, I mean, well, the kernel. Well, if you. If you. If you. If the evaluation queue is non empty, the. The kernel will continue evaluating. And if it is empty, then it'll just wait until you dismiss and type something else in.
So, I mean, keep in mind this is.
Okay, so what just happened there was it created 10 light boxes.
Yeah. And did you notice that it got lighter?
I did. Yeah. That's funny. Okay, but if I. If I do this, if I say, how do I get through this? I have an animation going on behind it. The cheapest way to get animation is.
The answer is yes, that would work.
Yeah, like do like animate sign of. I know, X plus A.
Okay, so then, then what I'm doing is I'm saying I don't understand how I get that as output. Oh, I see. I have that on a separate thing here. I say animate plot Sine x plus a.
Then in A from 0 to 2 5.
Okay. Now I create the light box and mostly I don't. It'll just emerge from the darkness. From the shadows. Okay. Only one level of lightbox. That's cool. I mean, I can't move this thing. It's kind of annoying.
So the. The implementation of this is as an attached cell that is covering the entire notebook window. And what's that?
That's an escape.
Yeah, yeah, that would. That would be a buglet. We can. We can deal with that.
That's an escaped pet cockroach. As opposed to dot. Never mind the. Okay, well, that's cool. All right, what do we have to figure out here?
So there's a string.
Yeah. Okay.
Hold on.
Where does the label go?
In that top area that was empty.
So you see, You probably should have an option for the. Oh, there is an option for the color.
And wondering if you want it to be a bit lighter or a bit more transparent than it is. Just.
I think so.
More than one. But maybe that's wrong.
Well, and that background option applies not to the surrounding gray translation.
That's to the pop up.
Currently.
Yes.
May not be correct. Yeah. Because you've got two different things that it could apply to. I mean, normally background.
Yeah. Normally it applies to the content. Right. So in that sense, I think decision was correct.
Yeah.
We could use appearance for that somehow.
For what? The appearance of the light box. Correct. Of the. Of the white bit. Yeah, of the. Of the. Of the big expanse of gray or of the small thing in the middle.
I was suggesting the small thing in the middle. And then we could repurpose background to be the big expanse of gray.
Sandra's commenting. Not sure about the name. Lightbox. Yeah, I agree that that's a. It's more like a blocker. I mean, I know that's a name in User interfaceology.
Yes. That's why we used it. Yeah.
Right.
I'm.
I mean, I know it's not capitalized, but I was a bit concerned about the name because it might sound like a box object, which it's not.
What else might it be called? Does it call the blocker or something? Or a. I mean, it is a blocker.
I mean, I mean, you obsess about these sorts of things. But we didn't obsess about create dialogue and whether it would be confused with dialogue sessions.
We did think about it.
We might have thought about it, but we never said let's reinvent the world's terminology because we have.
I know but dialogue is a lot more common.
Right. Like, I'd never heard the term lightbox before. Dysfunction before. Luke told me about dysfunction, whereas I did.
Yeah. And by the way, a light box normally is a kind of thing you put slides onto to look at them and things you put transparencies onto.
Yeah. Yes, yes, yes, I know. I've actually used a light box before.
Yeah, I know. I'm sure. So have I. But I mean, but, but I mean, but this is.
I'm sorry to say. What are these slides you talk about?
Okay, so listen, guys. But, but the fact is that the use of the term lightbox in that case is the exact opposite of this case.
Correct.
Which is really bad.
Well, I guess.
Well, it. Well, I wouldn't, I wouldn't. I wouldn't fully agree with that statement. It is opposite in the sense of where the light is, but it's not opposite in the sense of where your eye is supposed to be. Your eye is supposed to be on the thing sitting on top of, you know, the background. That's in. In that sense, both light boxes are the same.
This thing is primarily to be used as a blocker. Yes, go ahead. What are you gonna say?
Yeah, I was going to say that.
In web design, Lightbox is what this is. So I guess for people that are used to web design, this name would make perfect sense.
What else does a web lightbox normally do?
So, I mean, the main thing is it's a form of in page modality, which is to say it's. And I don't think this is always true, but it's often true that it's. It, it. It's basically telling you you don't get to do anything else until you address this interface.
Yeah, I understand, but sometimes that interface contains a lot of content on it. It's not like the case here where it's a pure blocker. Lightbox.
Well, I mean, this of course, can contain arbitrary contents.
Well, can it? On the gray area?
Not on the gray area, but.
Right.
But the thing that your eye is supposed to be focused on can be of arbitrary size and content.
What about something, a name like notebook pop up?
Not just a pop up.
Yeah, I mean, I really think if.
You look at web examples of lightboxes, it confirms perfectly with what this function seems to do, which I don't know if this is the origin of this terminology, but the Wikipedia, other than the thing of four slides, it says light refers to Lightbox as a JavaScript library for displaying things and dimming out the rest of the web I don't know if that's the.
Yeah, somebody, somebody used this to mean that. And it might have been a non native English speaker who thought this looked vaguely similar. And you know, God knows if it, I don't know.
Have we used the word foreground for anything.
Color. Right.
I'm not wild about the name Lightbox. Maybe we can say, I mean, if we thought we could go with a longer name create blocker, Lightbox would get the right meaning, potentially.
I'm again objecting to the name blocker, but why? Because, I mean, I know it carries the wrong connotations to me, especially given that the default for the blocking option is false.
Okay, well, so I mean it's not like as, as, as with dialogues, there are two notions of modality that we're tracking. One is modality with respect to kernel evaluation. The other is modality with respect to windows. In this case with respect to just the one window. In the case of dialog box, it's respect with respect to every window in the app in the application.
Exactly right. This is, this is what I'm saying. It's, it's only, it's only blocking one notebook as opposed to a, a true blocker which would block all notebooks or all kernel evaluations or both.
This, this is a curtain on your notebook.
Andrew is commenting. Shouldn't it be a wrapper for dialogue, input, choice, dialogue, etc. For what to do with the rest of the, the notebook when this thing comes up? It's a good point.
It's gonna say, I mean, so something that seems similar to me, John, which you know, Apple has moved away from or when they had sheets.
That I.
Think we're also a per window thing.
Yes. Yeah. So I'm wondering if they are conceptually similar because they enforce modality on a single window. Yes.
Right. So I'm wondering if this is like window dialogue with potentially different appearances as styles change.
So can somebody address Sanders point about why isn't this an option to all of these things that pop up a modal object on the window? So.
Okay, so if we give choice dialogue, for example, an option lightboxing arrow true. That might work for choice dialogue. I don't think it, I, I, I, for, yeah, for the various kernel modal ones, I think it would work, but I don't think it would. There's for something like create dialogue, it's, there's an ambiguity.
Why there?
Because Create dialogue actually, Create dialogue actually, actually returns, right, Lou? Yeah, actually returns the notebook object that it created and that gets used I mean, by people who understand Create dialogue. And there the notebook object. In that case, the only notebook object it could possibly return is the notebook that it was created inside of.
Right. It would be an option that changes the, the structure of the output.
I don't understand, I don't understand this thing. Why are we making it? Isn't it the case that you basically this light boxing mechanism, it's just a way of blanking the rest of the screen to highlight some particular, you know, dialogue pop up, whatever.
Because something else might like to know when it goes away. Right, so it needs to return the.
Yeah, I mean, I mean, so if you, you know, just, just evaluate the thing that I threw in chat, notice that A, it returns immediately and B, it actually returns something useful. Okay, now take a look before you, before you close it, look at the output.
There's a notebook object. Yeah. Which is, which represents that dialogue.
Yes. And you know, that's not just because we were being completist, that's because sometimes it matters.
Sure. But the, what is light. But what is Create Lightbox?
Returning the cell object to the, the attached cell. And so. Right, you have the reference to.
Okay, so then I'm going to say create. I'm going to say cell print of that.
Well, that's been destroyed by now. So it's going.
So what the hell is it? So I don't understand. What do you mean it's been destroyed? Well, what do I do?
Oh, you closed it. That cell has.
Okay, okay, but so what? I don't like what it says when I've closed it there. But anyway, be that as it may, what would I do with the thing if it is returned by Create Lightbox?
You could for instance, wait three seconds and then notebook delete it. You know, you can have an auto dismissing Lightbox.
Or you could have a behavior which waits to see if it's been destroyed and takes an action once it's been destroyed.
How do you do that?
I mean, I, I. Stephen, I think you're laboring under the notion that this is, you know, a, a thing which is, for which the only use case is sort of, you know, shift, enter, do something and you're done. I mean, one of the things that we're trying to do here is we're trying to make it a fully enabled citizen in the, you know, in the user interface, you know, library of components that we have so that, you know, code which may not be running as a result of Shift Enterprise and code that may not be running in a single evaluation, but in Multiple evaluations from multiple sources.
How do I throw up a lightbox that hasn't already been destroyed?
You can. You can do it. Do it in another notebook do.
So you're saying it's lightbox at a distance type thing.
Yeah. Okay, so create lightbox.
You can point Create lightbox at a notebook object.
Yeah, I see it. Okay.
Right.
I mean, if you want to try it out. Right. Do. Do evaluation. Cell. Sorry. Evaluation notebook bracket. Bracket in one of your notebooks. Copy out that notebook objects, and then.
Yeah, I get it. I realize how to do it. I can see how that would work. In terms of name, I'm kind of wondering if lightboxing might be a better term than lightbox. Oh, the author of Lightbox JS uses the term overlay.
I was just thinking about notebook overlays.
Well, that was what I. That was what I wrote over here. Create window overlay.
Okay.
Create notebook overlay.
Yeah.
I would not have quite the level of complaint to that name as I do to blocker. Whatever.
So Create Notebook overlay sounds like a reasonable thing. And then as the content of the overlay and to me.
And by the way, to be clear, I'm not opposed to the idea of having options to something like Choice dialogue either. It just doesn't quite work for the asynchronous case.
So what would that option be called? Lightboxing Arrow true or false overlay.
Well, if we. If we call it overlay here, we need to call it overlay there too.
Right.
So what would we call it?
I think. I think it would be notebook overlay. True. False. Right. Does overlay on its own mean something?
Well, or notebook overlaying.
Yeah, maybe. We have.
We have modal, which means modal with respect to all Windows. Maybe we need a notebook modal.
What is modal? An option to.
To things like Create Dialogue.
It's just the word modal.
Modal arrow true or false.
Yeah.
Well, why don't we have modal arrow automatic, which means the current window.
There's. Which is something that is slightly worrying me about that, but I'm not able to articulate it.
But that would then deal with the blocking option for Create window over. Create Notebook Overlay. Right. That is the blocking option as a modal option.
Blocking with respect to being able to interact with the notebook, not with respect to kernel evaluation.
Isn't that what modal means too?
No, modal is all about window availability, about user interaction in Windows.
And what's this?
What are you pointing at?
The lightbox thing. Isn't this about Modal interaction Windows, yes.
But not kernel blocking. So you use the word blocking. Maybe there's some confusion about which is.
Modal a possible name?
Okay, okay. So Choice Dialog, for example, is inherently kernel blocking. That's just the design of the function. It is not inherently window blocking, but can be made to do so via option. And I guess the, the proposal on the table then is that. That it could. Let's see. Actually, does Choice Dialogue take modal as an option? Surely it does, yeah. Although it seems not to be strongly documented. But.
Yeah, so only documented. I don't see it documented at all. Absolutely. Anemic list of options.
Right. Well, I. There may be a statement somewhere in here about Choice Dialogue taking the same options as something else. That's, that's. I'm allowing for that possibility, but I didn't read all the way through. But yeah, because in fact, if you look at the options list, I mean, Choice Dialogue basically takes the same options as, as notebooks.
Okay, well, so this is badly documented. So that's a separate issue. But.
Right, yeah. So yeah, I mean, we could do modal arrow automatic in that context. And while there are some considerable implementation problems around that, there's. The design problem is less so it's not my favorite way of doing things. But.
Sorry, but I'm sorry, what? Would you just say what.
So, yeah, I'm working down the option of modal arrow automatic, assuming that's still on the table. And what I'm saying is there are considerable implementation problems around that. But the. We might be able to make it work from a design perspective, though.
Let's explore. So we've got Create Notebook Overlay. We've got Notebook overlaying Arrow true or false for these other things. And we've got the modal option for Create Window. Create Notebook Overlay.
Actually, actually. Okay, okay, here. No, here's what bothers me. The Choice dialog doesn't have a way for. I knew there was something that was bugging me. Choice Dialog does not have a way for you to specify a notebook object. So which notebook object gets blocked? I mean, you could say Evaluation Notebook. That would usually be correct, but we would be basically hard coding that value in.
Because Choice Dialogue is a free floating dialog.
Yeah, which. Which by default is blocking the kernel, but not the, not the front end.
But yeah, there's something about this that isn't quite right. I mean, I, I'm. I'm a little spaced out here to figure this out. I don't think this is quite right. I don't know what the relationship is between the dialog boxes and this. It feels like the kind of thing where this is just dressing for the dialog boxes.
Well, so I'm. While you guys have been talking, I've been letting my mind wander a little bit and I'm wondering is this something that has to work at the entire window level or does it make sense to have something like this for cells that is able to obscure a cell for some period of time and I.
Mean.
Or even a box. John, John and I have had this conversation before.
Yeah, yeah, I mean, so like, okay, so I put a link in chat to the puzzling stack exchange. And so if you go down to the answers, they have these, they have this interface to. So that people can answer without spoiling the puzzle.
Right.
And to some extent this feels like a very similar.
Yep.
Type of thing.
I think this thing needs more thought and I think it's, it's being. Okay. Let's take a look at the other items on this agenda. This requires more thought. I'd never seen this before. I think it requires more thought and I think a box level version of this would be nice. And to me it's something which is kind of like a user interface element. Just like you might say, I don't know, panel or something. Right, panel. You can put a panel around anything. So similarly you could put a blocker around anything. I mean, just like, you know, to me this is more like a tab view or something where you say, you know, put a tab view around A and B. Okay, fine. And they click it and it does this. And I would say put a, you know, put a blocker in front of, put an overlay, you know, an overlay blocker in front of this thing.
And then I, and, and, and to be clear, this, I mean the implementation is just window dressing on attached cell. It's a lot of window dressing. Yeah, it's just window dressing.
But what I'm saying is, what I'm saying is the interface that I think will be nice is something where.
To.
A box like in tab view, you just put it in front of a box and it'll give you a thing that has this. Oh, clear this overlay. Great, I cleared it. Or alternatively you put it in front of a cell or in front of.
A whole.
You know, notebook.
So if I'm understanding correctly, you basically want a target some sort of. Well, can't you do that with the OBJ option with arguments?
Oh, only in an incredibly kludgy way with doms. And so on this is just with a DOM with some kind of DOM handle. You could do that.
I, I don't know what you mean by DOM handle.
I mean, I mean to a cell object or something like this. You can't do it in this way. This is a very straightforward way. If I could say, you know, I mean, we've got this concept of an overlay. What does that do? I thought that would work in a list. Yeah, I mean, this is something very similar, except it doesn't have that clearing mechanism. Right. And that's what I would have hoped would work.
Well, I would say that there's a difference between this and that and that this has.
Right.
The, the tab view hat only has an interior and this has an exterior. So, you know, how big do you want? You know?
Right. Overlay is an elementary thing. It's not high level. You build things from overlay. You, you, you know, using overlay directly, you know, to produce an interesting result is not common. What you do is you build higher level stuff with it. Attach cell is an elementary thing. Create Lightbox is designed as a higher level thing.
But why couldn't I do this by saying, you know, create a lightbox here and instead of having this overlay where it's just an overlay and it sits there, I have a little button here where I can clear the overlay.
I mean, that's Toggler.
Right?
Right.
But again, why is that restricted to the graphics and not to. Right. If you just had a one argument thing where it's your, you know, your, your object, you know, your blocker of, you know, disk. Why is it just the, the rest of the graphics box and not the whole output cell?
I'm sorry, toggle. What are you saying? What?
Right. So you were envisaged saying, you know, why can't I have a blocker or whatever we call this function of graphics of disk.
Yes.
So why does the overlay only cover that type?
I don't know where and not a whole lot. I understand. That's a different case of. Look, I think there's more thought required here. I think it should be able to cover multiple levels of thing and it should be able to be something where, you know, I can write something like this and just have an xing out button. Or I can write a version of this where it covers the whole window. I don't know exactly what those pieces should be.
Right. But. Well, I guess I would say, I mean, this sounds like a different function to me. Right. You're not popping up any content right there's. Only.
Well, you might pop up content. I don't know. I think it requires, this requires more thought. Let's not solve this now like we've defined a direction. Let's more thought.
I, I'm, I'm. I'm not happy with that direction. But, but I'm not eager to open up. You know. Why do we want discussion about it? Because we're running against up. We're running against some time limits for me here.
You mean today?
Yes.
Okay.
All right.
Well, let's just look at this. What is this?
So this is basically dealing with how do we show rasters in the, in the front end. This is, this is about. This is a front end option effect. You know, how do we display and if you. There are some samples. Examples below.
What is this for? Is this, is this related to. Out of rasters that we've seen in. In various kinds of printing and PDF export and so on?
No, not Pete. No, not printing in PDF. This is on screen. Really?
Okay, so this is the analog of interpolation order for a curve. Is that true?
Kind of. I would.
Right. I would say it's more like anti aliasing for your raster.
Yeah, I mean it's.
Yeah.
It's basically choosing an algorithm to generate pixels to fill in the gaps. So that's the simplest way to put it.
What gaps?
So, so like for instance, that request the fast. So the middle example, right, that is what, like a couple of pixels tall and 3 pixels wide. But it's being drawn to a region that is hundreds of pixels wide and maybe 80 pixels tall. So the data for the raster doesn't fit the destination rectangle. So it has to generate new pixels in order to be able to fill the rest in. And basically you're just choosing which algorithm is used. There's none. So it gets duplicated. You might use like a bicubic or something.
This is exactly like interpolation order. I mean, this is like. This is like.
It's, it's. I mean, I mean really, it's. It's resampling. Yeah, it's a. I even put it in the C. Also resampling.
Yeah. So like for instance, depending on who it is and who designed it at the time. You know, some of the people at Microsoft like to call this interpolation mode.
But I mean, isn't exactly the 2D analog of this?
Yes. Right. Only on a different axis. Right. Because it's the value. It's.
Right.
The value is translated as a color, not as a height, but yes.
Yes. And which orders can we do?
Well, that's, that's platform dependent.
Like I said, it's the operating system that does it.
Yeah, we, we are not re. We are not regening it on a per pixel basis. So like some of them might like on. On Mac. You don't get the four on the bottom example there. I think the last two on the right are practically identical in visual.
To me it seems better to call it raster interpolation because otherwise when you say smoothing quality, I'm going to say I want the best. I want high smoothing quality. But that's not really the right thing for many cases. I don't really want high smoothing quality because I actually for many uses of rasters, that's like garbage.
Well, I, I'm not attached to the name smoothing quality at all.
That's.
That's why this is here for the name.
What about raster interpolation?
I think your connection to interpolation is going to be fairly unique among anyone who cares about. That's.
Didn't you. What? You're just telling me that the operating system calls it something about Microsoft calls it interpolation mode.
Actually I didn't realize Microsoft used that name.
I don't think I looked it up earlier. What's used on the Mac, Check my memory.
What's used on the Mac on the.
Mac, I didn't get a chance to do yet.
Let's look at that. But the Microsoft use of interpolation does make it Canvas.
The.
The current name comes from Canvas from the HTML spec.
But like I said, I don't like.
It because I think that's fine moving quality. It's like I want to be smooth high. Okay. But now it's giving me all kinds of ripple.
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






