visX: a Block-Based Frontend to Wolfram Language

Nicholas Hoff demos 3Code, a block-based interface for Wolfram Language where each visual block maps to a function. Blocks convert to code and English, nest into zoomable subgraphs, and connect to Wolfram's knowledge base. The early beta includes LLM-assisted input and live plotting.
Chapters
Hi everyone. Welcome to the Academic Innovation Support live stream at Warfarin Research. I am Yi. I am the Academic Innovation Programs Manager here. Let's welcome our guest today, Nicholas Hoff. Nick. Hi.
Hello.
Nick is from Berlin, right?
Oh, I'm from Boston, but I live in Berlin.
Oh, you live in Berlin currently. Okay, so Nick is the founder of New Approach Technologies. The flagship product is 3 code, formerly known as withx. It's a block based programming language used as an interface of Mathematica. So I will let Nick introduce his background and experience a bit. And now we know he's from Boston but currently leaving Berlin.
Well, thanks for having me. It's fun to be here and a pleasure to talk to everyone. Well, my background, I, I studied aerospace engineering in undergrad. Then I did a PhD in AI. Then I moved to Berlin with my, with my wife, she's German. And then I started New Approach Technologies, which originally was a freelancing organization because I had been doing AI in my PhD and kind of missed doing it. So I did AI and machine learning, data science for clients. I did that for a while. And then this idea of block based programming for Wolfram language is something I'd been toying with for years. I always wish it existed. So then I thought, okay, let's actually dive in and make that happen. Finally. I'd been kind of hacking on and on and off for a long time. So then I just put my nose down for a while and finally built three code out to something that works. And yeah, that's where we are now.
As we're talking about 3Code, formerly VisX. If people have seen this project before, you mentioned that it's something you've been thinking about for a long time. A lot of people when they hear block based coding, they immediately recognize, oh, this has a lot of really great education applications. Was this something that you thought of as like a convenience thing for yourself? Like so that you could sort of learn the structure of the code or you know, what, what was the thing that gave you the idea that this is something that you wanted to explore?
Well, when we think about programming, we, we usually think of, of little units of functionality. Like we talk about functions taking an argument and giving a result and you say take sine and give it to plot. And we use language like this and we have mental models like this of inputs and outputs and functions consist of other functions. And it just felt natural to me to think of code in this block based input output format and why don't we put this on the screen and make it real. I am not the first person to have the idea of visual block based kind of programming. It's been done 100 times before. And beyond being a cool idea, you ask what would I use it for? And I think one of the problems that I had seen with a lot of visual programming environments in the past, why I never really, I never really used them that much. They're Simulink from Mathematica. There's a, there are a bunch of them and they're, they're neat. And I found that the, the really simple examples in these visual programming languages look neat and you think, oh, that's great. But then to do any real work, it turns into spaghetti code right away, like literal spaghetti code on your screen. And it's just totally obscure and you know, can't understand make sense of it. And I thought, well, we should make this better. We should make this really actually work. Something that isn't just a neat toy for one plus one, but can do real work. And I think that I was thinking about this when I was a student not because I thought education would be the biggest market for it, but because I just wanted it to exist. But now in retrospect, I actually think that education is a pretty good application area for visual programming. For visual programming, it's not the only one. I think there are a couple others. But one of the general principles that I try to follow is I don't want to force people like I'm the primary, like I'm the primary user. I don't want to force myself to only use blocks. You must use only blocks and links. It's going to be terrible and stifling. Sometimes you really just want to write some code. It's the best way to express your computation. And that's true whether you're a student or whether you're Steaden Wolfram himself. Sometimes you want to write code, sometimes you want blocks, and sometimes you just want to write out a sentence to describe the code. So I wanted to make it non restrictive. You shouldn't just have to do blocks, you should be able to do whatever you want.
That's a very interesting design principle. One of the things that you just mentioned was other areas where it might make sense to do blocks. And so one of the things, I'm curious to talk to you later your thoughts about how one might incorporate this into workflows that involve either machine learning models or more specifically large language models. Because there's a lot of interesting things and quite intricate flows that you can come up with. For how you want to take data that's the context of a conversation and then feed in different prompts at different points so that you can do more interesting workflows. So maybe we can talk about that later. But if it's all right with you, why don't we have you show us real quick what does three code look like currently?
All right, I'll share my screen. There we go. Tell me when you can see it. Looks good, huh? All right, well, here's the basic interface. It's pretty empty. I know I said this isn't going to work very well for. For really simple things and that, you know, it always looks good at first, but I'm just going to do a kind of a basic example of plotting a sine function just so you get the basic idea. All of the. Not all, but many of the functions in the Wolfram language are kind of are over here in the library. So we want to plot sine of X. So first we need sine. And here, here on the diagram is where you're going to put all your blocks. Where is sine. Mathematical functions? Here? All the. Here they all are. And tell me if I go past it. I probably went past it.
Looks like I just saw it there. Yeah, right.
Okay, so now sine needs an input. So I'll type X in there and we get sine of X. And now we want to have. We want to plot that. So functions are represented as blocks in the Wolfram language. Every block on the screen represents a Wolfram language function. It takes some input, in this case X, and produces some output. And so we want to wire the output of sign into the plot function, whereas plot visualization and graphics function. Visualization. Plot right there. And if you, you know, if you can't remember what arguments these take, you know, you can look over here and it will tell you, oh, there's the brief documentation for plot. But we know how plot works, so we wire this in there. And now you also need to tell it which variable and the limits of the plot. So that would be the second argument to plot. And I'm just going to type in here x02. I like that. And so, as you can see, this is just Wolfram language code. This is the Wolfram language code of these blocks up here. Plot sin x02pi. And here's an English description of what it's doing. The last thing we need to do is go up here and get a result block, because otherwise you won't be able to see anything. I'll wire that in and just make it a bit bigger so we can see what's happening. Now I'm going to press this little CPU looking button up here and something just happened. Can you still see the screen?
Yep. So far so good.
Weird. Okay. Did it freeze? It looks like it froze. Oh, no, it's okay. Well, why didn't it evaluate. Evaluate what's going on?
This is the fun part of doing live demos is that almost invariably when I'm doing something live. There we go.
Oh, it's a zoom problem. I was clicking on a zoom button. It was zoom buttons over. Okay. Anyway. Okay, so now you get the idea. This is the basic idea. Every block is representable from language function. It takes inputs on the left, produces outputs on the right. You can wire them up and get outputs and see the results of your computation if there's lots of neat things you can do if you want to. So as you can probably tell, building up any computation that has more than two or three blocks would get really tedious really fast if you have to find every block out here in the library somewhere. Where is this thing? It would take forever. It's usually a lot easier to just type in some Wolfram language code you want to start with down here. So if I type something in here like that, it will decompile this thing back out into blocks and then recompile it back and describe it. So you can go from code to blocks or blocks to code. And if I wanted, I could type some English thing in here. What is the. Make a font. We'll see what happens.
While we're waiting for that part to go. Oh, cool.
Sometimes. Oh, see, look, here's the Wolfram language code it produced. Oh, it's defining a new function for Integroid. I don't know why I was doing that. And then making a very detailed plot. Okay. But anyway, you got the idea.
One of the questions I was going to ask, I'm assuming the natural language part on the right that led to redefining a function for. This involves large language models at some point. Am I correct in that guess?
That's right. That's right. Yep.
Yeah.
That'S quite interesting. Okay, so the typing in the natural language part on the right and getting the natural language parts back. Is that something that you envision as being part of what the beta test experience also is. Maybe now we should mention, if you're in the audience, we'll probably mention this a few times and you would like to, you know, roll your sleeves up and experiment with. With 3 code. Do please feel free to. To reach out directly to Nick and we can make sure that the contact information makes its way into the description of the. The permanent home of this video. But so just a question about that. So the LLM part is also integrated as part of the. The beta tests. Is that correct?
That's correct.
That's great.
Yeah. I'll add my two cents to that. First of all, how's the sound quality? Can you hear me okay?
We can. We're getting the occasional artifact, but overall we can hear you. Yes.
Okay. Yeah, I'm having. It's a bit weird. I'm having trouble. Some trouble hearing you too, but I can understand you, right? Yes. As John said, beta testers are welcome to reach out. If you want to try it, email me nhoffrico IO That'll be in the description below too. I'm gonna. I will ask for your feedback and I will want to know what you think about the software. I would like to ideally talk to you or somehow chat with you about what you think. I want your feedback. Detailed feedback. Okay. I hope the idea is clear. There are many more little features to make things easier to use. Maybe we'll discover those as we move on. What. How should we proceed?
Yeah, so you had mentioned doing a. So I've not gotten a chance to play around with this yet. So we could do this. You also have a couple of examples. Shall we do the exploration part first and then get into some of the examples that you were also wanting to show?
Sure, yeah.
Let's do it.
I have offered you control of. There you go. All right.
John is controlling Nick's desktop, the screen. So John is typing.
So let's say that. Say I'm an instructor, right. So I want to show how a Riemann sum can be used to approximate the integral. Let's just do a. As you say, substitute any function you want here, but just to keep the example manageable. Size. So on the interval, say 0 to PI. Something like this. Right. So I'm instantly intrigued by this ability for language models to come up with this. So let's. I'm curious, what would I do in order to get the language model now to take a stab here?
Control, enter.
All right, so let's try that.
Now this is a early beta product, so one of the problems is that there is no feedback to the user of when it's working. So you just have to wait and. There we go. Sorry. Okay, there we go. Now it will put some comments in there. So if you zoom out, just mouse wheel back A little one step. And if you drag up to the right, it will put some comments up there.
Oh, I see up here. This might be a. This might be a. Oh, here we go.
All right.
Yeah, we had a zoom. Zoom thing there. Okay, so this is very cool. So let me see if I can get the zoom correct here so that we can see. So these comments are added by the language model.
That's right.
Neat. So then. All right, so then if we take a look at the code, let's say that and some. So let's say that someone has this as a working example. What would be the recommended way for them to say? All right, so rather than using cosine, let's use some other function here. So I can think of a couple ways. So maybe we would say let's find specifically here in the block where is a function that we specified. I also see that there's a function here that is where we specified it. So what would be your recommendation here? What would be the easiest user experience?
Right. So there are two things to say here. First of all, sometimes it happens that you. You type something into the language model and it kind of vomits blocks into your screen, as happened here. In this case, we have not added anything to the clarity of the computation. We need to clean this up. And there are some ways to do that. But I want to, rather than talking about cleaning the diagram, just trust me for a moment that there are ways to clean it up. For now, let's move on to the actual content of what you want to do, which is that cosine function there. So you see it defined F of X equals cosine of X. That. So you see the F and the. The top row of blocks. The one just to the left of. Sorry, just to the right of slot is F. Right. So zoom into that F thing, the block that says F. Put your mouse over F and mouse wheel up.
Yeah, I think the. There's a delay here between what's on the zoom control. If we get too much of a delay, we might have to talk you through this part of it because it doesn't seem to be scrolling here.
Oh, it's a long delay.
Yeah. I think this is an artifact of the Internet connection here at the moment.
Okay, so go to that F and zoom into the F. Right here. Yeah, just zoom into F. Oh, yeah. Well, okay, this is not a great example, but see that little additional canvas inside the F?
I see. Yeah. So this. What we're getting at here is that you can have subgraphs, sort of hidden because it's how one would define some larger piece of the block. Is that more or less the idea?
Yeah, yeah, that's right. F is the block that contains other blocks. In this case, it's really simple, but, man, this is drawn pretty badly. I'm already taking bug reports.
Well, this is a cool reason to explore it. All right, so, yeah, so let's say that I want to now make this sine or something like this zoom in.
A bit more so you can actually see it. Just zoom in a little and you can change the cosine to a sine pretty easily.
If we. Yeah, there's a quite a bit delay that I guarantee has been caused by the zoom and Internet connection here. Again, shall we? Let's maybe have you do this part locally and then we can switch back over and I can do some more exploring because I think that will remove the delay.
Yeah, okay. All right, we'll switch back. So I'll stop the.
Remote control.
Remote control stop. Share. Can't do anything, actually.
How about now?
Ah, there we go. Oh, I stopped the entire share. That's not what I meant to do. Let me go back. Okay. Okay. First I'm just going to make this a little bigger so we can actually see something that's going on. Okay. So inside the. If we have this cosine function there and inside of it, you can, you know, I could wire this together like that if I wanted. I could just wire them and then to change that to sine, I'd shift, click the cosine and put in sign.
And then we get. So you can see if you're following along in the audience right now. So the. The very first thing in the code was the definition for F. And so this has just been changed first graphically. And then it looks like we got.
The.
Input form of the code on the left box there. And then on the right we have the language model summary of that, which is. So that's all quite cool. It's in one nice little package.
Maybe it would make more sense if I go through some of the examples just to show some more about how this works. And then once you understand a bit more about how it works, then you can play around because otherwise it's. It's. You're not going to understand it. And that, you know, it would just be a better use of time, I think.
Sure. Take it away.
All right, I'll go on to. This is the slightly more complicated again, we have to wait with no user feedback version of the block of the diagram. I was Showing earlier, we take cosine and I just want to integrate cosine and I want to plot the integral of cosine and the cosine itself. Evaluate that. Yeah. Again, one of the things that when it compiles the blocks to Wolfram language code, whenever it needs to create a variable, it creates it in this weird way like that. That's just an artifact of the way I've done the compiler right now. So I'll have to change that. And it confuses the language from level two. But anyway, you get the idea. One interesting, neat feature of being able to see computation as blocks is to be able to look at intermediate results like this. It sometimes happens that you're writing Wolfram language code and there's a big nested expression and you want to see the value of some bit in the inside of it. And the only way to do that is to either bring it out, name it a variable and then see the result, or make some large pure function expression or make some extensive use of reap. And so, and this is a problem I often have, and I think this is a better way to see intermediate results. Okay, okay. So this is the basic idea. Now we'll go through a little more complex example. The idea with this example is you want to calculate the digits of PI and you want to calculate how many of each digit are in the first hundred digits of PI. That's all. It's just that. So the Wolf language code just to calculate the digits of PI would be something like this. You take n, PI 1000 and real digits, part 1. So already when you look at code like this, you kind of parse it out and you figure out PI is going into N, N is going into real digits. And I want the first part of the output. So here's the blocks for that. Let me evaluate so I can actually have something to look at. And we will get the first hundred digits of PI there. Now. We want to see how many of each digit, meaning the digits 0 to 9, are in that list. The way you would do that in text based Wolfram language code is to say count PI digits. You could say count PI digits 0. That would tell you the number of zeros in that list. But we want to do it for all the digits, not just zero. So what you do in Wolfram language code is to make a pure function like this and map it over the range 0 to 9. The way you do that in 3 code is here's the range 0 to 9 and we want count digits of slot here except If I change. See this input port, it doesn't really look like an arrow. What this thing means is that the input, this function is mapped over the input. So this is like saying count high digits of whatever and map that over the range. So now we have the number of zeros, the number of one, the number of twos. Mapping is such a common operation that I just made some visual sugar for it. Again with the idea of hoping to save some blocks. I want to have as few blocks on the screen as possible. Now we want to make a plot. We'll make a plot of how many zeros there are. Sorry, how many ones there are, how many twos, etc. But I'm sorry, so here's my little explanation of that. The first digit there are 93. There are 93 zeros, 116 ones. But if you give this the list plot directly, it will assume that's the number of ones, not the number of zeros. So the solution in regular Wolfram language code is to say, no problem, I'll just make a list. I'll take zero to nine. And the first element of the output list will be the digit, and the second element of the output list will be the number of that digits in five digits. This is a more common and also more complex use of map. You want to take some kind of pure function like this, map it over the range. So what I'll do here is define a new function countwithdigit. And so it takes this function, countwithdigit, it has its own canvas on there. And it just takes. This is a function that actually you can see it compiled right here. Countwithdigit takes one digit, one argument called digit as an input, and it counts that number in PI digits and just assembles that into the list. It is just this thing here represented as blocks. And I map that over the range and give it to list plot.
So as a quick question, is that the typical design, right, that when you have a definition, then you can zoom in and see how the definition is defined in terms of your function. Is that more or less what people should expect when they're defining their own functions?
Yeah, yeah, you can decide. You can. I could change the input signature here if I want. I can go see what the Wolfen language code for this thing is or the English language description of this thing in these different tabs over here. And I can go back to the blocks over here and I can, you know, change it however we want. And it's just, again, it's just Wolfram language code. So if I wanted to add some other argument here, count with digit. I can say digit has to be an integer. So I could integer like this as you would in a definition, x real or whatever. Whoa, sorry. Something like that. And now I've got, you know, two inputs. So just Wolfen language code. Right. Okay, so I think we get the basic idea. You can usually what you might want to do at this point is say, okay, so now I know how it looks with that was I think 1000 digits of PI and now let's see what happens if I change it just 100 or a million digits of PI. So now what I've done is this whole block, everything we've done up until now, I put inside another block. This is called pytard takes length of PI meaning how many digits. The first thing it does is run it through those blocks before to calculate PI digits. And then it does my countwithdigit function in here, which we can zoom into again if we want and gives it to Lispot. This is so slow. And then I take that whole thing and map that over 100, 1000 and a million and get all my plus here.
So you mentioned that this is something that you can use for mapping out different kinds of workflows. So with the ability to zoom in and see how various sub blocks are defined in terms of other functions and things, I can definitely imagine. So you sketch out something that you want to accomplish and maybe these are all in terms of functions that you imagine you're going to have to implement. Maybe it turns out some of them there's a built in function for. But if it's some workflow that you want to have very specific functions involved that aren't yet built in functions, I could imagine mapping this out in blocks where you know, initially none of the, you know, how would you say definitions exist and then you can zoom into each one and implement each of those sub blocks. Is that how you imagine people would, would use the ability to take some piece of code and wrap it nicely so that you can understand where it fits into the larger hole like you can do visually here?
Yeah, I think that's a common way to do it. I think that's a common way to do it. When you're writing text based code too, you say exactly some function that needs to do this thing, I'll name it, I know what its inputs should be. I don't really know how it should work yet, but just, just stub it out and then there's a couple more. And now I know how they should be wired up and so I'll write that and then later on I'll go back and fill in the implementations or I'll have a language model fill in the implementations. Right, yeah. One of the general principles is that visual programming is just programming, and the same way you do it in text, you should be able to do it in blocks too, but easier.
That's a good design principle. Thanks for sharing that insight.
How much time do we have? I have more examples to go through and.
Yeah, we have plenty. So please. Yeah, why don't we take a look at some other examples before getting back into the more exploratory part. And also, if you're in the audience and you have specific questions, do remember, put them into the chat so that we can make sure that Nick sees them, is able to answer them. We also do have one question already. Let's see. So we have someone who is curious about feedback. Maybe if you could perhaps rephrase the question slightly. So the exact question was it's a live preview of the code in the form of a visual that also contains feedback. So I'm not quite sure what the user is meaning by feedback here, but.
Yeah, so I think I understand. I think I understand. Let me. Oh, this is. Let me just blow this slide. This is gross. So I think what the questioner is getting at is what if you. If you draw something, What if you do something like this?
Oh, sure.
Yeah. So this is not allowed. The reason is that it's not clear what. What is the Wolfram language code that this would represent? What. What even would that mean? I think I. I can't really talk to the question right now, but I assume that's kind of what they're. What they're thinking about. This. I understand what this means. I hope I just didn't crash my compiler. Oh, sorry. I guess I. Well, plus doesn't work. I guess I really need to do this. This one plus one plus one. So it's clear what this means. But now if I take a link and I come out of here and I try to put it back in here, there is no Wolfram language code that represents that diagram because it really doesn't mean anything. I want to take the output and make it an input that doesn't mean anything. And so I have a check in the compiler to make sure that you can't do feedback like that. Not because I just don't. I don't understand what that would mean. There's no Wolf language code. That would be the Representation of that, of those, of those connections. I hope that's what the question I was asking.
Sure, yeah, that's. I'm sure someone was having that question, even if that wasn't precisely what the specific one was. So if you, if you are in the chat, still definitely let us know if that was the specific question that you had. And thanks for asking. So. Yes. All right, so let's take a look at some of the other examples.
Okay. Wait for it to load. Okay, so here, I don't, I don't know how much Wolfram language the audience is familiar with. There are some times when you want to use a function like this as an argument to a function to another function, the functions of first class citizens. So you want to select all the numbers in this list that are even. You select and then use it. This Even queue. And even. Even queue. Let me evaluate this. Uh. Oh yeah, that's a, that's a bug on my part. Even Q in Wolf language is a function that takes a number and returns true or false, depending on whether that thing is even. So if we want to select from this list the ones that are even, you can't take this output of even Q and put it in there because this is going to be true or false. You want to take the whole function itself as the input to select. So that's, that's why you. That's when you would bring a link out at the bottom. So the links coming out the bottom of blocks mean take the entire function itself, not some output of the function. Now usually it's not just as simple as that. If I want to select all the ones that are greater than two, then in Wolfram language code, you'd write a very simple pure function like this, greater than 2. And the way you would do that in blocks is just this. Anytime you leave an input unspecified in 3 code and pull a block out the bottom, it essentially creates a pure function where this is. Now what comes out the bottom is an argument of, as a function of one argument only, the unspecified argument. And it basically creates this. The nice visual way to do it. I've gone through and I've tried to create visual sugar for commonly used Wolf language constructs to avoid having to put too many blocks on the screen. Well, let's do one more. There are some others, but we'll just move to this one. This is an example using the amazing Wolfram knowledge base. This is where I say I want to find flights that went from Boston to San Francisco yesterday. How many of them were there? And Then I just wanted see them and I want to plot the altitude of one of them. So here are all the flights, three JetBlue flights. And we'll take the first one of those and get this is entity property. This is the entity system in the Wolfram language. And I want to get the recorded altitude of that flight and give it to dateless plot with plotrangeal. And here's the altitude of the flight over time. Yeah, that's basically it. I think you get the idea. It's Wolfram language visualized as blocks and editable in blocks code or English and connect them up however you want.
That's awesome. So perhaps we can go back to the screen controlling version. But I'm a little bit worried about the amount of delay that was there with the way that we're doing the recording and streaming. So let's maybe if you don't mind, we could talk you through something that we want to explore and maybe the screen control could be done partly locally and maybe we can also do it the other way too, a little bit. And so again, reminder, if you're in the audience, feel free to put questions. So we all have a thank you very much. Which yes, again, Nick, thank you very much for being here and showing us this. So one thing that let's say that we want to go into the knowledge base and find something related to a trefoil knot. So what would, so how, how would you recommend getting started looking at something in the knowledge base? Would it be on the, on the left with the menus to navigate there? Or are there other shortcuts that you'd recommend for just going and immediately grabbing something from the knowledge base?
I'm. I'm really having trouble understanding you. Your question's about the knowledge base, but I didn't hear what, what you're interested in looking up. There's. Okay, I think, I think I understood that you're asking about whether the knowledge base can be. Is available in the library over here. And generally it is. There's all the, you know, related functions and you can go through here. This is essentially the, the Wolfram language reference, engineering, data, whatever system model, physical constants and everything you can access entity value, of course. Or here's all the. Here's everything with entity. All the knowledge base related functions. I usually find it.
Yeah. What if we wanted to do a smart input as well? Perhaps that was about what you were going to mention.
So are you, are you looking for an example involving the knowledge base?
Yeah. So specifically, like, let's say if I was in a notebook environment and I wanted to find something related to this mathematical object called a trefoil knot. I might use either enter or double enter and then just type in trefoilnot if I was in the usual notebook interface. So what would be the equivalent way of doing that with blockbase?
I'm sorry, I can't understand what you're saying. The sound is so difficult. I'm gonna have to stop sharing. It was better when I wasn't sharing.
Another thing that we sometimes recommend is that perhaps if you're going to share, turning off the regular camera can also help as well.
That's a good idea. Let me try that. Yeah. Now, since I stopped my share, I can hear you. Great. Okay, let me try again. Let me try sharing that. And I'll try turning off my camera. How do I do that? Stop video.
Okay, how's this? Can you hear us?
Oh, the audio is brilliant. I just had to turn off my own camera. All right, good. Known for next time. Now, I also saw you. You typed in the. In the chat. Trefoil or not? No. Now that I can hear you, what do you want to know?
So I was curious about. So if I wanted to find the trefoil not. Let's say that I figured that was somewhere in the knowledge base, but I didn't necessarily know what the specific entity name was. So in a notebook interface, I might use either enter or double enter to get a smart input or talk to wolframalpha and then just type trepoil not. So what would be the equivalent of doing that? Here.
We. I don't have nice visual sugar for this, but you can always just use semantic interpretation.
Okay.
Trafoil. Not. Not. Is that how that thing is spelled? And let's just see. Oh, not. No. Ah, yes, good. You need quotes because otherwise it will think you're saying the variable trefoil times the variable not. Let me see what happens.
Yeah, this is a very good example of where we would want to check that intermediate step to see how it was being interpreted.
Wait, these are unprotected database accesses. That's what those errors are. I don't know what's going to happen here. We'll try this and we'll see what happens. And if it's not anything. Yeah, trefoil. Good. Okay, so we found the trefoil. Nod now.
So I happen to know the name of the entity property that I'm looking for. But let's say that then. So we had the trufflenot and then we wanted to just look at entity properties of that particular entity. So that then we could perhaps, as another intermediate step, see, what are my options even for what we could get.
Here is that entity properties like that.
I think that ought to do it.
Let's see.
Excuse me. Entity properties takes a type. So let's. Also, Just the way that we would do it in Wolfram language would be we would say just apply properties as a string to that truffle, not entity. So I'll put in the zoom chat. So it would be the interpreted entity. And then we could just say properties.
Like where's the chat? Oh, I know what you mean. I know what you mean. You say you mean this. Entity properties. Yeah.
So in other words, after we get that interpretation, we just want to do open bracket properties and then close bracket properties.
Is it like this, right?
Yep, yep, exactly like that.
No, but with the string, right?
Yeah, just the string properties.
Like that.
Capital P. Yep.
Right. Okay. Right. Yeah, like that. That's what you want.
Yep. So then again, there's a specific one I have in mind. But if we were exploring around.
Yeah, I'm going to take a note here because there needs to be. There needs to be some kind of analog to control equals or autocomplete or something like that.
Now I also noticed that. Oh, here we go. Missing unknown property, not properties.
Is that really how you access entity properties?
So that's one way to do it. There's a whole lot. You could also use the entity value function.
Oh, I see. Entity properties.
So if we want to do it that way, we'd do a type rather than the specific entity. So we might say. A note. Actually, let me, let me check real quick on locally on my end what sort of entity type that is. I believe it would be not, but we'll just double check here. So it looks like it is type not with a capital K like all entity types would be. So we could say entity properties and then specifies the argument in a string not. And we would get all of the properties associated with that particular one.
Properties just like this. Like that. Right.
So we don't need to do the semantic interpretation. If we're doing it that way, it would just be entity properties as the function and then the one input would be the string not with a capital.
K. Yep.
That would be one way to do it. Now, one thing I'm curious about about. And then here we see the entity properties.
Okay.
So that's one way to get the list of the properties. One thing I'm curious about though, for three code is that. So is it possible to Toggle on and off the, you know, LLM part of the code.
Right.
Because like, for example, here we're still, you know, deciding what it exactly is we wanted to do here. So I could imagine maybe after doing a bit of tinkering and seeing what these intermediate steps are, then being interested to get that summary. So I'm curious, is that currently in the beta version, a toggle or does that happen automatically?
Nope, Current. It just. Currently just happens automatically. It wouldn't be hard to make a toggle. I just haven't done it yet. But yeah, you probably. Usually when I'm using it, I don't want it to do all the translation back and forth continuously as we're doing now. We want to play around, play around, make a bunch of changes and then do the translation. But the way I'd prefer to solve that is so that people can just make whatever the changes they want on the diagram and the Wolfram code and the English will just catch up eventually. You shouldn't have to wait for them, right? Currently have to wait. It's really annoying, but that's not a core problem. It'd be best if they just catch up eventually with some indication when they're out of date.
So I'm going to real quick put in Zoom Chat. As soon as I copy and paste it here.
Oh, whoops.
So if I wanted to have particularly this entity property, right. So we can see in the list of properties there, there's a whole bunch of them. And so we. We might imagine that we wanted to check each of those properties. And you might do that with like an association or you might ask for that as a data set. But let's say that I'm. I've explored those and I'm interested in like a very particular, very particular knot. And then I'm interested in seeing that very particular function that I would get out.
So this 3:1 thing is some aspect of the 3:1 is a specification of a knot, right?
Yep, yep. That, that. So the entity type is not, of course. And then there's a particular knot. Yep, that's exactly what we're expecting as an output. So that's a parameterization of some particular knot that then we can. We can plot that. Okay, so now let's say that we have that. So that's how you would write down this geometric thing in terms of parameters. So you might imagine some workflow where. All right, so we figured that part out. So now I want to have just that function and I want to call that like, I don't Know, maybe not parameterization or something like that. So how would we now collapse this block where we've figured out where something lives that we're interested in and we can just use that then as plugging it into other things that we want to do.
I see. So what you want to do is take everything we've got on all the red blocks on the screen and you want to collapse them into one block, give it a name and it will then output this pure function. It looks like it's a pure function that creates a list of three elements.
Correct? Yep. That's what we're expecting.
Right. So we can take this little slow. We can take this little. See that little tool up there? Select. We're going to do that and we're going to go like this. That's not what I want to do. I want this one. So I make a new block.
Cut.
Okay. So now all that stuff that we've had there is now in this. I didn't want to do that. Just going to make this a bit smaller so it's easier to deal with. So new model, whatever this should be called.
Let's just call that curve curve.
Okay. That's a function of no arguments. That produces perfect. And now we could. We could plot this thing. Is that what you want to do now?
You read my mind. Yep. Let's do a parametric plot 3D. Where we're going to take. We're going to take this parameterization of a curve that we found and let's plot that between, let's say 0 and 2pi for the parameter value with parametric plot 3D as our visualization function.
Okay. So leave that. We need parametric parametric plot 3D. What does this do? Produces a three dimensional space curve parameterized by variables U which runs from U min to umax. I see. And it takes a list of three. Well, what do you know is exactly what we need. Almost like you prepared this example.
Yep.
Okay.
As it turns out, for an entirely different purpose. So it's not. It's on my mind.
So parametric plot 3D. It expects. Does it expect this pure function or does it. Or does it want.
What we're going to want to do is we're going to want to specify the parameter, the parameter name. So we could use U. And then for the minimum we want zero and we want two PI. And then we feed that parameter to this pure function so that we can plot the thing.
Okay. So this thing just comes right in there. And now we want to open. Wait, the parameter. If I write u02pi, not u pi2pi. If I write it like this, then that won't work because U does not exist up there. Right. U doesn't exist in this.
Right, Correct. So we need to feed that. Yeah, we need to feed that parameter U. So in other words, the first argument that we want in terms of the code would be curve U. And then the second argument to parametric plot 3D would be.
Right, right.
That we need. That you just provided.
Ah, God. You need not triangle construct. But I'll use it. I just want construct, not slash construct. Sorry. All right, That needs to come there. Now we need to put U here. So let's make sure we did this right. I'm going to get another output and just make sure. See, we're going to see what comes out here and then hopefully this thing goes in there. And this thing goes in there.
I like that. This highlights the utility of being able to look at these intermediate results. Right. Because it's, you know, great to double check that. You know, is this what I'm actually expecting?
Yeah, let me evaluate that. First of all, does this code look right? Construct entity, not space, curve. And now curve U. And that should be. Right. Let's just evaluate and see if this is right.
So the curve should have U as the argument. So I. Yep, that's looking good.
Perfect. Yeah. So the reason we had to have a link coming in the top is that this thing is a pure function. And so I'm. The link coming in the top means that this block should take on whatever function comes in its top. So the outcome here is this is a pure function and I'm now telling this thing be that pure function. Take arguments. This was a pure function that takes arguments. Now I'm going to name its argument and it creates this thing. And you can give the. I say, good, great.
Okay, that's awesome. I like that. And so then let's say. So let's say that we want to take what we have here. Right. So what I'm imagining next we might want to do is you might want to show this plot along with some other plot. So we're going to take the output of that last thing, which is a graphics, and we're going to want to show that graphics along with some other graphics that we're making.
Ok, what other graphics should we make?
So in a particular application, you might want to do like a specific vector field. But just to briefly get the idea across, let's just plot some random vector field in 3D.
Plot some random Vector. I'm still having trouble hearing you. Want to plot some random vector field in 3D.
Yeah, yeah. So. So what we could do is. We could do Vector Plot 3D.
I don't hear you accurately enough. Could you put. What do you mean? In the chat? Something. I. It's. The audio is really. I'm having trouble hearing you. I'm sorry.
Sure, no problem. So the.
You don't have to type exact Wolfram language code. You can just type what. What you're actually saying. But you're. I'm only getting like, half a syllable once every couple seconds. It's hard.
So the function I had. Vector plot 3d. Yep.
Okay. Where is vector plot 3d? How does this work? And it's a 3D vector plot of the vector field. Oh, I see.
Yeah. And then. So for a vector field for a particular application, you might want to do a different one. But just for the sake of the example, let's plot that vector field so that triple will be the first argument to vector plot 3D.
All right. Good idea. We'll see what happens. You just mean this also going into vector plot 3D. See what happens. Right.
Oh, that's a good idea. That's actually not. That was not the thing I had in mind. But that. That is interesting. Right. So for the. I actually really meant just the list of something, I don't know, like minus X, Y, Z. Just some arbitrary field for this. This sake of the example.
I see. Like that. And now we need to specify the range of X, Y, and Z, right?
Yep.
Okay.
X from. Well, how about minus minus 2 to 2? How about that?
Sounds good.
This is a good example.
The inspiration for it has to do with, you know, example problems you might do in, like, electrostatics if you're teaching a class on something related to this. But sure, yeah.
See what happens now. Kind of small here. Let's make that bigger. The quality of the evaluation depends on the size of the block. So if I reevaluate this, it would look better, but that looks kind of neat.
Oh, that's interesting. So the options for what resolution and everything you should do is based off of how big the block is sized in the graphical interface.
I think you asked if the resolution is based on the size of the block, and it is. When I made this thing bigger and it reevaluated, then this whole thing got higher resolution.
Very cool.
Yeah. So I don't understand how knots work. This does not look like a torus. Is it? Is that. But I thought you said this was a Torus.
No. So you could come up with a torus that you know is like a blown up version of that. The knot itself would just be a one dimensional thing. So but if so this is some loop, right? So let's also, let's condense that parametric plot 3D. So let's say that we have this so far and I don't know what a third graphic would be that you would want to do in here offhand, but let's say that you want to call that first argument something. Right? So we want to draw another block that, you know, our first block is just going to be, I don't know, not plot or loop plot or something like that.
This is quite frustrating because I don't know what you're saying. Here, here's what we'll do. Here's what we'll do. Let me stop sharing here. Stop sharing like this. Okay, now I can probably hear you, so this must be really annoying for the audience. You wanted to make some other graphic and you wanted to now wrap. So tell me what you want to do.
How's the audio now? Is the clear coming?
It's good now. Okay, perfect. It must be a problem on my end when I, when I'm sharing my screen. Maybe that's why.
I, I suspect that with the, the you know, video and the screen share and all that kind of stuff, perhaps it's some kind of bandwidth issue anyway. Yeah, maybe so at any rate, so, so let's say that now we wanted to hide the process that went into making that parametric plot as just one block, right? So just to remind people that you know that that kind of is the, the core of block based programming, right, Is that, you know, you, you similar to what you do with regular programming. As you said, you figure out something and then once you've figured out that yes, this is in fact working the way that I want it to, then it's just a reusable part of what you can do in some larger workflow.
Right. I've. Okay, here's, here's a cool thing we could do. Maybe this is along the lines of what you're getting at. So let me go back to sharing my screen. What I'm going to do is that that not specification was 3:1. We can make similar plots for other not specifications and see what they look like. So I'm going to go back to this now here share. Okay, so I want to, I'm gonna, instead of having no arguments, I'm gonna say not spec underscore and I'M gonna see what happens if we change this three to something else. Okay, so now. Now curve here is a function that takes a number and produces that list of pure functions according to whatever number you put in that mouse back. I think so let's actually hear this. It'll be a live test. Let's see what the English says there. Thought it hasn't caught up yet. Yeah, well, I need to make this whole thing faster, but you get the idea. Now coming in here, let's put. We'll try 2, 3 and 4. I don't know what's going to happen with those knots. So we have two, three and four coming in there. And we can. We'll get a parametric plot 3D of each one of those. So now I want to take. Make a new block and cut from here to here. And that thing will be called first. Makes it a little smaller. I don't do that. Don't do that. Bear with me.
I'm liking where this is going so far. The bandwidth issues are a little bit unfortunate, but yes, I see where this is going and I like it.
I Sorry, but I didn't understand anything you just said. Really frustrating. I'm going to rename this. Make Parametric Flat. Now this thing needs to be mapped. So the 1, 2 and 3 will go in there and we'll get a parametric plot for each of 1, 2, 3 coming out the other side. Now can show. Take a list.
Yes, you can show a list of things or just the sequence of things.
Let's remove the vector plot for now because we're not interested in that right now. I'll delete. That port and I think you can just give show a list.
Well, a sequence will definitely work. I believe a list should also work in this case.
Now this will actually shove them all onto one plot, right? It won't make three separate plots. Is that what we expect?
So for the. Try 3 and 4. For the two arguments to give to the not. Rather than 1 and 2, I think the parameters 1 and 2.
I can't understand anything you're saying, so I'm going to have to. Let me just go in here and see if this is. Oh, look, that was missing. Unavailable. Okay, so if. Here, look. You can cycle through. See how there's an int. There's a result block inside this larger make plot. Make parametric plot block. But this whole block was run multiple times because it was mapped over a list. But we can go in here and if I set this thing to 2, it'll give you the results for the case when 2 is the input, if you give it 3, it'll give you the. Ah, here's what. See if when 3 was the input, it gave us this weird interpolating function thing. And what about four? Pretty soon I'll turn this off and I'll do anything for four. Oh no, wait a minute, Sorry, this is wrong. This is the first time through list, so for two it was missing, unavailable. For three it was the thing we got before. And for four, which is the third time through the list, it was an interpolating function. So maybe fourth order not that complex and second order nots don't exist because I don't know how nots work. Now I'm going to stop sharing so that I can understand you when you talk to me. That we have to do it.
Possibly. Sure, yeah. No, so the parameters for 3 and 4 I think were just for the sake of that particular example because. Yeah, feeding the parameter one and two would not give the expected thing. Although it was really great showing how that block based looking at intermediate outputs is really handy there. Right. Because you can.
Yeah.
You know, try it and see what happens. Right then this is a really great way to debug things. Actually, I'm curious, so do you have any other examples offhand that show where looking at some of those intermediate steps have perhaps helped debug some workflow that you've been working on?
Let me see. The only example I have, I think that has intermediate results is the high digits example. And as it happens, I did use it to debug when I was creating that example. I can go back and show it. Let me go back and find it.
That's great.
It's a lot easier than using so. And reap.
Sure. And then after we take a look at that example. I'm also curious, since you've built a lot of really interesting LLM functionality into this, I'm curious of how you think this fits into people designing workflows that involve putting different prompts into different places and that sort of thing. I think that's a really exciting application area.
Yeah, I think so too. I think one of the. One of the. Okay, let me. This is almost ready. One of the great things about visual programming programming is that it can simplify some bits of functionality that appeared more complicated when viewed as code. But some things you'd just rather view as code. And wouldn't it be great if we could add English also? I'll call it natural language, but it only works with English at the moment. So I'll continue with English as yet another way to specify computations. And they should be kind of interoperable between the three. And we saw that a little bit earlier when you could. And this has been in Wolfram language for a while to be fair. Right. You could always, you could always hit control enter and say atomic mass of aluminum. And you then use that computationally in the rest of your notebook. I'd like to extend that to include functions themselves. And you should be able to take the output of some function, which is some Wolfram language expression, and put it into some Blanc, which is defined as English. And actually you can currently do that. Take this input and whatever, find the sixth column of the CSV, interpret it as a date and make a histogram of the dates and the output. So the contents of that block are specified as English, viewable as blocks and understandable as code, and changeable in any of those ways and then computable so that the output of it is just another Wolfram language expression. That's the, that's kind of the vision for unifying Block's code in English. And that, that, that's where we're headed. I think. As you can see today, it, you know, the status of the, this recode right now is that technically it works, but it's beta level software with, with a bunch of rough edges. But yeah, that's where we're headed.
It's clearly even describing it as beta. It allows one to do some very interesting things. And again, reminder to the audience, we're going to make sure that the email address where you can reach Nick, that's nhoffreecode IO, winds up in the description for this video. If you're interested in giving this a try, remember that you can reach out and Nick will help set you up.
Yes. If you're willing to tolerate some beta level software and give me some feedback, I'd be happy for you to click around in it, tell me what problems you want to solve or just play with and be a beta tester and we'll keep this. It's advancing fast. This was just a couple months ago. This was completely different. Not completely different, but quite different software. And I take feedback from users and I put it into the software. We're building what people want here. So I want to know what you think.
While we're waiting to see if any more audience questions come in, did you want to briefly share screen to show that debugging example?
Yeah, sure. We'll go back to that Share screen. We could. Good. So this Was back to the PI digit example. This is where, if you remember, this pie chart block right here takes a number and it produces a plot showing the distribution of digits in that number of PI, of digits of PI. So it can get. Sometimes when you're building this, it can get complex to think about. You know, is the output of this thing a list of the counts or is it the actual plot or is it some other type of expression? So we have a. When I. To make sure this was right when I was building this, I went in here. And first you calculate the number of the PI digits. Now this thing calculates how many of each digit are in PI digits. And it's mapped over zero to nine. And we're all getting, already getting a little bit like confused about what exactly does this thing calculate. And so here is the output of that block. On the first iteration through this was when there were only 100. So you can confirm it's eight zeros, eight ones, 12 twos. And then if I go up here and advance this. But the second time through this was when. What was the second number? 1,000, I think. Yeah, a thousand and then a million. This is the number of thousands. Oh, and by the way, the numbers can get big. So I just set this to short. You can set I. If you want to see the input form, full form, whatever row, columns, sometimes table form is convenient. This is just the display wrapper, same ones you have in the notebook. So there's the output for 1000 and it's really still slow. And we'll see it for a million. Probably be a lot of shorts. Yeah. Okay. Yeah. Intermediate results helping you determine what exactly are the types of all these things in the middle of a computation. And if I, just in case someone's wondering if I go down here, you can also put intermediate results inside second nested blocks and see what was the value of some result the first time through this one and the third time through this larger block. And set these numbers individually. Yeah, and just. Well, let me. We've been on for an hour and 15 minutes. Let me turn this off now. And we can do questions. Are there any questions?
Let's take a look here. So if you are an audience member and you would like to make sure that you get your questions in here, we will be wrapping up for too long. So we, we have people who are saying, you know, they definitely appreciate the presentation and they're really excited to see what comes next, I'm sure. So while we're waiting to see what other specific questions come in Perhaps you could speak to that a little bit. So what, what other sorts of things do you envision as the next step for 3 code?
Well, many, many technical improvements, speed and all that. All the kind of annoyances that we came across today, I'll need to fix all of those. But that isn't really core or interesting. Where do I want to take this tool? What I'd really like to do with it is make this integration between blocks code and English functional for real people and find out what kinds of problems do students have for which this might help. We're ultimately here to help people. And there are students at different levels, right? There's elementary all the way up to university. And I've been using Mathematica my whole way along too, when it was called Mathematica. And so my main piece of interest right now is. Who is this helpful for? I think students are the first thing you might think of. Think there's another class of people and I talk to users like this all the time. That's how I came up with some of these examples. I think there's another type of person who has a bunch of data to analyze, but is not a programmer. These are not just scientists, but also accountants and analysts, people who, journalists, even people who have a bunch of data to go through, but they're not programmers. And so usually what they end up doing is making some very large, unwieldy Excel spreadsheet with some Excel macros and weird formulas between cells that they don't understand 10 minutes after they wrote it. And most of the world's data analysis that's done by non programmers is done in Excel or very bad Python code that nobody wants to read, write or run. And I think there's that class of users for whom block based programming would be much more intuitive if for no other reason, that they don't have to deal with installing Python, which they don't really know how to use and want to use, and they can look at their computation without having to click through 100 Excels, you know, cells to sign which one references which one. I think just the simplicity of the visual interface with some intermediate results is I think would help these people, I've heard from some of them, you know, who say, oh my God, does it work with Excel? It's Wolfram language, it works with anything. Just give it any type of data, it's going to eat it and it's going to chomp through it and you know, import is amazing, so it will work.
No, I certainly agree that having this middle Ground between, you just type it in and then the language model goes and tries to implement the entire thing that you imagined. Well, sometimes that works, but it definitely helps when you're taking a problem you're solving with language models and you break it down into steps. And so this is exactly where the visual understanding of the blocks comes in. So that the person who is, even if they're not a programmer, right, they know more or less what they want to do with the data at the level of a picture that they have in their head. And then the visual interface helps them figure out how this should flow through some thing that they're creating. And then maybe they don't actually write the code. Right, as you say. Now if you want to type in. All right, so I know the inputs of what go into this block. I know what the outputs of this block should be. Language model, please, you know, help me fill in the details because I'm not a programmer. This is a really interesting, exciting workflow for sure.
Yeah. And I think that there are quite a lot of people who. Well, so one of the problems with language models for generating code is that they usually don't generate code which is both complete and correct. That's partly a fault of language models and improve over time. But it's not going to get perfect because when you specify what you want some function, some block to do, or some whole computation to do, your natural language is incomplete and it assumes things. Of course it is, because otherwise it would be code. Right?
Right, exactly.
Take the six. You know, in my example of the CSV, you say take the sixth column. Well, I assume what you mean by that is take the sixth column except for the header row, right, because the header row probably says city and then all the cities are in all the other ones. And you didn't go into that level of detail when you gave the English description of what the computation should do. So if you have to go into all that detail, you might as well just write the code. And so I think that there, there quite a lot of use cases out there when people want to non programmers or students who are programmers but are learning, they know at a high level what they want to do and they know at a high level what each block should do. But they're going to need to tweak it and they're going to need to get it to do exactly what they want. And so we can get a lot of the way there with a language model to get the basic logic down and we can get a lot of the rest of the way there by viewing it as blocks. And now all you have to do is say I know the connection there is wrong. It should do this thing. Even if you wouldn't have been able to write the Wolfram code yourself and you didn't want to spend the time where you wouldn't have been able to do all of the blocks yourself, you can understand it. Non programmers are not stupid. They just all the details of the syntax and all the little thing. And so we can tweak code that already exists in block form or code form, you know. And I think, yeah, I think it'd be a great way for a lot of people to do their computations.
And you spend a lot of time speaking with people who do, you know, computational, excuse me, Computational sciences, social sciences.
And also they had journalism. So yeah, I used to being a TA at journalism school. So they had a hard time to use the terminal like the very, you know, the first week of like teaching Python is terminal and then jupyter notebook. A lot of people get confused about that because they think software is. You double click a graphical icon. That is software.
That is software. Right? Right, Yeah.
I mean, yeah, with the right block interface, that's now exactly what you're doing.
Right? Yeah. With people like this. Journalists are a good example because they're smart people, they have data and they know what they want to do with the data. The only problem is the details of getting the computer to do what they want. And the existence of the Wolfram language has brought us 90% of the way there. Right. It's so good import. Take the third column. And even the very broad, very deep functionality of the Wolfram language. Make a plot point this, make a plot, make a map of this point on the world and the surrounding Wolfram language. It does everything. If you don't want to pay for the Wolf language, which people don't sometimes, then there's Python and now you have to install Python. As a journalist, really you don't care about this. We can move this a lot closer. And so visual programming is still programming. The journalist still has to know what they want to do with their data. But the idea of what they want to do with their data. It should be very much easier to get the computer to do what they know they want to do.
Yeah, I agree. So we have about two minutes left. We will wrap up here. Thanks for Nick to show his product like before it's fully released this data. Right. So we're glad to, you know, kind of being an insider of your progress.
Well, hey, it was fun for me to show it off and talk about where we're going and get everyone's feedback. N H O F f@recodeio I'm interested in what you think.
Yeah. We will also post the email address on the video. After this live stream we will upload to our live stream the YouTube channel. And for those who are speaking with our Academic Innovation live stream, our next one is March 18, so come back to join us to hear more about hear more story about forever language and innovation.
Thanks everybody. This was fun.
Thanks so much for joining us.
Yeah. Have a good day.
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






