WEBVTT

0:00:15.167 --> 0:00:24.246
<v A>Hey everybody!

0:00:25.580 --> 0:01:05.320
<v B>This is a super, super exciting episode. I can't tell you how many times I've gone into Google and typed in like Python GUI. Because as most people know, I do a lot of machine learning. That's my day job. And I do a lot of it on the side too for fun. And I always want some way to visualize things. I'm always looking for new ways to do that. And so I'm really excited that we have Meredith here, who's the founder and CEO of Anvil. And he's going to talk to us about how Anvil, how you can use Python all the way through the full stack. So thanks. So glad to have you on the show, Meredith. Thank

0:01:05.320 --> 0:01:06.248
<v C>you very much for having me.

0:01:06.620 --> 0:01:15.512
<v B>Cool. So there's a lot to unpack here. Why don't you kind of talk about what Anvil is, and then we can dive into a lot of the details. All

0:01:15.900 --> 0:02:09.940
<v C>right. So Anvil is a development environment for building web apps quickly and simply. And it does that by letting you use Python everywhere. So if you jump into the Anvil editor, you'll get a drag-and-drop UI creator where you can build like component-based UIs. And then if you double-click a button, now you're editing the Python code that runs in the web browser when you interact with that UI. And then you can also write some server code and build the database and add all sorts of external integrations, user authentication, that sort of thing. And then, you know, click and publish it in a kind of serverless sort of way. So maybe the best way to think about it is if you think about those old-school rapid app dev tools we had like at the end of the desktop era, it's like Visual Basic and Delphi. It's like that for the web.

0:02:09.940 --> 0:02:24.220
<v B>Oh, I see. So if I remember those tools, basically you had this kind of WYSIWYG-like editor and you could kind of drag and drop buttons. You double-click on them and it kind of takes you to some partially auto-generated code.

0:02:24.980 --> 0:04:22.943
<v C>Yeah, exactly that. So what it means is that you can build your user interface without having to get down and dirty into the HTML and CSS instantly. You can... It's real programming. This is not one of those no-code things because you're actually writing real code in a real programming language, Python, that runs in the browser. So we compile that to JavaScript and we can talk about how we do that later if you like. And then rather than having to deal with the HTTP and routing and REST endpoints and all that stuff, you can just say, okay, I'm going to define a Python module. It runs on the server and then I'm going to tag like these functions as something we can call from the browser. So what we've done is we have taken the web stack, which is actually really, really complicated and forbidding, and we've turned that into all one representation. So if you think about an ordinary web application, if you've built these before, if you think about your data, like an ordinary database-backed web application, your data starts out as rows in a table in your database. And then the first thing you do is you take them out and you transform those into objects in your server-side code, whatever language that's in, maybe Python. And then you immediately turn around and represent those objects, which have their own methods and attributes. You turn those into JSON served over HTTP with this really limited set of verbs like GET, POST, PUT, DELETE. And on the other end of that HTTP request is some JavaScript that immediately transforms that JSON into a JavaScript object with its own set of methods, its own set of attributes. And then you turn around and you represent, re-represent that data as HTML DOM. And then you use CSS to re-represent it as pixels. And that is the

0:04:23.500 --> 0:06:22.380
<v C>day-to-day work of web development is shoveling your data and your application's state between these different representations. And we thought it's not difficult to work out that this is way, way, way more complicated than it needs to be. Have you ever looked at one of those, there's this really great chart on GitHub, like, you know, these are the basic technologies you need to know to be a web developer. And like, it's just like pages and pages and pages and pages of stuff. And it's all kind of wired together and you need to fit these, you know, 20 different components together. And we thought, well, if it were all just a Python program, if you could just, if getting from the server to the client wasn't a matter of mashing things into JSON, it was a matter of making a function call. If putting something on the screen wasn't a matter of, like, generating source code in one programming language that templates a different markup language that is then transformed into pixels by a third language and they all kind of work together and you squint and you get something on the screen. If we could replace that by put a button there and then, you know, make its text be such and such. If we could replace the process of, you know, standing up a machine on AWS and setting up a web server and setting up the front end and standing up a database with, well, hey, here's this serverless hosting. If we could do all of that, suddenly creating a web application is no more complicated than writing a Python script. And frankly, that's where it should be. There is no reason that the greatest application delivery platform on earth should have the bar set that high for, like, you must know these five different programming languages before you can ride this ride. You know, you must know HTML and JavaScript and CSS and Python and SQL and React and Redux and Bootstrap and Flask and SQLAlchemy. And, you know, that's before we've even got to the DevOps stuff. Like, that is not necessary complexity.

0:06:23.140 --> 0:06:31.700
<v C>A web application where you click something and something happens ought to be as simple as writing the equivalent Python script. And we set out to make that happen.

0:06:32.460 --> 0:07:40.960
<v B>Yeah, it totally makes sense. I think the, you know, a lot of the open-source libraries, and this is true in general, but especially for web, you know, they're built by companies that have gigantic websites. I mean, I have websites that are, you know, the code base is enormous and the throughput, the QPS is enormous. And so, yeah, if you have a gigantic, you know, massive organization of people, then it kind of makes sense. You know, we'll have sort of people design a sort of GraphQL server, and that's going to be, you know, whole teams of people working on that. And then there's a whole bunch of other teams of people consuming that, and it's all sort of decentralized, right? But the problem is nothing starts that way, right? Like, nobody goes into the first iteration of their company, and they're trying to find product market fit, and they have three customers, and they're, like, you know, stressing about their GraphQL throughput. Like, it just doesn't work that way. And there's not that much visualization for people who are, you know, wanting to get started quickly.

0:07:42.219 --> 0:09:26.560
<v C>I totally agree with you, but I would take that analysis even further. Even those huge high-throughput guys, like, the web isn't the architecture they would have chosen. You just mentioned, like, several different technologies that are actually about taking the primitives that the web gives you, which basically, they were organic. They kind of grew up over the early 2000s. Now we're stuck with them. And turning them into something that these hyperscale people can use. Like, things like GraphQL is literally a solution to the problem. Oh, wait, REST is not a good way of representing our server-side APIs. Guess we're going to have to build something else on top. React is HTML DOM is not a good way of representing our UIs. Guess we're going to have to build something else on top. Like, all of this stuff is patching over the web, patching upon patches upon patches to try and make it a usable development environment. And that is as true when you are these incredibly high-scale people building funky GraphQL backends as it is if you're a data scientist who just wants to be able to, like, select from a dropdown and then draw the appropriate graph on the screen. Actually, almost everybody who's using the web is suffering from these problems in some respect. Having said which, of course, you're absolutely right that, you know, these are the core customers we're starting with first. Like, the sorts of people who go, well, I just want to, you know, put a button here and draw a graph on the screen or I want to prototype my product. And those are the people we can really say, hey, there is, in fact, a better option. Here's how you can do it, you know, 10 times faster.

0:09:27.280 --> 0:09:57.389
<v B>Yeah, makes sense. I think you really hit the nail on the head that the whole HTTP, you know, invention was for just, you know, server-side rendering. You know, it's for just dropping almost like a printing press, right? It's sort of like we just give you this sort of structure and you just drop it onto your screen. And then obviously the web is totally different now. Now things are sort of hydrated. And the hydration for a lot of websites is everything. Like, there's some websites that if you don't have JavaScript on, you just get a blank screen or something, right? So,

0:09:58.249 --> 0:11:00.160
<v C>Yeah. And there's nothing wrong with that architecture, right? It's just like your classic thick client architecture. You have this runtime so you can have fast responses and fast interactions on the device you're actually using. And then it talks to a server, and that server talks to a database. Like, none of that architecture is actually bad. What I would assert is unnecessarily difficult to use is the particular way the web has evolved around that. Because just like, yeah, exactly what you said. Because it's evolved over this document-based substrate, it's kind of, at every point, it's done like the minimum required to hack this next piece of functionality on. And so you end up with this mess that's really, really difficult to approach. And, you know, there's no reason that a beginner or a data scientist or someone whose experience is somewhere else, like, you know, manufacturing engineer, should have to learn all this amount of stuff just to be able to, you know, produce an interactive screen.

0:11:00.839 --> 0:11:31.028
<v B>Yeah, exactly. I think, you know, this is even true for, and this is going to be a bit of a tangent, it was even true for desktop. I think this is one of the reasons why, you know, at least for data science, you know, this Jupyter Notebook has been so popular because, you know, it took all the painstaking time and effort to do that. But then you're kind of limited to whatever's supported, you know, by Jupyter. Ideally, you would have, you know, as Anvil is, you know, a programming environment, which is much more open-ended. Well, funny, you should mention that.

