Live CEOing Ep 790: Design Review of Compiler Features Continued

Stephen Wolfram leads a design review of compiler features with Tom Wickham-Jones and Anthony, covering a new introspection UI for functions and types, type-declaration options like creator and constructor declarations, and plans to populate function signatures so more Wolfram Language functions can be compiled.
Chapters
Okay. Hello, everyone. Welcome to our third design review for the day for version 14.1. We are now talking about the compiler. Okay. We're seeing Tom's screen here.
Right. So this is following on from a discussion we had two weeks ago. So there's an item that we did not get to cover and there's two new ones. So should I just, like, dive in?
Are you going to cover the thing about the distribution of compiled. Yes, distribution of compiled material. Okay, fine.
Yes. Yes.
All right, let's start off with compiler information.
Right, Compiler information. So this is a, you know, proposed new function. Is this size good?
Yeah, it's fine.
Okay. For introspecting on functions and types, it. We believe it can't be information, it's just.
Sure how it works. Sure how it works.
Fine. Right. Okay. So you can type in functions. So here's for example, dimensions. And it shows. You get a little thing here that shows you what it knows about dimensions.
With forall, type is a. Is a built in descriptor. Correct.
These are all. These are all built in functions. Right. So this is a. You know, and then you get a little show. You can see the implementation and you.
Can click on the implementation of what. Sorry, go. Go back.
This is the function that implements.
So what the heck, get data or copy to.
Yeah, these are sort of part of the implementation of the.
How well are they defined?
They're gray, I think because they're from an internal context.
Yes.
Why are we exposing this right now? I mean, this is a lovely thing to expose one day, but I mean, when we haven't documented any of this stuff or anything like, it's.
It's pretty useful.
I mean, it's analogous to double question mark.
Right?
I mean, double question mark also shows you. I mean, unless it's read protected, it shows you a definition full of internal stuff. Okay, but this is a more useful version of that, I would argue.
Yeah.
Is there a list somewhere of all these internal gray functions?
No, I mean, they're just internal context functions. They might be, you know, they might only exist in one file.
So how do I see the definition of get dimensions? I mean, dimensions seems to me get dimensions is probably the main. Main event.
So this is. I think it's going to be.
Okay. How would you know that?
Because you mounced over it.
Let me see it, let me see.
Honestly, I don't think this is really the main point of this function. It's still.
This is showing you every, you know, it's, it's. It's all accessible from.
Okay.
So. Right, yeah. So we've. You can also get to these types. So, for example, this is the act array type. And we have little. Like. Like there's documentation for this. So this links. This links to the documentation for packed.
Array type, which is different from. Okay, wait a minute. Have we had this before, this compiled type documentation?
Yes, yes. It's. It's. We. We add to it every. When we add sensible types, we.
What's that information thing in the middle of that page? It says information of array element type. Hang on.
Which properties.
Properties. Properties.
Is this thing here, right? Yep.
That's in compiled code.
Right. So I could do.
Maybe you should say that.
But yes, it probably could. I mean, it's picking up something like this. So there's lots of. There's lots of stuff here. But it's. Yes, that's. That's the patch array.
Type compiler information of round. Huh? Okay. Type compiler information of fold pair list.
My guess is that doesn't exist.
Right? So that doesn't. It can't find. It doesn't. That means it's not supported yet in the compiler.
Nest. Does nest exists? Right?
Yeah.
Okay, try nest wild list.
I'm not even sure if nest list exists, probably because I'm not entirely sure what it returns. Probably a list vector, right?
So nest wild list is.
Is not.
How about nest? Well, how about nest list?
Nest list is there. Okay, but this is pretty useful, actually.
It's very useful. It should have existed years ago.
Okay.
Much, much more useful.
We. We're adding lots of things to make the compiler more useful.
Right? Right. How about. How about Nest Graph, for example? Does anything with graphs exist?
No, no, not really.
Okay. Okay, onward. Here. This is very useful. I agree.
Good. Right, Right. So here are. You can put types in. So like Integer 64, that has a page you can bring up. But we have this type. So we have this type hierarchy of abstract types that you can see here. No, these are hype links.
Wait, wait, wait, wait, wait, wait, wait, wait. What does this mean? This means why is string serializable? Go ahead.
It means integer 64 is a member of machine integers and signed integers. Both of those are members of integers, those are members of reals, and those are members of numbers which are string serializable.
Why is this way up rather than the other way up?
Well, the type you'll have is always.
I mean, in other words, this is saying that intro 64 is a sub case of these things here. It's kind of weird that the arrows go down into the. Into the super cases but it's pointing to parents. Yeah, but usually parents point to children.
Yeah, it could be. It could be the other way around.
I mean, the other way around.
This way around might be that. So there's always going to be one type you're talking about, but there might be many answers.
I mean, you could just turn the arrows around. I mean, it still can be drawn this way up.
No, I know. I mean, but, but the, the thing would be oftentimes when you draw trees and stuff, you draw it so that there's one root and many leaves, which would be this way up. But I think it doesn't, you know.
Okay. I don't have strong opinions. It's pretty obvious what's going on.
It should be directed, you know, which.
Oh, definitely should be directed. But it's pretty obvious. It's a little weird, but it's pretty obvious.
Right, Right.
I mean, I mean, it would be helpful perhaps if it said something like, you know, instead of. I don't know whether it could say how we could change the word hierarchy. It's rather silly to say super classes or something.
Well, this one here is. Yes. Or could we have the tool tips have like a description maybe of when you hover over type hierarchy? Because at the moment it just gives a key. Yeah.
Something. But I mean, the other thing is that aspect ratio could be slightly. I don't know whether that's easy to change. I mean, look, this trivial point, this is, this is, this is detail. But, But I mean, this thing is a bit tall, given what it's doing. It's irrelevant.
Right.
Okay, let's just think about this for a second. Do you think of anything that it's. It's fine. I mean, this is pretty obvious.
I'm thinking about this. So many meetings and.
Okay, well, I mean, I think it's. It's. You understand my point, though. It's a little weird that this is going to super cases without saying it's going to super cases.
Yeah.
I mean, it could be the other way up. I mean, but I think that also if you're really confused with the direction of the arrows, it's. If you look at the, the actual, like, labels.
Yeah.
It's usually pretty clear.
Yeah.
And I also think that it gets more obscure as you go down, which is a reason to have it this way up right now.
Yes, that's, that's, that's true as well.
All right, this is cool. Okay, what does abstract types show?
This is basic vertex list of that, I think.
Yes, exactly. Yes.
But why doesn't it say super types or something there?
Or abstract types is the name of the option that we have in typedev.
What does that mean? Why is it called abstract types and what these are super types, correct?
Well, it's called abstract types because you have concrete and abstract types. A concrete type is like, it knows how to lay it out in memory. An abstract type is, it doesn't necessarily, it's just like a theoretical type.
Okay, but then this is, but then this is not just abstract types, it's abstract types and that are supersets and the thing.
Yes, but they're abstract types that this is a member of. Like this concrete type is an instance of these abstract types.
Well, how do you say that in three words?
Abstract types containing the declared type.
Yeah, but that's not three words.
No, but I mean for reference. So one, one related thing, which I think maybe. Yeah, Tom has on the screen is that the option for type declaration is called abstract types.
That's.
You specify what abstract types your, the type you're declaring implements.
So. Sorry, sorry, say, could you say that again? Sorry.
Just so the option. If, if I'm declaring a type of type declaration and I want to say this type, this concrete type I'm declaring is an instance of these abstract types. You use the option abstract types.
Right, but that's more obvious what you're doing when you're declaring a type and this is saying, oh, by the way, it has these abstract types.
Well, okay, think about this way. Imagine, imagine if, I mean this is, this is the wrong term. But what if you said just super types there? Would you understand what that list meant?
I think so, yes.
Or parent. The problem with super types, it sounds like super class, and this isn't quite.
The same thing, but I, I, I don't, I don't, I'm not actually proposing super types. I mean, just like I think it may be that, I mean, abstract types may be analogous to saying super types. I guess super types is the advantage that super, you know, implies like it's super relative to something and then that's something that's obviously call it parent types.
What would be wrong with calling it parent types?
Well, one, I don't think we use that term anywhere else.
Well, okay, so you're saying if I want to extract that property, how do I extract that property from, I mean, if I wanted to get that list programmatically from integer 64, how would I get it right?
So I can do this, can't I, Anthony? Yep, I do that.
Yep, yep, there we go.
It's Pretty nice.
It is nice, but I'm still. It's very obscure the way it says that. I mean, if it said parent types, I would understand it. And by the way, I assume that can be a second argument to compiler information as well as a sub value like that.
No, but we, we, we.
It should do that. Okay, Right, Just like information does that. Okay. I have to say, I think parent types would be clearer. What the heck it is. And.
Even here's. Here's one other thing. For, for at least the programmatic case, when you created this type, you would have used the option abstract types. So I think it makes sense in what function type declaration. And so when you retrieve exactly that list back, you should definitely be able to call it abstract types.
Well, would we not want to call it parent types here as well? I mean, keeping compatibility by maintaining the abstract types, if you wanted to use it, would that not be a better name for it here?
I mean, we can. I mean, maybe. I mean, I, I feel like. Right. My concern is that basically we're just renaming abstract types to be called parent types, which I guess we could do, but I don't really see any great reason to do it.
So the second usage here, type declaration of abstract, is using abstract in a different sense. It's.
No, that's in the same sense.
No, but. Okay, but it's just saying this is an abstract type. Okay.
And.
But it has certain parent types which happen to be abstract types, but the most important thing about them is that.
Their parents only be abstract types. Right.
Well, that. So then what's special about them is that they are parent types, not that they are abstract types. Therefore, I claim that their option name should be parent types, not abstract types. Because many things are abstract types. Only these things are parent types.
Well, no, many things are also parent types. Right. They might not be the parent of this thing, but they are parent types. I agree that any type of parent. No, right, that. That's what I mean. But like the. Right. I mean, I, I do agree that. I mean, both parent and super make it more clear that it's parent of something, super of something, as opposed to abstract types where it's not as clear like that it's an abstraction of what.
Look, my recommendation is you're using Product Abstract, Alias, whatever, here, it's perfectly good. Now the thing that you should do is, is down, down below where you're looking at the options here, that should be parent types at the top. Because. That's what I think. Because that's what's special. About those types, they. But you couldn't have parent macro types or something. These are just parent types that happen to be abstract types.
That's true.
I'm not completely opposed.
I'm not completely. What you were saying. At one time we called them inherited types and then we renamed them to abstract types.
No, but inherited would be the wrong way around again because they're not inherited.
Inherited by or something. I can't remember.
Yeah, right. But if you call them parent types, it's clear what the heck they are, I think.
Should we have a discuss?
Why don't we do this? Why don't we. I mean, I don't see much reason why we could. Oh, two things. One, we could certainly have the label in the compiler information, say parent types and we could support both the sub values and it would be the same thing.
Right.
And we can always change it later if we realize.
I suggest should change in type declaration but support previous one as well.
Oh well, I mean, I think there's a ton of places where we use the term abstract type.
Okay, well, fine, fine. All right, let's go on. That's. This seems like a small issue, right? I really like the fact that you're documenting. I mean this is really something should have been done a long time ago because that would have meant all these times when I said does this work? Why doesn't this work? Oh, I could just look it up.
And it doesn't work. This sort of helps. And here's like a dynamic array and it has like the fields with their types and these operations, which is something else that we want to talk about. So. Right.
What's interest in that Type and a data structure.
This is the type that creates the data structure.
But those operations are data structure operations, are they?
Not exactly. Yes, yes. So we have a. That's what we've got to talk about here.
Okay. All right, fine.
Right. Okay, well that's functions and types.
But do you have an option?
We have some options like make a compiler environment.
This is just. You can. You can tell it what compiler environment to introspect in.
Yeah, there we go. And so if I do that, it doesn't work. But if I. It takes a compiler environment option and then it knows about, you know, it can find the thing.
That's nice.
Yep. So.
So compiler environment is an option. Is it an option to lots of other things as well?
Yes, yes. Right. Function compile.
Right. Ok, yes, I guess I knew that. Yep.
Okay, so is. This looks good to me. What if we.
We want to rename the Just the label there. I think it's the only thing we really say.
And support both properties.
Fine.
I'm just making some notes. Okay, fine. Right, good.
I have one other minor comment.
Yeah, please.
In all of those declaration things where you say V1. V2.
Yes.
Why is it called B B for variable?
Well, yeah. Yes. Yes, It's. It's an arbitrary. It's a type parameter. So it could be called something different.
No, I mean, I. I don't actually.
Is the string. Sorry, Tom, does the string V1 come from the actual. For all type? Like if the source code said something. If it said ARG, would it say ARG there?
No, it uniformly uses V2.
It's probably just as well.
I. I think that's probably right.
I'm just wondering if it should be V or. You know. I don't know. I mean, it was. Whether it could be italics, for example. It might be rather beautiful if it was italics.
We could have some different.
I don't know whether that's doable because, I mean, it's really. This is presumably. What's that?
It's a notebook.
No, I understand that, but I mean, but you. You want it to be copy Pastable. I assume it is copy Pastable. Right. Now if I take the right hand side of nodes there and I simply copy it.
We'Ll see.
I'm not going to be copy Pastable. Yeah.
Can you input form that? No, that's. That's some secret witchcraft object.
So why don't you make click to copy work?
Yeah.
Well, it can't be click to copy because you have to click on the links. Yeah, I think it's.
We do want the hyperlinks here, so.
Yes. It's a pity that that's not copy pasteable, because I can see that.
Yes. I mean, but actually, I think we.
Discussed this with the implementations too, about whether. Right. Because the problem is. So if you open up the implementation of one of these functions, Right. I mean, one option would be support click to copy, but then you can't select pieces of the implementation, which is kind of annoying. Another option is, you know, you can select and copy it, but then it comes out as a bunch of junk, which I think probably what it does right now. But it does stuff like tooltips. I mean, really what you'd like. I mean, you could have interpretation boxes too, but then that's even weirder.
Yeah.
Or you could have something which, when it rolls over, has a copy button if you really want.
What do you mean when it rolls over?
When you when you hover over that section of implementation. Oh, I don't know, I think that's overkill.
Yeah, I mean, I think really, this.
Really. Look, we have this.
Which.
Yeah, I mean, you can extract the fields. There's.
Oh, that would normally be called rules or association or something. Fields is not a thing I've seen for that.
Fields of type. They're fields of fields of the type.
I see.
Not fields of this box thing. But. No, but. But this also doesn't do it for implementations. I mean, generally, I think that the real thing is, wouldn't it be great if we had some kind of. It's not an interpretation box, but it's kind of like an interpretation box. But it's just that it. When you press copy on it, it copies something different from what you actually had selected.
Right?
Yes. Well, that's a question for the front end team. I mean, maybe no information.
I was trying to think if we.
Had something like that, but nothing springs to mind. It was something to be useful though.
In kind of, you know, many applications.
So let's bring it up in user assistance. Sure.
I don't know if they're OS problems, but. Yeah.
No, because I think you can put whatever you want on the clipboard. It's a question of which clipboard format. Well, anyway. Okay. All right, let's move on here.
Right, fine. That's compiler information. So we like that. We'll. We'll.
Yes. I mean, maybe I would like to come back in a few minutes to it. Let's see the rest of what we have to.
Okay, fine. Right, so this is some new options for type declaration for declaring when you declare a product. So we have a thing. We can declare a function to create, you know, like a creation function. Maybe we chose the name creator. So I can make a type declaration and then I make a function declaration of the. Of that type, and then things like Create type instance will. Will call.
It drives me crazy that this type setting is wrong. In these. In these. Why on earth is it. Is it that stupid giant font for Create?
Well, I think I copied this from some documentation that came out.
All right, okay, well, okay, it's wrong there. That's the point. Okay. Anyway, let me just stop worrying about that. Go ahead. What were you. What were you saying here?
Right. I'm just saying this is a convenient way to set a creator. And then another thing we can do is to set, say like operation, what.
Is the creator and why is it needed for a product type and not other things? Well, makes sense for composite types. Of some kind. Right, because intrinsic types, there is no creative.
You want to allocate memory, you know, create an instance of. So.
No, I understand, but. But isn't there a raw. As soon as you have a. Doesn't have to be a product type. It could be a type specifier as an array of whatever's else it's.
Yes, well, arrays are also made of such things. This is the sort of RAW product itself. So like. Like if I had some sort of array, you know, that I was making like that it would also be useful to have a thing to create instances. Yeah.
Okay, so it's things for which there's memory allocation.
Yes, yes. Which are typically these products. Right.
Okay, then we also. What kind of a thing. Wait, wait, wait, wait, wait. What kind of a thing would that create a create test type. Oh, I see, you've got it.
It would be, you know, allocate the buffer that goes in this field of the struct and you know, fill it with ones or something.
Right, okay. Creator. Wait a minute, wait a minute, wait.
A minute, wait a minute.
I'm just thinking about the name creator. Okay, fair enough. I mean, it's more like an allocator, isn't it?
Is not at all like an allocator.
No, no, not.
All right, okay. I mean, but all it does is to produce the memory for it now and it fills.
It executes code. So it might.
Okay, okay, okay, okay, that's fine.
Right.
It's just a program that returns the object. Like an initialized blank object.
Fine.
But the nice thing about this is that other things like. Like maybe create data structure or something could call this automatically. You see, it could find this.
Yes, right.
And call it. You see that.
And what about the cleanup function?
Well, it. That happens automatically that there isn't a cleanup function.
I see. So nothing that creators create ever needs to have an explicit sort of.
I mean, actually, don't we already have. Is there a compiler callback thing for doing this sort of. If you have non trivial cleanup. Yes, yes. There's already a way to do it.
Right, okay, but I mean, for the stuff that's in memory that you're currently working on with the compiler, there is no. You know, it's automatically cleaning up.
Yes, yes, yes.
I mean it might in some future world have X things going on that do not.
You know, that would be. That would be good. But the default.
But that's what you do with that. You can do that right now with compiler callback. So I think that the only thing that we might Add. Maybe we could add, you know, in the future we could add a convenience option. You know, so there's creator and there's. I don't know what the other one is. Destructor or something. Well, if it's constructor, then you expect constructor. But. But. Right.
Why isn't there constructor as opposed to creator? Because if you're going to have to have a destroyer, try to create a destroyer.
We thought about that, but we didn't.
So I think one thing is we.
Mostly use the word create, both in top level and in compiler. I mean, data structure for the other case. All right, so we have creator and delete Tor.
Yeah, well, something. It could be worse. It's a somewhat obscure operation. Okay, Operations, Right, Operations.
So you can declare operations on a. On a type. And then when you declare. And then you. And then we have this new thing, operation declaration. So we have the name of a type and the name of the operation.
And there's just one here that's a fundamentally new function. Like type declaration.
Exactly. Yes, yes. Right. And yeah, so this is kind of. And then you can use this, like, in compiled code, you can use this, like, data structure type type syntax.
So this is a new, like, method like thingy.
Yeah, well, we've had this in data structures. I know it all exists. This is kind of making it official. And allow, you know, then when we've done things with this, then there's another function which I don't think we're going to finish, but we talked about a thing called Initialize data structure. Then you would. It would pick up type declarations like this and the operations and the creator, and it would make a totally new data structure which. Which is definitely something we want to do. Right, right.
Where's the list of data structures? How do you get out a list of all known data structures?
Well, there's.
They're dollar data structures.
Dollar data structures.
Oh, okay.
So, right, so you can also add. When you make an abstract type, you can put these operations on the abstract type, which is, which is pretty nice. And then you can have. On the abstract type, but you can. And you can even have it on the abstract type and have like an implementation. So this is like a default implementation, but if you have it on the abstract type. But the, you know, the concrete type has its own. You know, it follows the inheritance system.
Hold on, hold on, hold on, hold on. On the abstract type. Scroll up a bit. How do you implement. I don't understand. No, no, right there. ABS deck for increment. Right. How do you. What is that? What does that function increment? If it's not a concrete type yet.
It'S, it's not a concrete type. But then you make another type that has this as a. You know that. So this is increment. This is an abstract type that's an incrementer.
Yeah.
And here I make, you know, an actual concrete type that has an implementation of increment, you know, that has incrementer as one of its abstract types. You see, so.
Right. So I think, I think that the.
Thing like I could do.
One way of understanding it is that basically, if you look at the implementation of the increment function for the abstract type, it basically assumes that there's this value field. So it's basically saying by, by social convention, you should only say that you're implementing incrementer if you have this value field.
Okay. Does it check in any way? I mean.
Right now I think it doesn't really.
Okay, but, but so, okay, so in other words, it is saying there are all kinds of things you can do that increment, assuming you have a value field.
Environment.
Say it again.
No, no, sorry.
Yeah, sorry, go, go on. There's a need to look at. But yes, sorry, continue. Well.
With implementation. So wait a minute, so the increment function, where is the definition of the increment function? Function decoration. There you go. I see. So it has quotes value plus plus which might not. And the quotes value thing might just not be there and then it's toast, right?
It better be there, otherwise that won't compile. But yes.
Okay, so then how do you introduce the concrete type?
Yeah, so the important part is the abstract types. Arrow, incrementer, right, and so that picks.
Up all the operations from the abstract type. So. Right, yeah, it picks up all the. Right, and so here that's that same.
Parent type concept again, it's that same parent, which. Honestly, if it said parent types there, it will be clearer to me what the heck it was, don't you think? I mean, abstract types is just like. Well, I don't know what that. But parent type says it's going to get things it's going to inherit from this set of types, Don't you think? I mean, abstract types, like, I don't know why this is there, whereas parent types is like. Okay, it's inheriting a bunch of stuff.
I mean, the only one virtue. I'm not saying this is sufficient. It's clear that what comes here is always an abstract type.
Okay, but fine, but you can easily error if it isn't. Whereas if you see this code, it's just incomprehensible.
Yeah, it is a bit abstract like this.
Yeah.
I'm pushing for parent types there. Okay, let's continue though.
But it's pretty nice because I just need to declare a whole bunch of operations. I can just declare them once.
No, I get it. It is nice. It is nice. It is quite nice.
Yeah. Good, good. Right. And. But I could override them as well in by having an operation declaration would override the thing.
So for that type. Okay, hold on, hold on, hold on, hold on. Of increment. And there's the. What is the third argument versus the fourth argument? The third argument is the type signature of the operation declaration. That's the type.
It has like the type and the function with this sort of.
Wait, that's the third argument is the type, the fourth argument is the function.
No, no, there's no comma. It's an typed function.
It's a typed function. Yes.
Oh, I see. Wait a minute. So a typed function is like a typed lambda. Is a wrapper. Is a typed wrapper around the. Around the function. Is that correct?
Well, you can do it a few ways. You can write a typed wrapper around it. You can use typed on the arguments.
Okay, okay, that's what I remember.
This is nice because it gives a type to the output as well to the result.
Is there any other way to give it a type to the output? No, I see.
Otherwise the different syntax, you don't have to write it.
You don't always.
You don't have to write it in operator form. You, you can write it with just function. The first argument with the type as well.
I see, but, but otherwise, if I just gave the input types, the type inference system could in principle tell the type of the output.
It'll do that. Yes.
Okay. Okay. Onward.
Right. Well, that's. That's it. On the operations with this. This is sort of bringing things that we've been using into the sort of documented fold. And then I think we've been designing an initialized data structure function that would use. Excuse me, use these things and we could do.
Why isn't it data structure decoration.
Here?
No, no, no. Why isn't the name of the thing you want to.
Data structures. Right. I mean, right. I mean really data structures are just. They're just basically product types with a bunch of operations and with a constructor that's like what they are. But it's useful to have the compiled versions also, you know, just be product types. With operations and constructors. So I think that the consistent way of having it be the same between the compiler and in the top level is just that you basically write basic, the stuff that we just introduced in here to define all these operations and stuff in the compile then. And then you'll just have a function that just brings it, you know, automatically brings it to the, you know, to the top level.
Why isn't that called like create data structure? Oh no, maybe that suggests that you're creating one instance.
That's, that's.
That create data structure already exists.
Yeah, it already exists. Yes, it makes one instance.
And why is.
I'm not sure we know what the name of the function is.
We haven't totally finalize the name.
Okay, all right, okay.
But also declarations are different because declarations are kind of inert things that you give to the compiler. Like this is a thing that. Right. The actual workflow is not 100% clear yet, but it's either, you know, there's a top level function maybe that you pointed at a compiler environment and you know, the name of the thing and, and the exact type parameters it has and stuff. And, and then it will, you know, make it available to create data structure. Another version is, is that you do it inside of a compiled components that you can distribute it in a packlet. But there's some, you know. Yeah.
What's the relationship?
Not much.
What if you wanted to create a data structure whose implementation is in a foreign function where after all, you are using the same. For the foreign function interface, you're using the same types, you know, declaration structure as here?
Well, I mean, you would just do that by implementing your, you know, compiled function using, you know, foreign functions and then, you know, be happy.
I see, I see, I see.
Yeah.
So in other words, the, the only difference is the actual final implementation here inside that function would be a compiled. Would be a foreign function?
I think so, yes. Yeah.
Okay. Although this is relevant for potentially if one is, you know, setting up a link to some external library, ish thing that has some complicated structure in it that could become a data structure.
Yeah, yeah, absolutely. I think that would be a great usage of this. Yes.
Our node should be told about this. Okay, that's cool. All right. Create compiler environment.
Right, Fine. Okay. If I can find my mouse. Right. So I haven't written a whole lot in there, but the basic idea is at the moment, this is you can just do, you know, something like this, create a compiler environment. It has a target system option. That takes a single thing but we would extend that to make a compiler environment that contains a whole, you know, a whole bunch of different target systems. So. And the default be the same as the default. The default would be this.
I'm fairly thoroughly confused. Okay. The thing I was trying to do was to have function compile, produce the thing that I can then run across my parallel hydrogen.
And you can do that?
Prove it.
You do. Like I'm. This, this, this, this will make it better. But target system goes to automatic. You do this now. This is right. Oh, by the way, this is something else I fixed as well. So the progress bar, when you're doing one of these cross compiles, it tells you what, what you're doing. So that's. I've, I'm. I've been, I haven't finished this yet, but this is.
Why are there two copies of that?
Because, because it's like re entering the compiler in a way that's walking off a new.
All right, but you're dealing with.
I'm dealing with that, yes.
Okay, so one thing is that compiled code function, shouldn't that indicate that it works on all target systems immediately?
Maybe it could do. Actually, yes, I think it should.
Can you do information of the compiled code function? Does that do something? Yeah, that's, that's where it could say.
Yeah, but I think it should say on its face right there. I think, because it's an unusual thing and I think it should indicate portability. I mean, it reminds me a lot of where we say, you know, you generate a big, you know, a big object here, an audio or something like that, and it says, oh, this isn't stored in the file, just ephemeral to the session, so on. So here, similarly, the thing that you've created is sort of ephemeral to this type of computer.
Right?
Whereas. So, I mean, I almost think that we should consider maybe it's not a good idea. But I, I think for people who are doing serious code development, they're going to want to do the version just on their computers much of the time. But if it had one of those kind of raft like things that says, I mean, if you bring up. Just do a. Oh, I don't know what's an example? I just ran a piece of audio. Just generate or something.
I don't know how do I do that?
Audio capture.
Like that.
Open, close, hit it and now just press the red button and say hello or something.
Hello, hello, hello. Right, okay.
Hello, hello, Hello.
Yeah, okay, it worked. But what's that button on the bottom right oh, this one Right.
Now the data is in a file.
Yeah. Okay, so this one is not quite type. I was talking about. If you say, gosh, I don't know.
Data set, we try and look for the data not saved in notebook thing.
Yes.
The nearest of like random reel of bajillion numbers or something. Maybe not quite a bajillion, but.
You mean like this.
Yeah, comma, you know, 10 million or something. @ least. I know it might be too small.
But. Or just range of 10 to the.
6. Right. If you want the output size.
Limiter. No, we didn't want the output size limit. We want something slightly different.
Here.
This. Yeah, right. Okay, There we go. There you go. Okay. Right. Okay. So what I'm suggesting is that that compiled code function thing could indicate somehow that it is used in this. You know, it works for this computer, but it isn't. See what I'm saying? And it would give you an option to make a version that's.
Portable. So what would it. So anytime you compile with a target system that isn't automatic or all or whatever it is, it would come.
Up with a say saying that right there under signature it would say target system colon. And then whatever it is, intel, whatever the heck this.
Is.
Right. Whatever you're running on. Okay, second line there, target system, compiled code function, target system blah, which indicates that it is local to that. And then there might be a thing maybe, maybe right on that line. It could have one of those arrowy things of the kind that we had in that audio output that has a mouse over that says, you know, compile for other systems too, type.
Thing. And when you press it, what does it do? It modifies in place.
To. Well, whatever the other one does. Yeah, yes, the.
Same. But that's, that's a bit.
Different. It is a bit different. It is a bit different. This isn't quite right, I mean, in other words, but I think giving an indication that it is. I mean, because it really is specifically compiled for this type of computer. I mean look, it could be enough to just say target system blah and then a little information thing. And the information thing could say if you want it on all systems, use target.
System. That would be a good idea.
Yeah. I mean it feels a little bit low level to be saying, oh, it's for this particular type of system. But that is what's going on, isn't.
It? That is what's going on. Yeah. Why don't I talk to we. We talk about this and get some ideas from Noah for that to add Something. I think it seems like there's opportunities to.
Add. I think it's just put a second line that says target system and then whatever the heck target system is, and then I.
Button. Right.
Right. Okay. Now, are you going to go on and show me things about code annotation in place.
Or. Sorry, in what.
Sense? Well, I. I thought one of the big things, I thought the reason Noah was here was because you're also talking about, you know, if you have a piece of code that you're trying to compile that it generates markup about what's going.
On. If. If there's an error. We, we. Yeah, we, we did. We looked at that last time. We.
We. Okay.
Fine. Do you want to look at that again or. I. I think.
We. Well, is it. Did we. Did we sort of approve everything last.
Time? I think so. Yes. Yes.
Okay. Okay. Well, so, okay, then let's look at something about compiler information. I just would like to know if. How do I get compiler information on every function that is compilable? Well, okay. It's sufficient to do this. Just do compiler information. Slash at names.
Basically. Well, that would only. Well, okay.
Yeah. Right, right. Then you want to.
Do. I mean, the names is going to be strings. Does compiler information take a string argument? No. Oh, because it has to. I.
See. Because it has. Yes, I could do.
Yeah. This is actually kind of a complicated thing. Right, that's right. We talked about this. Because. Because the question is how it would do Wild.
Cards.
Right. If it doesn't support.
Strings. I mean, I can try.
This.
That's.
That. That's going to break things. I've done this.
Before. Yeah, it's going to break a bunch of stuff. So I. I mean, maybe warm language information will be a place to go. Can you try running that? Take. Can you try running the.
Right. But it seems. It does seem worth having some way of basically being able to ask it what functions are defined, including internal ones, like tell me about array back to get dimension, you know, how would I find that that function.
Exists? Well, I mean, one thing you could do is just compile information. Open, close. Could disgorge a huge.
Thing. I guess it could. Would it have to do like an association though, where it tells you these are the types I know, these are the functions I know. Et ceter.
Etc. It could do.
Yeah. Okay. Wolfram, Language data is what you.
Want.
Yes. I don't know exactly how to get some particular class of functions, but like mathematical functions or something. What's it.
Doing? There's some. You do Entity classes of Wolf language symbol. I think it will. Yeah, you can find.
Them. What the heck is it generating there? Oh, my gosh.
Okay. I think this returning something would be. Would be useful. So it could just return an.
Association of things that's going to just disgorge every piece of information it has. That's going to get very.
Unwieldy. Well, it's not everything it has. It's just a list of the things. It's the list of things that it knows about. So it wouldn't tell you. Here are the 10 type signatures for Mappo. Just tell you. I know about.
Map. Yes, well, look at System information. Open Close. By the way, there maybe should be a way to get. Maybe. I don't know if there should be a way to get from system information to stuff about the compiler environment and so on. Yeah, external compilers. What's.
That?
That's. That's about. You have Clang installed. That's for a create.
Library. Huh. Only we need an internal compiler as well. Okay, but this is a big GUI type thing, right. And the properties of this are the programmatic accessors. I'm just concerned that compiler Information. Open Close. It's a bit inconsistent to have it just have a list of names. Maybe not. Maybe.
Not. I mean, they could be. No, I mean, it's. It's.
Like. It's like all the entity functions, for example, do that. I mean, when you run Wolfram language data or country data, Open Close. It gives you a list of.
Entities. Yeah, fair.
Enough. Every.
Property. Fair enough. Like this is this. I think so, yeah, that would be useful. That would be.
Fine. But now, in functions, is it the case that every function that the compiler deals with. It's not going to be the case that every function the compiler deals with doesn't evaluate in its pure symbol form. Right. They're going to be functions like. I don't know. Now, for example, that without any.
Arguments right now, there's nothing like that really in the compiler. I mean, there might be functions that have a name that is also defined in the top level, if that's what you mean. Yeah, actually, sorry, what are the attributes of function declaration? It's not hold first, is.
It? No, it shouldn't be. Really shouldn't.
Be. So can you check? But I. I think it's not hold first, but. Okay.
But. So if there's some symbol, like now, for example, how would.
You. Well, well, sorry, that would. Yeah, I mean, now is not a function, you.
See. So it's got an own value instead of A down value, I think, I think right now those are not really supported in the compiler. To support them, I think there'd be a different type of.
Declaration. I see.
Okay. And then when we return them from this association or whatever will have some way, you know, like you have them as strings, you have them probably hold or something like we're going to need some way of inertly moving these things around anyway.
So. Yeah, I don't know if you should call them atoms. You definitely shouldn't call them that. I mean, symbols basically, you know, symbols with values, but just symbols probably.
Enough. Well, we don't have to pick.
That yet, but yeah, right, like values, customers valued.
Symbols. Well, exactly.
Yeah. Okay. All right, so just to give me a sense in terms of the advance of sort of what is compilable? Do we have a sense of how that has been progressing? And now that you have everything programmatic here, it should be very easy to make a scoreboard of what, what's there. I mean like fold, pair, list wasn't.
Compilable. No.
No. So my question would be functions that are basically, you know, they're big domains like graphs, for example, which are not yet compilable. Right, that'd be nice if they were. But you know, lists, strings, numbers, things that fundamentally deal with those kinds of things. Are those mostly compilable now or.
Not? Well, the types are compilable. Well, numbers and PAC2A type things. We've got pretty good.
Support. Okay, but in the end, ndsolve is not compilable. No, no, but okay, here's a, here's a general question. Okay, so for example, I was writing some code that involves the cellular automaton function. Okay. That function is perfectly efficient. There's no point in compiling. You know what, it doesn't really mean much to compile it, but there's glue code around it that I would like to compile. So I mean, you know, saying we can compile the cellular automaton function is kind of irrelevant. And that's exactly the kernel function concept, is it.
Not? Right. So you could call a Solar Automata thing and. Yes.
Right. So why not provide for cellular automaton a quotes compilable version of cellular automaton that merely whose implementation in your, in your whole implementation thing just says kernel.
Function. Right? So I mean the. Yeah, I mean that's something I think that we've talked about doing. I mean the main, the main thing that makes it a little non trivial is that a lot of those functions have have there's complicated type design. I mean which I guess sort of has to happen at some point anyway. But it's not.
Trivial. Well, but, but look, look. I mean worst cases, like for cellular automaton there's a bunch of use case. There are some cases where they're complicated types of. But most of the cases they're not complicated.
Types.
Yes. Are you sure about that? Yeah, most automata. My guess is that there are some cases where there are some weird types. Like even the second argument, right? Like it's either it's a pair of a list and I agree, I agree it's slightly.
Complicated. Okay, here's my question. My question by human or by LLM, try and make type declarations from the documentation. Is that crazy? I mean if you make type declaration documentation and then you run the tests on them, you're going to get, you know, 90% I.
Suspect. Right. I mean the main thing is minus any of the remotely harder cases like I remember, like I did a thing of looking at graphs, right. Which is I think one of the harder cases.
Honestly.
Yeah. And there are all kinds of hard design decisions about like, you know, what's the edge type? Right. Do you have one edge type or two? One for direct and undirected edges. Do you, you know, what's the type of a. Of a edge list? Does it return, you know, are. Are graphs parameterized by whether they're directed or.
Not? That's a difficult case. I was saying things that are basically numbers to numbers, lists, strings, those kinds of things. I mean like another example would be. I mean there are many functions, you know, I don't know, letter counts or something that there's no point in making a, you know. Re implementing letter counts. It's completely crazy to do that. But one does want it to be the case that when it is a, you know, a mega function internally that it be able to be have glue code put around it efficiently. Like I'll give you an example typical example I was just doing. I'm using the cellular automaton function, but I want to check that. I want to take the output and I want to find out I don't know what the maximum width of the pattern is as a function, you know, throughout the output from the cellular.
Automaton.
Right? Okay. That, that second piece is something I can quite easily write as compilable code. I mean actually it isn't terribly inefficient in to just do it with list operations as top level. But it would be nice to have something where the Whole thing is just calling the very efficient internal cellular automaton function together with wrapping glue code that is compiled. I just think we should go through and do a big effort to take functions, you know, because what you've been concentrating on for the last how many years is functions where it makes sense to do an implementation of the function in the compiler. You see what I'm.
Saying?
Yes. Right. So I'm saying you've got to pivot to taking all these functions where that, that doesn't make any sense. There's no point in doing that. Where purely the wrapping allows them to interface with the compiled, with compiled.
Code.
Yeah. Does that make.
Sense? It's not totally clear how to make the wrapping though, in, in all these.
Cases. I don't care about all these cases. We've got thousands of functions. If we do it for a thousand functions, we'll already be.
Ahead. Yeah. So maybe we should, we should try, you know, we'll pick, we'll pick 100 random functions or something and see what fraction of them are, are basically.
Trivial. Yeah. I mean, pick the ones based on their usage statistics and so on. But, but yes, or, or even just ones that are trivial because, you know, I think.
Right. I don't know, I, I, I think it's not obvious to me what proportion of them are actually.
Trivial. Okay, but, but let me make another point. If you get, let's look at the case for Celia Automaton. Let's say that you got its primary use cases, four of them or something, and you nailed those. Okay. What would.
Happen?
Right. What's.
That? Well, this particular one here could be.
Done. Yeah, right. But I mean, the first argument can be a list, it can be a list with sub lists, et cetera. It has a signature. Okay. That signature is not super difficult to, if you go to the details and options. Okay, so there you see up there that first thing, there are a few cases there that are quite tricky, but most of them are rather straightforward. Those are each, you know, different signatures and they just need to be covered because so long as you can get the thing with that signature into the cellular automaton function, you're in good shape as long as you know what that signature is. And I just don't think it's super difficult to write either a top level pattern or a type declaration that captures most of those.
Signatures. Well, at least right now, many of those. Yeah, I mean some of those signatures are not super easy right now. But that's, that's partly because there are things that are kind of Missing from the type system. But that, that's a different.
Issue. Right. Rules, for example, can you deal with rules in the type.
System? Rules are.
Fine. Rules are.
Fine. Rules are fine. Associations are harder and inhomogeneous lists are.
Harder. Okay, all right, well, but those are things that are needed. Probably. But, but be that as it.
May, I mean, are also harder. Symbols are also hard, yet harder. But, but, but, you know, there aren't any.
Here. But yeah.
Okay. A lot of functions take.
Symbols. Right, But I think my point. Let's just walk through the following thing. Let's say you covered of all those cases of which there were a dozen or something. Let's say you covered five of them. Okay. And somebody gives a case that isn't covered. So long as we can give a reasonable error message, I think we're in fine.
Shape. Yeah, message would look like the error message would look like.
This. Let's do 30, comma, whatever. It is a valid.
Thing. A valid thing. Well, that's, that's not supported. But that, that, that, that could.
Be. I mean, if you just run that, you'll see roughly what it looks.
Like. Show.
Me.
Yeah, That's fine. That, that's valid. That's valid. Doesn't matter. That's.
Valid. So you get a message like that and the error marks it up like.
That. What the heck is that.
Comma. You're missing a comma in the.
Input. Where am I? Oh, I am missing 30. Right. Yeah. Excuse.
Me, where did I have to. I don't understand why I had to go there. And then I got that weird gray.
Box. Which gray box are you talking.
About? The big gray box there, the big blob of.
Gray. Well, that's showing.
Top, that's the top of the pop out.
Thing. Right. Okay, but hold on, hold on, hold on, hold on, hold on. The fact that I have to know to go to that weird dot, dot do thing.
Yeah. Yes, yes. When Lou tells me that he hopes sometime to have a button.
Here. What's the sometime that's been.
Merged? Oh, that. Fine. Okay, then that's been merged. And actually I need to add some more keys to remove those, the, the sort of the, those gray boxes because there's another one at the.
Bottom. Right.
Right. So that, yeah, that's.
All. That's either in or.
Coming. So. Right, fine. So that, that, that, that would all be.
Good. Okay, so then all it's going to do is if it says. I mean, it's got to change that failure message to be this particular signature of cellular automata. Doesn't.
Supported. Yeah, well, it would do that if there was one of them then. Yes, that's.
Right. I think the point is it gives this message because nothing is.
Supported.
Exactly. Yes, that's.
Fine. But, but, so I really, really, really think it's time to go through and just do the obvious type signatures of lots of functions. Okay. And then it's a work of many years probably to get all the type signatures of all the functions, but just, you know, pick the low hanging fruit. See what I'm.
Saying? Sure.
Yes. I, I mean I've been saying this for like five years. I think now it's really time. Do you.
Agree? Sure. Yes, yes. I'm, I'm still unclear just quite how far we can go with, with this, but find.
Out. I mean, look, go to the root guide page for a second. Okay. Go to symbolic and numeric computation. That's in the orange at the.
Top. Right?
Okay. Okay. So go to, I don't know, mathematical functions, for example. Okay. I reckon you should be able to do all of these. They're all.
Straightforward. So I think everything we've.
Got.
Okay. I would say nearly all of these.
Are. Okay, so oil of phi. Prove it to me. Put in the function compiler, just say oilify of something or.
Other. Right. Let's have a look. No, but, but, but, but, but, but that, that, that, that could, I mean that's, there's a mechanism for that. So I, I, that's, that's a reasonable thing to go through that page, make sure everything's there. Some of these things are a.
Bit, you know, Fox H might be harder too. I don't.
Know.
Right. Actually, no, it's just a matrix. Right. Give it a matrix and a input. So actually we could probably do that. What does that, does that return? Packed. Packed.
Array. I think it's going to return a packed array.
Yes. Rank two packed.
Array. Sorry, sorry sir. Was, did oilify work? I wasn't paying.
Attention. No.
No.
Oil. If I did not work, that's really.
Disappointing. Well, fine. Okay. I. Going through this page seems like a good.
Idea. Well, not just that page. I mean, I mean we, we just need to go through all the low hanging fruit. Right. Of which there's a lot and we should just go through in WOL and language data. We should just look because it has a bunch of signatures in it. Right? Yes. How could it take this long to to. Okay.
So it might be having, I'm not quite sure why. Oh, it's making a list better. That's.
Why does it.
Work? Of integer 128. Okay. It's very ambitious of it.
Yeah. I mean that's slightly boring. I didn't give.
A. Okay, okay, you didn't give an argument.
But. Oh, that's why it's doing list vector. Because it wants to do an integer 128 which packed arrays don't.
Support. I think it's. Yeah.
Right. So big number.
Like.
Wow.
Okay.
Okay. What was I going to say? I mean I, I'm really strongly want to push for this to get done. Sorry. Look, look at woven language data. I'm pretty sure it has this, this.
Thing. So what do.
I. The thing where you can get the frequency of.
The.
Yeah. Signature. Or, or it has, it has the usage lines, if that's what you.
Mean. No, but I think it has the more programmatic version of it. I think it has a more programmatic.
Version. Can I do. How do I get one element out. So that it doesn't have a.
Search? You can just do entity of Wolfram language symbol comma, you know, quotes, oil or fires. That's what you.
Want. Entity of. What was.
That? Wolfram language symbol, quotes Euler Phi language.
Symbol. Well, it's quotes around that. But anyway, I, I have to.
Go. But, but, but I'm looking at the, the, the, the, all the properties though. I don't see one for like a programmatic. There's just, there's the usage.
Line. Ask Michael, because I, I think we've, we've, you know, I'm pretty sure that we have been doing this. I don't even know for LLM purposes. I think we have some stuff like this too. I think we can do a fair amount of this somewhat automatically and then curate.
It. Well, if there are types for these things, that's super.
Useful. Right, Right. I mean it's time to really do this project. It's five years overhang, but it's time to really do it and it will be transformative in terms of the usage of the compiler. And I have to run here. Okay, but this is lots of great stuff, but for goodness sake do this project of, of just going through and getting the low hanging.
Fruit.
Okay. All right. Excellent. Well.
Done.
Okay. Very nice.
Stuff. Okay.
Everyone. Okay.
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