0:11:31.028 --> 0:12:48.500
<v C>Actually, because yes, absolutely. Jupyter is a fantastic piece of technology. And the way that it's got back this kind of cell-based interactive programming is a really great fit for a lot of data science tasks. But as you say, it's fundamentally just a Python script. And so there's limits to what you can do in terms of interactivity. We actually have a library that can connect a Jupyter Notebook to an Anvil UI. So because this is a problem, again, that keeps recurring, because there are a lot of problems for which actually, you know, just writing a Python script is the right answer. And then you go, oh, well, true, but I would like to connect this to a Web UI. So in your machine learning work, I'm sure you will have done a lot of this, right? You are in there. You've got your nose in a Jupyter Notebook. You are designing, training, refining a model. And then you go, okay, like, I've got this thing working. I'm at the point where actually I've gone as far as I want to go by interactively typing Python into a programming environment. Now I want someone else to be able to use it. I would like to, you know, be able to put some interactive visualization on it. I'd like to stick it up there. So, you know, I've got an image recognizer and I'd like someone else to be able to come along and take a picture with their mobile phone or upload something from their computer.

0:12:50.391 --> 0:14:02.479
<v C>And what we've actually got is something called the Uplink, which is a library you can pip install anywhere you're running a Python script. And it makes a connection up to the Anvil servers. And then your Python interpreter, wherever it is, say, inside your Jupyter Notebook, it's like it's part of that app. So you can access the data tables in your Anvil app with exactly the same API as you could if you were running in our serverless environment. You can call functions in that serverless environment. You can even define those callable functions that can be called from the web page. So actually, we have a neat demo, perhaps we can drop a link in the show notes, of taking a Jupyter Notebook that does an image recognition task and then going, well, okay, now I want to turn this into a web app. Import the library. Take the function that takes an image and returns the classification. Tag it as, hey, this is a function we want to be callable from the browser. And then just going into the browser, you know, having a file uploader. When a file gets uploaded into that widget, Anvil.server.call_classify_image(file), pass the file in, and get the return value. It's just a function call. It's just Python. It just works. So yeah, we have something for that.

0:14:02.800 --> 0:16:01.440
<v B>Yeah, yeah. I think that makes a ton of sense. So I'm trying to think, like, I think you did a good job explaining kind of the sort of traditional web development, right? And just to kind of reiterate, actually, I didn't really explain what GraphQL is and REST. So let me cover a bit of terminology, and then we can dive into how Anvil, you know, works, right? Yeah. So typically, you know, if you're on a website, your browser's running this engine called JavaScript. You know, programmers can go in and write things like change colors of buttons, you know, add content that wasn't there before, things like that. And the way that it does that is, you know, by running this JavaScript engine in your browser, but, you know, often it needs to go back to the server and get more information, right? Maybe someone sends you a message, and you have some, you know, IM thing on your, some IM website that needs to be interactive. So, you know, it's constantly going to the server and saying, hey, is there something new that I need to know about? And the way it does that is by basically visiting websites that are just meant to return data. So, you know, if you go to google.com, you're going to get, you know, this rendering, but there are other websites. If you go to them, you're just going to get, you know, a batch of data. And most of the time, people are doing JSON as the transport. So you're going to get some actually human readable, I guess. I mean, it's usually like a mess, but you're going to get something in characters that you can see that's going to represent some structured information, right? And so if you were to build a, you know, let's say, I don't know, old school. If you were to build an old school kind of, you know, interactive website, you would have a bunch of, you'd have your main website, you know, mycoolwebsite.com/index.html. But then you'd also have, and you'd also have your images and all of that. Each of those would be URLs, and the server would know where to go to get those. And then you'd have all these other URLs that just return data.

0:16:02.180 --> 0:16:34.560
<v B>And presumably, they have logic behind them. So they're going to return different data when you call them, depending on the context. There's something else called cookies, which is, think of cookies as like a really small database that your computer and the server are sharing for your connection. And so the cookies are a way so that when you go from one page to the next, you're still logged in every time. But this was a huge pain. It's like, I have to make a URL for every piece of data I need. Like, give me the current time. Tell me how many friends I have. Tell me all my friends' names.

0:16:35.380 --> 0:16:49.560
<v C>Well, and crucially, when you clicked to go from one of those things to the other, your whole page refreshed. You were staring at a little bit of white screen while the next whole page downloaded. Then it showed the next whole page to you. And the web was advancing. We wanted to be more interactive. Yeah,

0:16:49.830 --> 0:18:09.360
<v B>that's so true. So then we get to the sort of single page apps where it's even fetching not only just data and HTML, but it's actually kind of fetching new HTML and kind of building as it goes. And then, but you're having all these URLs just because it becomes really cluttered. So this GraphQL was this idea that let's just have one URL, but you'll pass in, you know, a specification that says what you need. Kind of like when you, you know, write SQL queries, there's only one SQL engine. And the query just tells the engine to do different things. So with GraphQL, there's only one URL that you go to for all your data. But by passing in different, almost like different queries, you're going to get back different pieces of information. And so that, that was better, but it still has this challenge that, that Meredith talked about where, you know, GraphQL does everything in this thing called JSON. And so if you want to pass an image, for example, in GraphQL, you actually have to convert that image into letters and then send it to the client and then turn it back. And so it just becomes a huge hassle to represent everything in this way and then just to turn it back into something that you're going to render.

0:18:09.360 --> 0:20:07.580
<v C>Well, and also the fundamental structure of a web application is that your browser goes to a site and your site serves up the source code for an app that will run in your browser. This is how it mostly works these days. And then the browser is running an application that's built with JavaScript and HTML. And then when that app running in your browser wants to get some kind of data from the server, it will make an HTTP request to the server. And there are various conventions for how we use those, those requests to get data instead of HTML. There's sort of, you could have a URL for everything. So, which is the REST pattern, or you can have something like a GraphQL where you have one URL that you post this complicated query to. And it gives you back some complicated response. But all of this is being squeezed over HTTP requests, which is exactly the same thing that your browser is using to fetch the web page in the first place. And HTTP is a great protocol for fetching web pages. It's not necessarily a great protocol for doing what your application actually wants to do, which is that the part of your code that's running in the web browser wants to talk to the part of your code that's running on the server and do something that's, well, do something that's part of your application. And if this were a desktop, old school desktop application, you'd just make a function call. And, you know, you'd be modular and expose a certain API. The GUI section calls the backend engine for these things. And these days on the web, whether you use something like REST or whether you use something like GraphQL, you're kind of twisting the way your app thinks about the world until it's shaped like the way that HTTP thinks about the world. And that's just an amount of stress that as a programmer you don't need.

0:20:08.179 --> 0:21:16.979
<v C>And this is why in Anvil we have, you can still use those. So if you already have an API that's built in REST or GraphQL, you could absolutely use it with the standard HTTP stuff. But the usual way of communicating between the bit of your app that's running in the user's web browser and the bit of the app that's running on the server is just to make a function call. And you can pass arguments to that function call. You can get return values to that function call. Unlike a classic JSON API request, you're not limited to just, you know, dictionaries and strings and numbers and lists. You can, I mean, in the image recognition example, you can just pass a blob of binary data that was uploaded as a file from the computer. You can just pass that as an argument to the function. And Anvil takes care of taking all that large lump of binary bytes from your browser to the server and putting it into a form that your server-side code can easily deal with. And this is just one example of how twisting your application's logic into the shape that the web stack expects is just making you do unnecessary work. And we've done the same in the client

0:21:18.717 --> 0:22:09.040
<v C>where instead of generating HTML, which is, you know, kind of programming language all of its own, you can say, well, actually, the thing I want to do is I want to add a UI component. And so we have this object-oriented thing where you could just construct an object in Python. You could, you know, construct a button object, set its button1.text equals blah, self.addComponentButton, and put a button on the screen. And that's, again, it's not making you twist what your application is doing into the shape of what the web platform is expecting. And so that is, I think, the crucial theme that runs all the way through Anvil's architecture from top to bottom. And doing function calls instead of REST or GraphQL is just one example of that.

0:22:09.520 --> 0:22:59.120
<v B>Yeah, it totally makes sense. I think, too, if there's this extra benefit where if you're already using Python for a task, you know, then if you have some Python program and you want people to see it on the web or you want to write a web visualizer, then without using Anvil, everything you want to see has to be represented in JavaScript. So now it's like you have to have sort of your Python representation of all this knowledge. And then you have to have this JavaScript representation, and you have to constantly be converting from one to the other. And so, yeah, that ends up taking, you know, a huge amount of time. And it can actually be really difficult. You know, I mean, JavaScript wasn't designed to handle binary data. You know, now they have a whole bunch of cool things for it. So, I mean, it's definitely evolved to meet the demand.

0:22:59.460 --> 0:23:04.962
<v C>But yeah, it's evolved rather than being designed is sort of the point. Yeah,

0:23:04.962 --> 0:23:06.025
<v B>Exactly. But,

0:23:06.025 --> 0:23:06.740
<v C>Yes, exactly that.

0:23:06.900 --> 0:23:32.620
<v B>So yeah, let's dive into the magic here. I mean, it seems pretty magical that someone, you know, we just told people that you can only write JavaScript in the browser. So, somebody, you know, someone's writing some Python. And so I think you said that they're annotating some functions of saying, oh, these are server endpoints. And I guess there's maybe like some Python files that are running in the browser. Some are running on the server. Like, how does all of that come together?

0:23:33.120 --> 0:25:30.680
<v C>All right, yeah. So, here's what happens. When you open the Anvil editor, you've got, you know, it's a standard IDE type layout. You've got a sort of list down the left of your modules. And there are two sorts. There are client modules, and then there are server modules. And whenever you're editing client code, which includes like these forms, these drag and drop, these—sorry, these pieces of user interface that can appear on your page. They're also client-side Python modules. They're just Python classes, actually. Everything is a Python object. We try not to be magical about this part. But when you write code that runs on the client, Anvil will actually translate that from Python to JavaScript. So, when someone visits your application, what they load is actually a Python runtime written in JavaScript. It's called Sculpt, S-K-U-L-P-T. It's a really cool open source project. We contribute heavily to it. And that is the kind of translator that allows you to run your—it turns your Python code into JavaScript code that does the same thing. And so, when you click on that button, what's actually happening is that a JavaScript function is running, but that JavaScript function was created from the Python code you wrote. And when you call something that's on the server, so you say, you know, if you do anvil.server.call, which is our library function for this, that's Anvil's queue to send a message to the server. And it then goes and talks to Anvil servers, which then spin up your server modules, which are those—the Python modules that you created in a section that's—no, this doesn't get sent to the web browser. So, this only executes on the server and loads all of those modules. And then any functions that you have annotated with @Anvil.server.callable are accessible.

0:25:30.680 --> 0:25:55.800
<v C>And so, when the request comes in and says, I want to call the classify image function, then we look up and say, yes, there's a function called classify image. Yes, it's tagged as accessible. So, we run that function. And then when that function returns something, we will send a message back to the browser saying, this function has completed and here was its return value. And the Python code that's running in the browser gets that as the return value from anvil.server.call.

0:25:56.280 --> 0:26:21.899
<v B>I see. I think I get so. Let me see if I can reiterate it and I'll figure out if, isn't that one of the—what do they call that? They say, if you can reiterate something, then you understand. I don't remember the word for that. But yeah, so, okay, so the idea is actually, so what is getting sent to the client then? Is it Python files that then are being executed by this virtual machine or is it—is it being compiled somehow?

0:26:22.600 --> 0:26:35.320
<v C>So, it is actually, what gets sent to the browser is a Python source code and a Python-to-JavaScript compiler and runtime. So, it actually gets compiled when it's opened in your user's browser.

0:26:35.320 --> 0:26:40.420
<v B>Okay, what's the—what's the reason for that? Like, what's the reason for not compiling it server-side?

0:26:40.800 --> 0:26:59.399
<v C>Oh, I see. That is a speed optimization that we will make at some point. Remarkably, actually, when we profile it—that is not the—that's not our current limiting factor in terms of performance. So, you know, one day we will compile it ahead of time and just serve up the compiled JavaScript when your user accesses your app. We just haven't got there yet.

0:26:59.580 --> 0:27:05.280
<v B>Got it. Okay, makes sense. Can people, since it's compiled on the client side, can people write Python interactively then?

0:27:05.280 --> 0:27:21.860
<v C>So, people can write Python fairly interactively. We don't have a like an interactive Python console in the Anvil editor yet, but watch this space. Actually, by the time this episode goes out, we might have—that interactive console might be released.

0:27:22.240 --> 0:27:22.960
<v B>Very cool. Okay.

0:27:22.960 --> 0:27:32.560
<v C>But yes, if you go to sculpt.org, you can actually get a demo of the Sculpt Python JavaScript compiler. And that is like a live Python console running in your web browser. It is very cool.

0:27:32.780 --> 0:27:41.037
<v B>Wow. It's amazing. And so, they actually wrote a Python VM in JavaScript, like, from scratch. Believe it or?

0:27:41.037 --> 0:28:51.680
<v C>No, they did, and they're not even the only ones. There are about five different projects, I think, that have tried to put Python in the browser. And like, there are really good reasons for this because a whole bunch of people who are used to the ease of using Python have looked at the web and gone, 'Oh, my goodness, this needs to be simpler.' You know how can we make it simpler? Well, you know, I find Python really easy to write. Let's make it so you can run Python in the web browser. And there are a few of these. So, there's something called Brython, which is it kind of replaces JavaScript with Python. So, you still write your script tags in your HTML, which is where you'd normally put your JavaScript, but you write them in Python, and then the Brython compiler jumps in and compiles them to JavaScript and executes that JavaScript instead. So, you've got there is something called Transcrypt, which is it compiles, it's something that's mostly Python. It doesn't quite behave exactly like Python, but it compiles it into really clean and fast JavaScript. And that happens ahead of time. So, you feed it a bunch of .py files, and it generates a bunch of .js files, and then you load those .js files in your web application just as normal.

0:28:53.211 --> 0:29:43.379
<v C>And that's kind of cool, although it doesn't really have a particularly good fidelity to exactly how Python behaves. Like, if you're used to, you know, messing around with objects at a low level, then that's not going to work for you. There's also a really cool project called Pyodide, which is out of Mozilla. And that has taken rather than writing a new Python VM in JavaScript, it's taken CPython, the standard Python interpreter, and compiled it to WebAssembly, which is a kind of like fast compiled virtual machine that runs in your browser. And so, if you go to the Pyodide page, you can get something that's kind of like a Jupyter notebook, and it's got all these standard data science libraries, only it's running in your browser. It's mind-bending.

0:29:43.679 --> 0:29:44.399
<v B>What is that one called?

0:29:44.979 --> 0:29:48.399
<v C>Pyodide. P-Y-O-D-I-D-E.

0:29:48.659 --> 0:29:54.340
<v B>Wow. So, they ran the entire like Python source code through Unscripten or something?

0:29:54.560 --> 0:30:01.980
<v C>The entire Python source code and a bunch of the classic libraries. I think you can actually use TensorFlow in your web browser. It's nuts.

0:30:02.940 --> 0:30:03.940
<v B>Wow. Amazing.

0:30:04.440 --> 0:30:20.620
<v C>I mean, of course, it takes like a minute to start because it's downloading the entire Python ecosystem when you open the page in the web browser. So, it's not going to be that great as an application delivery platform, which is what we're looking for Anvil for. But as a technological achievement, it is spectacular.

0:30:21.220 --> 0:30:32.400
<v B>Yeah. I wonder if that can be cached somehow. So, this is starting to get to my limits on what I know about the web. But I think there's like CDNs that cache things or something, right? Is there any way to speed that up?

0:30:32.940 --> 0:31:06.608
<v C>There are ways to speed it up. And you could, if you really worked at it, you could get it down from that many seconds to only a couple of seconds. But it's never going to be like an instant snappy response. Got it? So, it's great for what it is, which is loading a Python environment in your browser where you're okay with it taking a few seconds to start up. But it's not going to replace JavaScript for what JavaScript is really used for, which is driving the page in your browser and making it interactive. Yeah.

0:31:06.760 --> 0:31:47.600
<v B>Totally makes sense. Okay. So, someone goes to the website. They get the, you know, default HTML, you know, that whatever hasn't been hydrated yet. So, whatever the server is rendered. And they get a bunch of PyFiles and they get this virtual machine. So, they grab the virtual machine, they grab the PyFiles, they run the PyFiles through the virtual machine, and that executes some logic. And then part of that logic says things like, call this function on the server. You know, you're on the client, you don't have that function, but there's some way where it knows to take the arguments, I guess, pickle them. There's like maybe a Pickle in the browser.

0:31:48.200 --> 0:31:49.540
<v C>It's kind of like that, yes.

0:31:49.540 --> 0:32:15.760
<v B>Yeah, okay. So, the server runs, the server, you know, unpickles it. Pickle is just, by the way, if people don't know, it's just a serialization library in Python. So, the server, you know, deserializes it back to those objects, executes the function on the server, you know, packages up the return value, sends it back to the client. And so, the client then keeps going. Is there support for like asynchronous calls? There has to be, right? Otherwise, it'd be kind of stutters, right? Watch this space.

0:32:16.926 --> 0:32:45.419
<v C>In short, we've actually, we're working on that on an ongoing basis. But actually, so, when you make a call that takes a long time, it doesn't freeze the browser, but you do get a loading spinner, which is, you know, just like you get with most other web applications while they're loading some data from the server. We started with this synchronous programming model where, you know, you call a function, then you get a return value, and then you carry on executing. Because actually, that is what most people want most of the time. Yep, yep.

0:32:45.420 --> 0:34:19.280
<v C>And one of the reasons, one of the things that makes JavaScript so unfriendly to use is that it's not like that. Its default mode is asynchronous, where you say, well, do this task, make this request to a web server, do this other thing, and then call this other function when you're done. And so you end up kind of daisy chaining, you know, pretty simple, what would otherwise be pretty simple logic. Like, okay, well, they've clicked the button, call this function, then call that function, then do the other. You end up like daisy chaining them with a series of callbacks. And then you have syntactic sugar like async await, if people are familiar with that with JavaScript. But what that is, is actually just syntax for daisy chaining a set of functions. And you still end up, if you want to use something like async await at an advanced level, you end up still needing to know, oh, this is producing a Promise object. And this Promise object will invoke its callbacks if you do such and such. And that's, again, an example of the problems caused by, well, we, you know, building this application delivery system out of kind of the bits and pieces we had lying around in a web browser. And so we wanted to start with this very straightforward programming model, where if you wanted to get something from the server, you could do, you know, X equals call this function, and then use X on the next line of code without having to understand everything about async programming in order to get Hello World to work.

0:34:20.687 --> 0:34:50.033
<v B>I see it. Absolutely.

0:34:50.280 --> 0:36:42.060
<v C>Absolutely. I actually gave a lightning talk at PyCon in 2017. And if you still have any space in your show notes, I'll send you the link to that, which where I take apart the Sculpt compiler, and I show exactly how we did it. And you're exactly right. It's because we control the compiler, we can turn this really simple synchronous logic into highly asynchronous JavaScript. So I can summarize it, but really go watch the talk for all the diagrams. But the way the compiler works is it walks over the source code it's been given. And it breaks that up into a tree of syntax, we call it an Abstract Syntax Tree. And that's things like, well, this is a function definition. This function has, you know, these three statements inside them. And one of them is a function call, and the other one's an assignment, and the other one's a return. And you end up with this tree of things in your language, like assignments, function calls, function definitions, if statements, and so on. And then there's another stage, which is the compile stage, which walks over that Abstract Syntax Tree, spitting out the compiled representation. In Sculpt's case, that's spitting out JavaScript. And because we control that compile phase, we can say, actually, every time you're calling a function, call a function. And if that function signals that it's blocked, that it's waiting for something, then suspend all execution and wait until it gets back. And then when, you know, the result from that function call returns from the server, restore, you know, go back to where we were, you know, nested inside however many function calls and resume execution. And because we control the compiler, we can like save, you know, what all your local variables, what functions were on the stack, and so on, and resume it. It's really, really cool. Watch the talk.

0:36:42.740 --> 0:37:39.900
<v B>Cool. Yeah, that makes sense. Yeah, I think, yeah, I think this is a really powerful model. You know, it's, it reminds me a little bit of like Protocol Buffers and gRPC, where you could kind of like, this actually supports cross language too. But, but, but even just focusing on, let's say Python, you know, you would kind of define your, your, you know, server calls and this sort of IDL. And then it would package all the arguments for you and all of that. I think about gRPC and Protocol Buffers is it's just, it's a huge pain to be, you know, auto generating all of this code all of the time. And so info kind of avoids that really messy step. Also, you have to get Protocol Buffers. But then you have to get Protocol Buffers, which now with like Chocolatey and some of these things is not too bad on Windows. Because, you know, on Linux, you can always app get just about anything. But, but yeah, just having the Protocol Buffers runtime and compiler and putting it in your code and all of that, it just adds a huge amount of overhead.

0:37:40.640 --> 0:38:18.372
<v C>Absolutely. I suppose that's another example of something, you know, that's Google, a very big company, you know, a demonstration like HTTP requests aren't actually a helpful way of transmitting stuff around inside Google. And, you know, Google turns everything from HTTP into Protocol Buffers as soon as they can, because, because the web, you know, the web is, it's like, it doesn't fit any size. It's not a great answer. But, you know, one size fits none is the web. Yeah, that's right. Like, it's not a good fit for those hyperscaler uses. And it's really hostile to beginners. Anyway, you can tell that like, this is a rant I just keep sort of circling back to. Yeah.

0:38:18.920 --> 0:39:02.960
<v B>So actually, one question about this. I mean, what, what the, I wouldn't say what the web is good at, but what the, let's say the ecosystem is really, really powerful at and what the real sticking value is in the components. Right. So, you know, if I need a really nice calendar component, you know, I can find just about anything on NPM. Right. And so there's going to be, you know, an audience of people who want to do the client, you know, the design part in something like React. Is there sort of a way to do maybe like the business logic in Anvil? And does that, does that then make you susceptible to the problem we talked about earlier? Right.

0:39:04.035 --> 0:39:44.400
<v C>Well, so obviously if you're going, if you want to use something lower level and gritty in JavaScript, we, you know, you know, you're going to pay the price of doing something in JavaScript, but we don't want to stop you. And actually this is another big point. Anvil is an abstraction. It takes something complicated, the web, and it gives you an easy way to manipulate it. And the problem with abstractions is that they don't always exactly match the underlying reality. And for example, every abstraction fails like this. Google leaky abstractions. Every abstraction kind of reaches its edges and it fails.

0:39:44.700 --> 0:39:52.840
<v B>I'm thinking of those, but the thing where it's a website, but they tried to make it look like an app. I think it's Cordera or something, but these always look terrible, right?

0:39:52.840 --> 0:41:42.593
<v C>So yeah, I'm thinking at a higher level than that. Like anytime you try to take something and you try to make a simpler abstraction for it, there are going to be limits to that abstraction. Anvil's Python APIs are not going to cover every square inch of what the browser can do. It's, I mean, the browser is a mind-bogglingly huge platform. It's just not going to happen. And so rather than lock you in and say, 'Well, tough, you're using Anvil now. You can't use any of that JavaScript goodness.' We have escape hatches everywhere. I've actually already talked about one of them in a different context. The uplink is an escape hatch. You know, serverless computing is great. It means you don't have to host anything, but I have like a Jupyter notebook sitting here on my physical computer with a physical graphics card in it. And I want to run my code right here, not somewhere off in your cloud. Well, that's okay. We have an escape hatch that says, 'That's fine. You can run your code right there on your computer and you can plug it into your app and it's just as good as our serverless code.' And in the same way, we have escape hatches to use things in HTML and JavaScript. So if you have a funky calendar component that you really want to use, you know, it's better for your uses than Anvil's built-in calendar widget. What you can do is you can drop down to HTML and JavaScript. You can drive that JavaScript from Python. And then, and here's the cool part, you're not stuck in JavaScript thereafter. What you can do is you can drive that calendar component from Python and then you can define that as a custom component. So the Anvil form in which you've included this calendar widget, you can say, use as custom component. And then you can take your app and say, make this app as available as a dependency. And now you or anybody else can, in their own Anvil applications, add your app as

0:41:43.184 --> 0:43:10.940
<v C>a dependency and into the toolbox in the drag-and-drop editor, alongside Anvil's built-in buttons and date pickers and so on, will be your calendar widget. And somebody else can drag and drop it onto the screen. And you can define the properties and the events in your Python class. Because remember, the form you've created is just a Python class. And so you can define properties and events so it behaves like any other Anvil component. And so you've taken this piece of external JavaScript. You've wrapped it up as an easy-to-use Python class that can then be used, slotted right into other people's Python code and even the drag-and-drop editor. So, yes, we really, really, we are religious about making escape hatches for anywhere where our platform doesn't quite eke it out. And actually, there's a cool example of this. We're recording this just before Christmas 2020. And we're doing like an Advent calendar of a web app every day till Christmas. And the one we did a couple of days ago was a 3D Christmas tree. And that 3D Christmas tree is built using Three.js. We don't have native 3D support in Anvil, but that's okay because you can go from anvil.js.window.importThree and you can actually drive the Three.js JavaScript API from Python because we've got that bridge. And then you can wrap it up and use it as a drag-and-drop component somewhere else. That makes sense.

0:43:11.040 --> 0:43:14.039
<v B>Does this play well with Webpack? Probably not, right? That would

0:43:14.039 --> 0:43:42.799
<v C>be... The thing you would do would be you'd use Webpack to generate your JavaScript and then you would import that JavaScript. At that point, you'd be dropping down to JavaScript interfacing with those modules. And then you would do the bridge to Python. You're going to have to write that bridge. If you want to drop down to the low-level technologies like JavaScript, you're going to have to get some JavaScript on you at some point. The thing that we're concerned about is that we don't force you to drag the rest of your app into JavaScript as well.

0:43:43.120 --> 0:43:49.020
<v B>Yeah, that totally makes sense. But I don't know too much about Webpack. I assumed it would kind of mangle all the names and everything.

0:43:49.020 --> 0:44:20.660
<v C>The answer is that you tell Webpack your public APIs, and so Webpack knows which names not to mangle. So, for example, with Three.js, all of its internal stuff is going to be mangled. Sure, it's going to be minified. But the actual APIs you're using, like create this mesh, render this here, those names remain unmangled so that they can be used. Again, this is just, you do it just how any other JavaScript programmer would, because that's exactly how any other JavaScript programmer interacts with these libraries.

0:44:21.060 --> 0:45:01.540
<v B>Yeah, totally makes sense. So, yeah, this is awesome. I mean, everyone out there should try this out. There's a lot of people who are using Python. I mean, that's the language I recommend people kind of get started with. And it's really cool to see that there's a way to, Patrick and I always tell people, like, use it. Actually, this fits in perfectly with our advice, which before was pretty schizophrenic, which was, you know, 'Learn Python and build a website.' That's what we would tell people. It's easy to build a website. You don't have to write an installer, but you should learn Python. And don't tell us how you're going to do those things at the same time. And this episode actually completes our advice for once after what, 11 years or something.

0:45:02.180 --> 0:47:00.737
<v C>Well, I mean, the thing is, you're not the only people giving that advice, because, like, when you're facing someone who's just started a program, use Python is absolutely the right advice. You do not want, like, the first thing they do to be exposed to unshielded, like, JavaScript and HTML and DOM. They'll run away screaming. But yes, exactly. That's where everyone starts. And a web app is where everyone wants to finish. And there's, like, this, you know, there's the underpants gnomes, like, step one, learn Python. Step two, question mark, question mark, question mark. Step three, build a web app. And, you know, bridging that is explicitly what we're about. So tangentially related to this, because what this is really about is making building web applications more accessible. And accessible has two meanings here, really. Because, of course, like, if you have something that is difficult and complicated, the thing you want to do is to make it easy enough for novices to pick up. And absolutely, you know, if I went out onto the street and asked three people what does, you know, what would accessibility mean, that's probably what they'd say. But that's only half of it. Because if you just try to make something easy, what you make is like it's a children's playpen. You make something that is kind of a toy. And that does your users a disservice for two reasons. I mean, one, it's the people who are just starting. Like, they are just starting. They're not finished yet. And they need room to grow their powers. And if they're stuck in the kiddie section, then they can't grow. And that is doing them a massive disservice. But it also does a disservice to the rest of the world. Because, you know, just because I can write five different programming languages and five different frameworks to build a web app doesn't mean I want to. And it doesn't mean that anybody else in my company wants to wait for me to do it either. And so to be properly accessible, you have

0:47:00.974 --> 0:47:16.200
<v C>to be simple enough for novices and powerful enough for seasoned professionals. Because that's how you give the novices space to grow. And that's how you actually solve problems for the professionals rather than only solving problems for beginners. Because professionals have problems too.

0:47:16.660 --> 0:47:48.700
<v B>Yeah, that totally makes sense. Yeah. So one kind of question is a little bit different. Like, what inspired you? You know, give us a little bit of background on yourself. And this is an enormous undertaking. And what inspired you to say, you know, we're going to do this? I mean, there's probably, I mean, you could tell me, but there's got to be at least, I know, several, you know, people years worth of effort here. And what inspired you to really, you know, buckle down and build this?

0:47:48.700 --> 0:49:46.740
<v C>So my personal background is I started programming with QBasic back in the day. And, you know, I came up using these tools like Visual Basic as I was learning. And it was great because it meant that I could build real applications that looked like everything else, you know, on your system. Whether that was in DOS, it looked like any other DOS program. Or whether it was on Windows, you know, it had Windows and buttons and menus and so on. And, you know, that is what got me into programming. And I have an old university friend called Ian. And he came up very much the same way. And we ended up, I took a detour via biology because I already knew I loved computers enough that, you know, they would always be somewhere in my life. So I could go do something else that was fun at university. But I eventually came home and did a PhD focusing on building usable programming systems. And Ian was actually in the research group next door, also working on human-computer interaction. And he has exactly the same experience. He also came up, you know, building things in Visual Basic, tinkering stuff together with soldering irons. He's much better with his hands than I am. And if you have two people doing with that sort of professional expertise, and it's not about the professional expertise. It's people with that experience, people who knew how simple it was and get them looking at the web. There's going to be a lot of ranting about who, like, how this really unusable programming system possibly came to be. And, you know, having PhDs in it just means that we have, like, the fancy vocabulary in which to phrase those rants. But, like, we would have given those rants. And at a certain point, we just said, 'Well, like, we complain about this so much. You know, somebody should just build something like Visual Basic or Delphi for the web. It would solve so many problems.'

0:49:46.740 --> 0:50:05.379
<v C>And, like, I still have sort of trapped in amber the Google Hangouts message I sent to Ian, like, one, you know, one afternoon saying, 'This is a thing that really should happen.' Just got like, yes, in all capitals. And so, like, that's how it started. It was like once we knew it was a thing that we could do, we couldn't not do it.

0:50:06.020 --> 0:50:23.040
<v B>Yeah, that makes sense. So you were at some point a software engineer and you saw firsthand how painful this was. And how did you sort of make that leap to—so actually, well, let me step back. Are you doing Anvil full time?

0:50:23.580 --> 0:50:35.500
<v C>Oh, yeah. This is, like, it started as a project with a friend. Like, it's now, you know, a startup with nine people and growing nicely. Thank you very much, and profitable and all that fun.

0:50:36.700 --> 0:50:53.640
<v B>Yeah. And so how did you take that leap? I mean, it's such a leap of faith, right, to say I'm going to quit my day job and we're going to build Anvil. And, you know, and obviously in hindsight, you know, it's going amazing. But how did you kind of muster up the courage to go do that?

0:50:53.640 --> 0:51:46.160
<v C>So I do think one of our greatest privileges being in this industry is that there was less courage than it would have required for many other people. Like, I have friends who are professional actors. Like, that was huge courage. They're working without a net. Like, fundamentally, if it turns out, if it has turned out that nobody would have been interested in Anvil, you know, I could have come and knocked on the door of a bunch of employers and, you know, got a job fairly soon. And, you know, all that would have been would be a bit of missed earnings. I do think that the—I'm not sure courage quite covers it or maybe it's risk doesn't cover it. As it was, I was I was contracting at the time. Ian was working as a postdoc at the computer laboratory here in Cambridge.

0:51:47.815 --> 0:52:11.153
<v C>And so we—we already like we would meet up and work on projects in the evenings and weekends and so on. And so Anvil just became a project at Ian's dinner table. And as we built more and more of it, we got more and more excited about, yes, this could be a real thing. And so eventually we started, you know, we—we went down to like four and then three days a

0:52:12.874 --> 0:52:55.960
<v C>week because, you know, because we could work part time because, you know, we were young, fresh out of PhDs, not a lot of living expenses. And then we eventually just thought, 'Well, this is probably good enough to see what the world thinks.' And we put it up on Reddit, and Reddit just sort of bit our hand off. And we went, 'Oh, okay, right. People really are interested in this thing. We weren't imagining it. Okay, well, time to jump in.' And so we—we cranked ourselves up to full time. And we were just I think we were we were lucky because we worked in this industry that we had the savings. We had the ability to go to part-time work and build up the business until it could support us.

0:52:56.500 --> 0:53:47.400
<v B>Yeah, that totally makes sense. Yeah, I think that's great. Yeah. The part about Reddit really resonates. I think one thing a lot of people should be more encouraged to show things off. I think a lot of people are afraid. I remember when I was in university, I had some side projects that were terrible. And so I think if you Google my name, there's some—I don't remember if it's Reddit or some forum, but there's some forum post where I introduced some game engine that was, in hindsight, absolutely terrible. And it got completely torn up. But I learned so much, you know, from that experience. And to this day, I mean, we posted about Eternal Terminal on Hacker News and all of that. And I think, you know, being in those communities is actually something we didn't mention earlier, but that's another thing that I think beginners really should do is get kind of, you know, get yourself enrolled in some of these.

0:53:49.000 --> 0:53:49.315
<v B>Eternal

0:53:49.315 --> 0:53:55.920
<v C>Terminal is you. That's awesome. I didn't realize that. Awesome. Really pleased to meet you. It's a really cool technology.

0:53:56.560 --> 0:54:11.400
<v B>Cool. Yeah, I'm thinking about replacing SSH entirely, which would, you know, it would be adding a lot more to it. But, you know, a lot of people, the biggest complaint is that you have to open another TCP port. So, yeah, we'll see where it goes. Awesome.

0:54:11.620 --> 0:54:19.820
<v C>But anyway, yes. And I saw it because you put it out there. And yes, I mean, we honestly, we should have put Anvil out there like a year sooner, probably.

0:54:20.560 --> 0:54:38.720
<v B>Yeah. Yeah. Makes sense. Yeah, I think, you know, it's hard to do because you feel like, oh, if I make a bad first impression. But, you know, no one ever says, I put it out too early and I gave up on it. You always hear things in the other direction.

0:54:39.220 --> 0:56:01.160
<v C>Yeah. I mean, I do think anyone who wants not to believe that will believe that their case is special. I think Anvil is a little bit special because it's a development tool. And a development tool is kind of useful for everything or useful for nothing. And so there was a minimum level that we had to get it to in all of these areas. I mean, Anvil is a massive platform. I mean, we haven't touched on a lot of the stuff underneath the surface. But, like, it's a serverless app hosting environment. It's a drag-and-drop designer. It's a web-based UI toolkit in Python. It's a Python to JavaScript compiler. It's, like, off-the-shelf user authentication. It's got integration into, you know, Google APIs, Facebook, Microsoft, what have you—Stripe. You know, it's a task scheduler because, of course, you've got to be able to run scheduled tasks in your apps. It's got the uplink. It's got, I mean, I'm sure I'm missing stuff out. And we had this vision for this is, like, this is the end state we want it to be. This is what an ideal platform would look like. It would have all this power and be this simple. And we sort of kept measuring the difference between what we had and what it could be or would be. And instead, we should have been measuring the difference between what we had and what people were struggling with already because that would have got it out the door a lot faster.

0:56:01.960 --> 0:57:19.279
<v B>That is, you know, such a good point, actually. The whole, you know, logging and capturing what people want—I feel like we desperately need to do a show on this. You know, you build something. All of us, when we build things, we build it ultimately for other people because if a thousand people are going to use your program, 999 of them aren't you, right? And so you're building an app for other people and you're making a lot of assumptions about what they want, right? So, for example, for Eternal Terminal in the first versions, it had a way of it basically slowing down the delivery of contents that you could hit Ctrl+C. So if you goofed up and, you know, tried to cat a binary file or something, you could still punch out. But then it turns out people just didn't want that. And there was just a bunch of issues. A whole bunch of people were upset about it or complaining about it. And so I took it out and people were much happier. But it was just a lot of kind of trial and error and listening to issues and feedback. And there really wasn't, you know, any analytics. I mean, there's nothing that reports back from Eternal Terminal. And I think that that is such a missed opportunity because there's just so many things that we had to learn the hard way.

0:57:20.080 --> 0:59:13.540
<v C>That is a huge advantage of running a hosted service. And that's, I mean, one of the many advantages. It also means you can upgrade, you can ship upgrades, and you can ship rollbacks very quickly. I should mention, by the way, that there are disadvantages to being a hosted service as well. And if you think, oh, yes, you know, this would be great, but I couldn't possibly rely on someone else's hosted services for that. Like, we've got you covered. Don't worry. The answer is pip install Anvil app server. All of the Anvil runtime stuff is actually open source. So you can just, you can self-host an app. You can, in fact, you can build an app in a text editor and self-host it and never touch anything owned by us at all, if you really want to. But otherwise, you can build an Anvil and then you can just get clone it out of our repository onto your disk and then host it locally. But yeah, so local stuff is important. And I guess Eternal Terminal is one of those things that kind of wants to be a local application. And something like Anvil kind of wants to be a hosted application because, again, it's all about the escape hatches. You want to have, you want to have the escape hatch so that someone who says, oh, I'm running this on a Raspberry Pi. You know, I work at a TV station. We need to be able to carry on broadcasting. If the internet goes down, this has to be running on a computer in the building. True story. That's fine. You can do that. But the 95% use case is I don't want to worry about servers. I don't want to worry about hosting. I just want to click a button and have it there. And so Anvil kind of naturally gravitates to being a hosted service if you want to solve the problems that we're solving. Whereas something like Eternal Terminal gravitates to being something that's running on your own computer. And I think people's perceptions about telemetry change drastically because it's impossible to interact with a hosted service without creating logs. And I mean, we—Yeah, that makes sense. We are very privacy conscious with logs. Check out our privacy policy. We really do not.

0:59:13.880 --> 0:59:30.940
<v C>We really put effort into if you looked over our shoulder and you saw everything that we could see, you would not feel violated. That's the thing that's really important to us. Yep. But the bar for people's expectations for a downloaded program is somewhat different, I think.

0:59:31.400 --> 1:00:05.060
<v B>Yeah, it totally makes sense. Yeah. I mean, in any case, you need to be very diligent about anonymization. And you're really trying to look for macro trends. Like, you know, everyone who creates, you know, the button widget in Anvil, do they create it once and then never again? Right. That would be a sign that either there's something wrong with it or people just were discontent with it. And you're creating that basic telemetry and, you know, in a way that preserves people's privacy. I mean, that could easily be a whole show. I mean, there's a lot of content there.

1:00:05.820 --> 1:00:33.140
<v C>Yeah. We started. So part of the starting Anvil story I kind of elided is that when it was just the two of us and we were getting started, we actually were able to work out of an office in the computer lab, which is Cambridge's Computer Science Department. And one of the real benefits of that is being able to just walk down the corridor and, you know, ask people in the Security Research Group about problems like this. And that's something that was really valuable to us. Yeah.

1:00:33.339 --> 1:01:01.180
<v B>Yeah. That's awesome. I think that was good. I think the—yeah, basically the nutshell is, and I don't know if there's good sort of standardized libraries for this. I mean, I know there's like Segment and some of these things for collecting analytics on the web, but I don't know if there's sort of something generic there. But, but yeah, basically, you know, you want to try and get some kind of feedback to improve your app and pay attention to all the issues and all of that. I guess that's the sort of mantra.

1:01:01.480 --> 1:01:02.279
<v C>Yeah. I think that's fair to say.

1:01:05.859 --> 1:02:05.140
<v A>Hey everybody. We have a new sponsor, and that is ConfigCat. And I'm going to tell you a little bit about what ConfigCat is. It is a feature flag service. You can easily use flags in your code with ConfigCat libraries for Python, nine other platforms, toggle your feature flags visually on the visual dashboard, hide or expose features in your application without redeploying your code. Set targeting rules to allow you to control who has access to those new features. ConfigCat allows you to get the features out faster, test in production, and do easy rollbacks. With ConfigCat's simple API and clear documentation, you'll have initial proof of concept up and running in just minutes. Train new team members and minutes easily. So you don't have to pay extra for growing teams with a simple UI. The whole team can use it effectively. Whether you're an individual or a team, you can try it out with the forever free plan. Release your features faster and with less risk with ConfigCat. Check them out today at configcat.com.

1:02:05.740 --> 1:03:09.460
<v B>Cool. Yeah. For people who don't know what feature flags are, it's, you know, imagine you have something out in production and you want to change some kind of behavior. So you might say, you know, now use this other database, but then you do that and then it broke in and now you've broken it for everybody. And that's, that's kind of a nightmare. So, so what you want to do instead is you want to try something out on like a few people and then slowly kind of add more and more and more people. And one way to do that is to have a feature flag—have a flag says, if, you know, this is part of my test group of people, then switch to the new database. Otherwise use the old database. And, and slowly like that, if becomes true for more and more people. And so ConfigCat is a service that kind of handles a lot of that for you. So they can like handle deciding like who gets the feature and who doesn't. And then you can go in their UI and change all of that and slowly, slowly get it to a hundred percent. And they take a lot of that burden off you. So check them out. They're great. Yeah. So, so let's dive into the company. So is—is the company called Anvil?

1:03:10.206 --> 1:03:22.960
<v C>Oh, the, the company, the company is called The Tuesday Project Limited because Ian and I used to be on Tuesday, and we had agreed many, many, many years ago that if a startup ever came out of this, it had to be called The Tuesday Project. And so it is.

1:03:23.760 --> 1:03:36.600
<v B>The Tuesday Project. Very cool. So does the Tuesday Project have, you know, like internships? There's a lot of folks listening who are, you know, in the process of trying to find a place to intern at or find a place to work at.

1:03:37.037 --> 1:04:42.880
<v C>So the wonderful thing about living on a startup's timeline is that if you're recording an episode that's going to air in three months time, I genuinely don't know exactly what the state of our hiring is going to be at that point. But I would strongly encourage anybody who's interested to, I mean, sign up. Anvil is free to use. It's a freemium. You know, if you sign up for a free account, then you get like a banner on the top of your app, and basically that's it. If you sign up for an account and if you're on our mailing list, we will mail you when we are hiring. So that's like, that's the eternally true thing that we are expanding. We are growing nicely and very happy about it. So if you are based in the UK and you are interested in web development and being part of a team that does that, then do hop along and sign up for an account. And you can also go to anvil.works/jobs. And if we are, if we have a hiring window open at that point, then you'll see that. Otherwise, sign up for an account. We'll let you know.

1:04:43.440 --> 1:04:50.160
<v B>Yeah. And so what's a day in the life of, actually, how many people work on Anvil? You said it's about nine people.

1:04:50.580 --> 1:05:22.020
<v C>This is again one of those pieces of information that's likely to go out of date very quickly. But yes, there's currently nine of us. We're entirely bootstrapped. So we have not at this stage taken any venture investment. We are funded entirely by happy customers, which is a really great place to be from the perspective of one's blood pressure level heading into a global pandemic, for example. Oh my goodness. Yeah. Turned out to be fine. Actually, it turns out that a massive change of working causes a whole bunch of people to need to build new processes really quickly.

1:05:22.354 --> 1:06:03.620
<v B>Yeah, actually, you know, well, so yeah, maybe a bit of a tangent, but what is your take on venture capital, specifically around things like developer tools? I feel like in that area, I mean, I'll give you my take up front and then we could talk about it. I feel like the market is not really known well. And so it's not clear, you know, some of the venture capitalists want, they have really big ambitions. And so, for developer tools that might go to venture capitalists might be a mistake because the market might just not be that big and then you'll end up in kind of a bad spot.

1:06:03.620 --> 1:07:11.900
<v C>Yeah, I don't think insufficient market sizes are a problem. There are just shy, I think, of 10 million Python developers out there and many, if not most of the rest also do web development. So I think we're fairly comfortable that the problem we're solving is sufficiently huge. I think it changes your distribution of outcomes. Taking investment can also really help you if you are not as lucky as Ian and I were and you're not able to sort of slow burn work on this part time until it's something that's ready to show to the world and start selling. I'm not religious about this. I don't think that venture capital is a bad thing, even for development tools. Although I think the VC ecosystem writ large has swung and missed a few times on models for developer tools, and some of them have been more successful than others. I would say, you know, MongoDB was a win. Docker was a miss, despite the fact that Docker has completely transformed its target market. It's, yeah, barrels of open source business models there.

1:07:12.360 --> 1:07:17.420
<v B>Yeah, I think Kubernetes kind of took all the actual economic value.

1:07:18.623 --> 1:08:42.610
<v C>Yeah, I mean, well, this is okay, tangent to the tangent. Yeah, it's true. Okay, this is a reason that developer tools are difficult. If you're starting a company and you are thinking about releasing your company's main product as open source, and developers basically demand that at some level for a lot of the tools that they will take seriously, you have to answer the question of what do I do now I've given my whole product away for free? Somebody once, I'm blanking on his name, once said to me that if you open source, you no longer have a product. You have two products. You have one you sell and one you give away. And make sure the one that you're selling is actually worth something. This has actually worked out really well for us, because we do have the two products. We have the Anvil runtime for running your applications, and we have the editor for building them. And so we have open source the runtime. And we still, you know, we still have something that is worth people paying for premium features on. But I do think that from the last few years, we can take the lesson that if you are infrastructure that will be built on top of, you'd better have a really good story for why the fate of Docker is not going to apply to you. Yeah, that's really well said. Rewinding, where were we before the tangents to the time? Oh,

1:08:42.610 --> 1:09:29.520
<v B>Yeah. So, okay, so we were talking a little bit about VCs. And then I think the question I was going to lead into is, is what, what is it like to work on Anvil? Like, like, you know, I mean, I mean, okay, we can talk pre-COVID, right? So, so, you know, how is it different than, you know, people have this vision, especially folks in maybe university, have this vision, you know, you come into the office, there's a bunch of cubicles, everyone just sits down, no one talks to each other, you just write code, you all go home. It's sort of like the office space kind of model, right? And so, yeah, one of the things we try to do is ask people, what is unique about the sort of work environment and sort of the workplace that you've set up and just make it a little human for folks out there.

1:09:30.279 --> 1:10:30.640
<v C>To be clear, we are in the middle of a pandemic. We are working entirely from home. I desperately miss the office because I really like the people I work with. And I like being there to hang out and have lunch with them and have interesting conversations. I think something that is, I suppose, two things that make working at this company to be particularly fun. One, in terms of how much I enjoy being around the people is that because we make tools for developers, everybody in the company writes code. Whether they are showing people how to use Anvil or work on the core product or both, everybody is writing code. And so everybody, we sort of speak the same language and we all understand, like at a sort of deep visceral level, the problems we're solving and what isn't a good solution. And so it's really great fun that, you know, we pull everybody from the CEO to the newest developer advocates into the design meetings. And that's really, that part is really fun.

1:10:31.280 --> 1:10:40.820
<v B>Yeah, I think it's great that you all can speak the same language because at my job, half of us are speaking JavaScript, half are speaking C++. It's just, it's just the best.

1:10:41.120 --> 1:11:32.035
<v C>Well, and we all speak by, of course, I mean, a bunch of our team speak JavaScript because, you know, we build the Anvil editor and the runtime, which means that we spend an awful lot of time, honestly, pounding our head against the desk and saying, I am, you know, when some corner of JavaScript or browsers or HTTP bites us, we bash our heads against the desk and say, I am doing this so that hundreds or thousands of other people won't have to for whatever little feature we're working on. So yeah, that part's really great and that kind of alignment. I think also kind of because Python has a both Python, the language and the problem domain we're looking at and the sorts of people who are likely to know a little bit of Python, but not much else. And they are firmly within our

1:11:34.769 --> 1:12:50.100
<v C>Sort of targets means that we get to interact with a really interesting variety of people. So talked about, you know, people who arrived in a steaming hurry, having to build something: the microbiological diagnostic unit in Melbourne, in Australia, suddenly, sometime around the beginning of 2020, acquired a really, really, really urgent need for a system they could just, you know, toss gene sequences of viruses into and have it build a phylogenetic tree of like, okay, that sequence matches something that came from the other end of Australia. Check, you know, where did that person come in? Check that flight, trace it to other people. You know, are our infection control measures in school working? Like all of this really cool stuff. And I got to end up, I got to talk to this bioinformaticist at the NDU about like, how are people doing tracing in the pandemic? And like, you know, what does he use Python for? What tools is he building? How has their work been changed by the fact that it's all just sequence it and now it's all data science? It's not so much bench biology. It's toss it all into the sequencer and throw Python at it. It's how that lab works.

1:12:51.786 --> 1:13:06.704
<v C>And like, that's one example of thousands where people are doing interesting things that aren't, you know, that they're a little bit off the beaten track. Because if you build something that enables the people who are, for whom

1:13:08.712 --> 1:14:23.780
<v C>Building a web app wasn't accessible, if you make it accessible, just a bit more accessible, you will suddenly pull in all these people who are doing all sorts of non-traditional things and you will meet them and you will have a great time doing so. You also get to pull in like non-traditional staff. So, we have everybody from like one of our developers who's sadly just gone on maternity leave. I mean, great news for her, sad for us. She's great, sad for us. Just switched careers from financial services because she reckoned that programming was more fun. And we hired her, I think like six, nine months out of boot camp. And she hadn't really written Python before she got to us. And that's actually great. We love hiring people like that because those people are our customers, right? She really deeply understands what it's like to be starting out on Python and web development because that was her very recently. And now she gets to be at the leading edge of building the developer tool that solves that problem for everybody else. Yeah, that's awesome.

1:14:23.839 --> 1:14:59.480
<v B>Yeah, I think that would be so fascinating to meet the people who are, you know, because it's like the people who already have a website; they have that inertia, right? They would have to, even using the things we talked about earlier, they still would have to deconstruct to some degree their website. But it's the people who are just starting who are looking at this whole ecosystem and saying, 'Okay, where should my first line of code go?' And so, a place like Anvil gets a lot of those people. And I think that could be so exciting to see the next generation of web developers, right? I think that's awesome.

1:14:59.780 --> 1:15:18.440
<v C>Absolutely. You said like the number of people who type 'Python GUI' into Google and then keep typing variations on that because they've learned some Python. Everything so far has been really straightforward. This next step must be a way that's this straightforward for the next step, right? It can't possibly be this difficult.

1:15:19.220 --> 1:15:24.454
<v B>Yeah. What about for desktop? Do you have an integration with Electron or something like that? We

1:15:24.454 --> 1:16:49.620
<v C>don't. It's something that people have periodically talked about. It hasn't risen to the top of our list. It's not like the thing that most affects people. Going back to these people it's awesome to meet, I will take the opportunity I've resisted so far to plug our podcast because what we do is: oh, go for it. About once a month we get on a phone call with somebody who does something really cool and talk to them about what they do. So we've had like interviews with TV broadcast engineers because, you know, it turns out they were shifting, shifting to broadcasting over the internet. They needed to completely rebuild the system that when you're like, when your satellite box isn't working and you call up the customer service center and they go to tap, tap, tap, tap, tap—I guess it appears that that thing can't reach the Wi-Fi. So, let's move it to a better place with better signal. That whole system that collects and presents those diagnostics needed to be rebuilt because they were shifting to internet streaming. And the great story in this is that a TV broadcast engineer who's not a web developer was able to pick up and plug a web front end into the backend systems that run their TV broadcasts really easily without having to learn five different programming languages. But the really fun story for us is that I then got to interview with him, interview him. And I got to learn about how TV broadcasting works, which is something like I hadn't encountered in a million years.

1:16:50.140 --> 1:16:54.740
<v B>Yeah. The real programmers, right? The ones who are setting up the program for tomorrow's show.

1:16:55.800 --> 1:17:02.380
<v C>Yeah, absolutely. So yes, it is really great meeting this huge variety of people who do all sorts of stuff. It's really fun.

1:17:02.900 --> 1:17:11.695
<v B>Yeah, this is awesome. So how are ways that people can kind of get ahold of you and get ahold of or learn more about Anvil? Right.

1:17:11.900 --> 1:17:51.559
<v C>Well, the first thing to do is to go to anvil.works and hit the build link because it's free to use. We have a bunch of tutorials; try it out and see what we mean about how our development ought to be. That's the first one. If you want to find me, I am Meredith on Twitter. That's M-E-R-E-D-Y-D-D. You probably want to click the link in the show notes for that one. What nationality is that? Is this Irish? Welsh. Oh, Welsh. Okay. Got it. Welsh is one of these languages. It's like Polish. It's 100% completely phonetic, but you show the letters on the page to an English person and they make the most amazing face.

1:17:52.500 --> 1:17:52.980
<v A>Yeah.

1:17:53.380 --> 1:18:04.300
<v B>Cool. I think, um, is, is Welsh is, is, uh, so this is going to show my total ignorance of, of geography here, but, but Welsh is, it's Southwest, right? Of, of the whole UK.

1:18:04.519 --> 1:18:15.260
<v C>Yes. Wales is on the Southwestern end of the UK. Most people who live there speak English, but a lot of them are also bilingual in Welsh, and that includes my family.

1:18:15.700 --> 1:18:16.620
<v B>Oh, very cool.

1:18:16.620 --> 1:18:21.940
<v C>I feel like I've slightly earned the right to make everyone suffer through spelling my name.

1:18:22.340 --> 1:18:38.520
<v B>Yeah, that's right. Yeah. I think we'll definitely put links to the show notes and everything. And so, you know, definitely check out anvil.works. Oh, one thing we didn't cover that I want to circle back to really quick is, especially for students, what is free and then what costs money?

1:18:39.280 --> 1:19:17.700
<v C>Right. Okay. So what is free is pretty much everything I've talked about. So the design, the hosting, the serverless Python, the uplink—all of that stuff is free. If you're using a free account, there are two limitations. One is that you'll get a banner on the top of your app saying, made with Anvil. And the other is that there are going to be some limits to the libraries you can import in the serverless environment and your server modules. That, and this is just because we're hosting code from random strangers from the internet on our servers. So you're

1:19:17.700 --> 1:19:25.024
<v B>saying I can't train my neural network? I can't train my neural network using your serverless functions and you have to pay for it? Correct. You can't

1:19:25.024 --> 1:20:31.820
<v C>train your neural network on our servers, but if you want to bring your notebook up and connect it to the uplink and train your neural network there, you can absolutely do that on the free plan. Oh, interesting. So yeah, the idea is you can do everything. And of course, you can use the open source app server wherever you are, whatever you're doing. So there are, you can use everything in Anvil for free. What we do offer is paid plans so that they make life easier for you, that take some of the sting out of the hosting. If you want to run a neural network in the cloud without having to worry about this computer with a Jupyter Notebook must stay up at all times, then you're welcome to take out a plan with us, that kind of thing. You work on a team, you want to collaborate with your colleagues, that kind of thing. We offer that the goal is that anyone can use it. It's a real development tool—rock up and give it a try. Something else I should mention, by the way, for all the educators listening, if you're using Anvil to teach a school or university course, all of the features are completely free. Just drop us a line at education@anvil.works.

1:20:32.300 --> 1:20:37.160
<v B>Oh, very cool. Good to know. Yeah. We'll have a lot of that and we'll have students asking their teachers to do that.

1:20:37.580 --> 1:20:38.970
<v C>Absolutely. Well, bring it

1:20:38.970 --> 1:20:41.029
<v B>on. Cool. So what is your debut

1:20:41.029 --> 1:20:47.300
<v C>of your podcast? Oh, stories from the workshop. You can get it at anvil.works/podcast.

1:20:47.720 --> 1:21:33.980
<v B>Cool. Stories. Okay. So we'll have all of this in the show notes. We'll have Meredith, Twitter. We'll have Anvil works links. So, so check out the show notes. If you're in your car or something, wait till you get home and then check out the show notes, but we'll have links to everything over there. And there's a ton of information for folks out there. If you build anything with Anvil, even if it's your first Hello World, drop us a line, send us an email—programmingthrowdown@gmail.com. Send more—edit that an email and come back this. Yeah. We love to see that. It is so satisfying to hear stories from people and to see the things people have built. It really fills our bucket. So, definitely don't hesitate to reach out.

1:21:34.180 --> 1:21:45.289
<v C>And again, if you are interested in jobs, careers, internship stuff, again, sign up and just stay on our newsletter, and we will let you know if and when we are next hiring. Yeah.

1:21:45.660 --> 1:21:54.030
<v B>And in the meantime, go to check out these things like was it Sculptor? Is that right? The Python thing? Sculpt. Yeah. Check out

1:21:54.030 --> 1:22:27.900
<v C>this technology. If you want a survey of Python in the browser stuff, a colleague of mine actually wrote, gave a talk at PyCon UK last year. It was last year that conferences were a thing. So, 2019 as a webpage write-up, we can also put in the show notes—that's like comparing Sculpt and Brython and Transcrypt and Pyodide and PyPyJS and like why we chose what the choice made the choices we did for Anvil. So you can go check that out as well. And please do sculpt project. We always love getting more contributors. So yes, check us out. Submit a PR.

1:22:28.500 --> 1:22:51.360
<v B>Yeah. I mean, there's no better signal than the ideal interviews where someone just sits with your team for a week. That's my take on it. And so, there's no better proxy for that than someone who contributes. I know personally we've hired people who have contributed to our open source projects. So I have firsthand experience with that, and yeah, it's super important.

1:22:52.000 --> 1:23:28.059
<v C>So, I said that Bridget, one of our developers, just went on maternity leave, and her maternity leave cover who has now been made permanent because he's so good is somebody who was on our forums contributing to stuff, maintaining open source and all components for other people to use. And so by the time it got to the point of hiring, we just sort of took a look at him when went—yeah, yes, yes. We definitely want to hire him. We have worked with him. We know exactly what he can do. Sold. So that's a routine. And yes, he was also contributing to Sculpt as well by the end of it. He's a really good chap.

1:23:28.420 --> 1:23:39.094
<v B>Wow. Very cool. Awesome. Hey, Meredith, this is amazing. I really, I'm super motivated to try this out. I actually have a project that I can try it out with even today. And promise

1:23:39.094 --> 1:23:41.620
<v C>me you'll send an email with the link. I really want to see it.

1:23:42.240 --> 1:24:05.920
<v B>I will actually. Yeah, I'll definitely do that. I hope to share everyone, the next sort of thing that I'm trying to cook up. And I think Anvil would be perfect for it. So thank you so much. I think that this taught me a lot. I think it taught the audience a lot about the web and about this new way of programming for the web. So this is super exciting. I really appreciate you coming on.

1:24:06.260 --> 1:24:08.860
<v C>Well, I had a great time chatting to you. So thank you very much.

1:24:09.140 --> 1:24:29.280
<v B>Cool. Thanks a lot. And everyone out there, thanks a lot for all of your support on Patreon and by supporting us through our Audible subscriptions. And everyone, stay safe out there. I think by the time this makes it to the air, maybe we'll have like the vaccine in many people's hands. I really don't know. It's all speculation at this point.

1:24:29.280 --> 1:24:38.580
<v C>We've already started dosing here in the UK and I cannot wait to get back and hug people and get back in the office and stuff.

1:24:39.460 --> 1:24:44.740
<v B>Yeah, exactly. Yeah. Well, so everyone stay safe out there, and we'll catch you next episode. Thanks very much.

1:24:58.238 --> 1:25:00.398
<v A>The Programming Throwdown

1:25:01.900 --> 1:25:18.820
<v B>is distributed under a Creative Commons Attribution ShareAlike 2.0 license. You're free to share, copy, distribute, transmit the work, to remix and adapt the work, but you must provide attribution to Patrick and I, and share alike in kind.

