Devreal

Fika Interview with Guido van Rossum

Fika Interview with Guido van Rossum

Recording: Fika Interview with Guido van Rossum

Uh hello everybody. Uh I'm Alexi Kraber of the AI community architect at Neo Forj uh the graph database company out of Sweden and uh here uh with us uh at Pi Bay the 10th anniversary we have Guda Frosum the creator of Python. We're very fortunate. Welcome Guido. >> Nice to meet you. >> Uh hello everyone. And uh we're doing uh uh as a company we do graph rag and we're in the midst of AI we're just a graph database but we do a lot of uh integrations for open source and it was really great to see you talking about structured rag uh and what was huge surprise you're basically one of the cool kids doing AI now by virtue of doing rag [laughter] so uh how did you come to uh do that u you know specific project uh in at Microsoft. >> Uh the origin is that I had spent almost four years working on faster C python with a great competent team and I thought for myself it was time to uh move on and try something else

And by then uh this was about October last year, it was clear that that had to be in the direction of AI. >> Mhm. >> Because the whole company was a buzz with AI and like you everybody had every product has to have a co-pilot basically. >> Mhm. [clears throat] >> The year before everybody was running around like headless chickens uh trying to do the same thing. [snorts] Uh so I had been playing a tiny bit with AI myself uh discovering limitations of embeddings. My initially my dream was to write uh sort of a code analyzer that I could ask questions about a large body of code that I had access to but that I didn't understand >> either not at all or not well enough. Uh I eventually I I I I wrote three or four versions of that

Uh the first few were terrible. Uh at at some point I gave up. Uh but sort of I had that idea in mind and I don't exactly know how the office of the CTO uh became my target. I think some people said, "Well, you could go there because they uh they do advanced AI stuff and they would love to have you." >> Mhm. >> Uh so I approached the office of the CTO and they said, "Well, for what you're interested in doing, there are really two projects reporting directly to Kevin with the CTO uh that you might uh be interested in." And so after working with both projects uh I sort of ended up with Stephen Luc's project. >> Mhm. >> That's the story. >> Yeah

This is great. And I met you know your colleagues and they told me that your group is called AI systems. >> Mhm. >> So is it the idea to do systems like distributed systems or software systems supporting [clears throat] AI? So that's an example database indexing information supporting AI. I actually don't know the origin of that term so I'll I'll decline answering that. >> Okay. I mean I I like systems right like distributed systems and you know a lot of AI is basically data right so now everything is AI but I think everybody now understands that unless you have data sets you cannot really do AI and so you gave examples right so you have corpus of email or you know Montipython uh text and so so you you you index and you put from what I understood right you put um information before instead of just you know putting them as random vectors you structure them and and So by virtue of having structure they are better searchable >> exactly >> and give better results. uh I I want to follow up and so so I come from functional programming background you know high skill skull and all this stuff and so I've been you know first of all amazed how Python became the language of AI and and now like we are all using Python so but then I' I've seen something interesting uh everybody's using piantic in AI specifically and I think the origin from what you know apocryphal stories I heard is that lench chain folks were the first to use it uh and I think Harrison Chase used this opportunity to learn Python by writing a client for OpenAI and for some magic they used paidantic and so because lench chain became foundational in open source AI ecosystem everybody picked pyantic from this and so what I've heard from pyantic there are 70,000 packages in python using pyantic and so almost every open source AI package in python is using pyantic now so when pyantic cuts to a major version

So we have Neforj Python graph package which is using pyantic and we inter in integrate with lang chain which is using pantentic. So we had to have a meeting when they're upgrading the version of pyantic we have to go and lock step. So and pantic basically is a is a type system for python right. So this is basically written in rust. >> That's not how I would describe it at all but sure. >> So I'm curious I'm I'm just curious. So do you like again uh I you know as as a guy coming from a type type like very strongly type languages I was looking for familiar things and so I found pyantic and then I was surprised that it's it's it's been picked up. So do you think it's but there are other ways to do types in Python

I just wonder like what do you think of this phenomenon like rise of pentantic like do since more and more people use it for all kinds of data do we need more types do we need to annotate data like you have a structure if this structure is formally uh and you show typescript right so typescript would like that thing would have a a type in in typescript will be a record do you think like something like python is is is timely should be a part of python itself is if it's used so widely like what's your thought on types for Python at this point in Python. >> Well, you know, Python has a static type system. >> Correct. >> Yeah. Uh which I helped create although Yuka Lettoello is the real creator. I just >> encourage him to make it compatible with Python instead of a pre-processor. >> No, in the Python world, nobody wants to use a pre-processor, >> right? >> Anyway, we have that type system and Pantic came uh Oh, yeah. And one sort of more or less accidental property of Python's type system which is in contrast with TypeScript is that Python types are runtime introspectable

I don't even remember the reason why we did that except that we put a sort of a fledgling support for type for annotations in functions uh in Python 3.0 long before we grew this type system. >> Yes. Yes. But sort of by making the the initially the annotations were forced to be runtime introspectable because it was just an expression that was evaluated >> and that the value of that expression was not used to influence the Python interpreter in any way but it was curled away in a magic attribute of the function. >> Mhm. >> Called dunder annotations. So uh at some and and sort of as the type system grew, we kept this property of type annotations must sort of leave behind when you evaluate them the normal way just as an expression. >> Mh

>> They must leave behind an object that represents all the aspects of the original uh or at least all the relevant aspects of of the original annotation. >> Mh. Like if you if you say this argument is a union of int and string >> uh you would end up an object that says union and it would have two attributes or a list of attributes that is int and string and for int and string we just use the existing uh built-in uh classes. So, Panti came along and made good use of that uh runtime runtime introspection and they I thought and but I'm not an expert on the history of Bantic. My understanding was that their original application was JSON validation >> for web servers or or like REST interfaces where you could validate that if someone sent you a request and it it was formatted JSON that didn't just parse using the JSON.load load because that's kind of a trivial requirement, but that it followed a certain schema and that things in that schema uh were sort of they they added some things to the schema in a sneaky way. Well, there's there's an escape syntax in the type annotation syntax now >> where they can add annotations like not only must this this be an integer, but it must be a positive integer less than 100 or something like that. >> Then they have like little notations for all that. And so that made it a very useful annotation language >> uh for validation of JSON which initially I think was especially important just for for any web UI

Yeah, a lot of uses JSON and so speeding up JSON already gives you a lot of >> value. >> Mhm. And so they they made a nice mapping between Python classes and uh JSON data >> where you can sort of you you can say here's a class and here's a blob of JSON. now is now sort of try to make an instance of this class from that blob of JSON and it either gives you a valid instance of the class or it gives you some error that says that JSON didn't actually have all the information I needed. >> Mhm. >> Uh how exactly they then became important in AI, I don't know. Possibly because there's lots of JSON data around in that world. >> Mhm

>> Uh so they use Rust just to make it faster. I didn't know that their first version was in Ras. >> Yeah. So the I don't Yeah, that's a very good question. >> Currently certainly is. >> Yeah, we have a community conference, you know, in in November. Yeah, by the way, and uh Samuel Coven, the founder is coming to to talk about it. So I'll definitely ask him that this because what I found again I I came to JAI open source ecosystem fairly recently

You know, I was running communities of people doing like distributed systems like Kafka and Spark and and doing and so but because all AI is now Python. So you know uh I I found that I mean >> all but a lot >> a lot of it right so it's a huge success I think Python basically is what facilitated uh AI on training side too right so PyTorch is basically the major training infrastructure >> the fact that PyTorch existed uh I think pushed the entire AI community in the direction of Python a little bit >> the other I think part of that origin story probably has to do with numpy >> Mhm. Mhm. >> Uh and its usefulness for machine learning. >> Yes. >> Where instead of JSON data, you have data that is like millions of numbers in arrays. >> Yes. >> Uh and Python already had a great solution for dealing with that efficiently uh in the form of numpy, >> right? And all of AI is basically matrix multiplication

So if you right if we have matrix multiplication so so I I wonder what you think of this because Python I think uniquely of all the languages >> is interfacing with all kinds of native languages right so in like PyTorch is basically Python API into a blob of C++ I'm simplifying things and so Pantic is basically you know using Rust underneath to ingeniously use this annotations and so Python is flexible it allows you to use things like annot like like who knew this annotation ations will be used for for like embedding a new kind of type system and and using Rust or C++. So, Python always like interperate with this. So, what like was it your initial intent that it will be effectively an API language uh or you just come because of the design? the design sort of the the the aspect of Python's design that you describe is called extension modules or extensions. >> That was in the language pretty much from day one. >> Mhm. >> Uh [clears throat] the reason was that I invented Python in the context of a novel operating system that had its own quirky uh IO primitives. And so I wanted Python to work on Unix, but I was also wanted to Python to work on Amoeba, which was this quirky distributed operating system >> which didn't natively support files or processes or at least if when it did that sys calls were totally different. But basically there was only one type of sys call you make a request to a capability

So I knew that if I wanted to you wanted to be able to use Python with AoE which was my stated reason for developing it and uh letting my hobby time with Python uh bleed over in work time. I knew I didn't want to bake AMA primitives into the language. >> Mhm. But I I had to have some way and so I knew that I had to have extension modules. The initial extension modules weren't even dynamically loaded. You had to sort of edit a little table somewhere in the deep in the source code and then re rebuild Python from source. And it wasn't I think five years later or so people started telling me hey did you know that there's dynamic linking [laughter] and I said sure sent me a patch the extensions uh because they were always in the language and and sort of quickly gained more power especially through dynamic linking uh uh they've always been sort of a very powerful mechanism to interface Python with everything else in the world whether that is the Windows file system or the Linux file system or >> a set of Mac APIs uh or a big library that that exists like uh in the early days XL lib was an extension I think so you could communicate with an X window server >> right and [clears throat] that was always my plan and it was it was also a form of self-defense in the community because there were lots of people who came to me saying, "Oh, Python is great." >> Mhm. >> But I can't do this particular thing with it

>> Mhm. >> And so >> having extension modules as an answer where I said, well, that is just an API with a bunch of functions. So you can write an extension module >> uh and sort of invent a mapping between Python objects and types >> and uh the native objects or data structures of that library. Often they didn't even have objects. So [clears throat] then you map to uh to tupils or or things like that. >> Mhm. >> Anyway, that was always my sort of defense against people who said we need to change Python to support this or that. No, you can you can do this yourself

Even better >> then a I don't have to maintain it or think about how to implement it and b you can have your own release schedule which is more than uh once per python release. >> So that was a centrome informatics. Yes. >> So I wonder right so this sounds like a great place and you know recently we've seen duct DB another very efficient compet another thing which developers love. I wonder what is it about the culture of CWI? Is it pragmatic culture? Like what what made this place uh the birthplace of Python? Is there something special about it or just serendipity? >> I would say it was a classic research lab where researchers were given a lot of freedom to sort of develop interesting ideas into working code. There was also a whole the half of of CWI is very mathematical and abstract. >> There's some very abstract computer science happening there too. But there's also a very pragmatic practical uh side of the institute that that sort of build software and and sort of >> so the both releases releases it as open source

when when I started, Python was I think the only the first thing that CWI ever released as open source >> and I'm [clears throat] still sort of I feel so lucky that that they let me publish Python as open source. Mhm. >> The term open source hadn't even been invented but the concepts were around >> because uh the X window system which was something that we actually worked on. We had people working on that. Uh and that was distributed under a very sort of lenient license that later became one of the standard open source licenses, the MIT license. >> Right? >> So I adopted that and uh crossed out uh the regions of uh Massachusetts Institute of Technology and wrote CWI in Crayon and that was all we did to the the license. uh and that that worked well. >> This is great

Uh one question is you know somebody come from function programming can help asking and wonder if it's true or not. So there was like maybe a few years ago this apocryphal story that you know Python got lambda and map functions and there was a paragraph attributed to you that you regret adding them to Python and I and and basically like the four comprehension [clears throat] the four comprehension is easier for developers to read than the map. And I wonder if this is true, if this is something you wrote or this some somebody made it up. Well, I don't know the particular paragraph, but I do remember expressing at various times some regrets over the particular form that that this little bit of functional programming in Python took because I >> I wasn't myself familiar with functional programming and I think I had a pretty wrong concept of what functional programming was. >> Mh. So initially we had lambda which which is an inline function that is in expression form instead of in statement form. >> Yes. >> Uh and we had map filter and reduce

>> Correct. Which is practically most of the [clears throat] functional programming for >> well that for most >> for some people that's functional programming. I almost immediately took a great dislike of reduce. >> Mhm. >> Because I could I I wasn't I hadn't grown up with list or APL. >> Mhm. And as soon as code used reduce even once I would completely lose track of what that meant because I'm I'm used to a certain procedural style of coding and whether it's alol or forran or Pascal or C or C++ that's all the same JavaScript TypeScript C all those languages use the same kinds of paradigms >> for most of the coding. Some some of them like Python have have little functional or functional like corners but most of the code that you write most of the time is procedural

>> You write loops. >> Exactly. Listen, arrays and loops. That's what makes computers interesting. And that that's what they're good at honestly. [laughter] >> Oh yeah. And if that's about it. >> That's right

functions for abstraction are just a luxury. Fortune had all of this and for exactly >> uh so I I didn't know exactly what I admitted into the language and somehow the person who pushed the idea uh was was very very persuasive >> uh and came with a complete patch >> that that applied flawlessly and everything worked as promised. Mhm. >> And it was understandable. Uh so we put that in. So I then I started regretting a reduce. Then with Python 3 sort of one in Python 2, one of the warts with the functional stuff was that map and re map and filter at least uh produce an entire array. >> Mhm

uh which loses a lot of the elegance of using map and filter if you sort of stack them. Maybe you write multiple filters and you begin or end with a map or there's a >> so they're eager, they're not lazy, they're not they were eager and so for each level of intermediate result, you'd get not have another array and as long as those arrays are like a 100 or a thousand long, nobody cares, honestly. But if if you have some real data and it's a million lines, a million data objects, then you really don't want to have several arrays of uh of length a million >> a million each [clears throat] uh all sitting around until you're done with your computation, >> right? >> Uh and so that's why we changed it in Python 3 just like we changed keys and values of dictionary to also be >> Yeah. So this is I mean I really appreciate it because you know I was always curious and basically what what you know you said now I think that kind of confirms this the paragraph was about like this is not Pythonic style. So like the full comprehension is just more more [clears throat] it does the same thing but it's more understandable visually for the developers >> because also it can be faster and especially since I think 312 or so when Carl Meyer did an enormous amount of work on uh how list comprehensions are implemented or comprehensions in general >> uh and so to reduce the overhead but the the the key difference is that when you have A lambda a lambda is implemented even though it had this different syntax. It's implemented at exactly the same as a defaf. So it's a function. >> It has a stack frame

>> Uh it has arguments. It returns a value. >> The syntax you use to do all that is different. >> But you can make lambda work pretty hard. >> [laughter] >> Uh the problem with that is if you have a simple lambda like is lambda x colon is x greater than zero. >> Mhm. >> Because you only want the positive entries from a list. And if you if you call that a million times because you have a list of million floating point numbers that you want uh to filter that function call overhead cost you way more than all the loop overhead uh together

>> Mhm. >> And so this is where list comprehensions because they don't have a function call overhead they don't necessarily have their own stack >> right >> can be faster >> right makes sense. And what I found personally >> and we have a lazy version too even though they're called generator expressions they use the same mechanisms right >> and the same syntax >> you know I was looking because you know the period when I was you know switch to python I was looking for functional kind of libraries like nobody's really using this in you know pythonic code people are using lambdas and map and reduce they're doing like and I found like actually >> because they've been obsoleted by comprehensions largely >> right yeah so that's I mean that's interesting so that's good you I was able to clarify that for posterity. Uh so I mean so now that you're in you know like basically you know Python is powering revolution you're in the midst of it now you're here at Microsoft at the systems group [laughter] I still feel like I'm standing on the sidelines and that's that's where I like to be at this point in my life. I >> soon I turn 70. >> It's now a young age right? [clears throat] 70 and you're 30. So, no, no, I don't feel it that way. I've had a hip replacement

I need a cataract surgery. Uh, I got a lame knee or at least a wobbly knee. Uh, I need more sleep. And I sleep, my sleep is worse in quality. So, uh, I don't feel as productive. My memory is often uh, very leaky. I don't remember won't remember the names of any people I I met here. I [clears throat] will we'll remember the faces though

That's >> maybe we put them in the graph rack. I mean I'm you know [laughter] >> uh kind of >> but anyway I I'm looking forward to retirement in the next few years >> but still right like I mean I think it's it's amazing you basically you know created the language which is now everybody in San Francisco everybody in the right [laughter] the kids are coming to Python they don't know what graphs are so you know we're in a graph database they think graphs are charts so THAT WAS MY [laughter] >> right they think graphs are charts they think graphs but what what's what's interesting right uh So, so what's amazing to me that Python so ubiquitous a lot of people who never study computer science they pick it up and they are able to do it and now because the of vibe coding right whatever it is like I mean it's uh it's now the you like now cloud code cursor you know copilot they're producing like gobs and gobs of python >> honestly if you ask them to produce typescript they can do that just as well >> and they do typescript but what do you think >> or or almost any other language I'm convinced never tried it but I'm I'm convinced that they they know all the languages well enough. >> So the final question is basically you know now that basically you know so you're basically okay with VIP coding it's good for use like converting sync to a sync >> I want to I don't call that vibe coding because uh I know exactly what the outcome is and I actually I always go over the diff >> and for that particular diff I knew what to expect. Basically, there would be a bunch of defs that had async in front of them and a bunch of calls that had a weight in front of them and those were the only expected changes. >> And so I just sort of paged through the diffs making sure that that those were in fact the only changes it had applied. >> Yes. >> And uh I paged through the mon this this was a lot of pages. [clears throat] >> And then I said okay I can commit this

>> Yes. And in other cases like that inspect disaster, I also found out just by looking at the generated code or the generated. >> So you reviewed all the all the changes >> basically. Every once in a while I'm I'm lazy and I think well it passes the test so what and several times I've regretted that. >> So I mean but this is a great story right? So so given right like given with the state we are in. So we have this whole AI ecosystem Python basically everywhere right and even VIP coding or agentic coding emerging. So what do you like we have a lot of students here right? What what would you would your advice to young people here? What should they study? Like so they study Python. I think everybody should study Python at this point like any even if you're nontechnical or coming to AI, you probably should study Python

>> There are plenty of people who just don't have a head for coding and who would who you just make miserable if you force them to study Python. So I would I would [clears throat] take that with a grain of salt. Mhm. >> Uh in general, I'm I'm a coder. I get endorphins from coding. >> I am not a teacher. Uh I am not a life coach. I have no idea what to tell students [laughter] that you got to you got to have a more specific question

Someone asked me a similar question like what advice do you have for uh >> for new engineers, right? And I I gave the exact same answer. And then he started asking and he had specific questions actually he he ended up asking about how I used AI and what I thought of it >> and that there I had an answer. >> Okay. >> Okay. I mean what you've just heard >> from what you described right like it sounds to me then folks who do VIP coding should think of this as a is a good use case instead of right like making because a new problem of the cloud code would make stuff up but like massive refactoring massive change which is kind of well understood is something that uh is good at right so maybe >> and it's not vibe coding >> it's not vod that that >> not all code generated or updated by an LLM is vibe coding, >> right? >> It's vibe coding when you don't care about what the code looks like. When you don't review that diff, >> you only care if it works. >> Yes. And if underneath it has written a million lines of spaghetti code, you couldn't care less because the next time you want to change something in that that pile of spaghetti code, you're also going to ask the LLM uh to make the updates

And if in order to add your simple feature, it has to write another million lines of code or well, who cares? >> Yep. >> And that is VIP code. to and that and that that's I thought where where sort of [clears throat] uh Eric Meyer was was standing on five code. >> I don't think that's his idea. I mean >> not anymore. Okay. >> Yeah. I think I think he delegates that right to LLM runtime but again I need to know more but I think that you know the code which people write becomes very high level

So I think the real question now you know if the prompts we're writing should be natural language or should be new AI first languages which will be like English but more be like more prologue like which more structured and the problems will be composable that's I think that's >> I don't know now you have to teach people how to write that prologue and the first thing they will go to is they will ask an LLM to write the stupid prologue. [laughter] So I don't think that that's not a solution at all. I mean what I started with actually was uh large collection of interfaces and implementation classes that had been carefully coded by a crack team, people who really knew what they were doing. They knew the language. They knew the problem. They were sort of developing answers for the problem as they were going. >> Uh [clears throat] but they ended up with like a list of public interfaces. These are interfaces like this is the minimum spec for a message

Yes, >> this is the minimum spec for a conversation. Yes, >> these are the methods on conversations that you can call. These are the types that they return. And by and large, >> all I had to do was translate that to Python syntax, which was also a a task that uh a model did pretty well. >> Both especially the specs, but also the the actual implementation code. I definitely had to sort of also review that carefully and catch [clears throat] the occasional weird thing. But Python and Typescript are close enough together that it wasn't so such a big deal. >> Mhm

uh it became harder when I started to add the SQLite uh back end which meant I had to sort of invent from scratch >> an API for uh for a storage provider. >> Mhm. and we did a good whiteboarding session with my team over three days uh I don't know I think in August or so uh where we came up with a rough sketch of the schema and the APIs for that uh that storage provider abstraction uh and then it was straightforward to fill that in and and still the LLM I guess I didn't write carefully enough what I it. But I don't think that having to write it in the form of triples would have helped much. Uh but by sort of reviewing what the LLM did and keeping the parts that that were okay, every once in a while I made a small manual correction. Usually I thought, well, if the LM wrote the code, it can pretty well correct it as well. Uh so if I saw a typo somewhere, I would just tell it there's a typo online such and such of this file. Fix it and and we do it

>> Yep. Yep. >> I I wonder [laughter] since you you mentioned translation TypeScript to Python, it just occurred to me the creator of Typescript is also at Microsoft. Do you talk to him? Do you guys talk? Yes. >> Yes. Well, >> Steve is also involved, my boss. I don't know if you met him. >> Yeah

Yeah. Great guy. uh he anders sort of are together the origins of Typescript. So I but I do actually talk to anders regularly. >> Uh he was even my onboarding mentor when I started 5 years ago. >> Interesting. So this is great. >> He's a great guy

I he's totally a great guy. >> I just talked to Steve you know because you know it immediately occurred to me that the you know what you do is basically very suitable for graphs because all the names you extract and structured information can be nodes and can be interlink. So he's going to look at using Neo forj as a back end as a storage back end. So I and I will definitely be happy to work with him to see because if we can put all of this into Neo forj we have all the same workers but now we can link them for inance all the names of a person we can create a note and so maybe we can take it further and have more fun with it. So that was my inspiration. >> You know you could you you could try uh just contributing uh Neo for storage back. Correct. Yeah

I mean that sounds like a great thing. So thank you very much. I think now I understood your talk even better after you explain [laughter] hopefully you know this FAI episode will be a nice complimentary you know material to the main talk and so we really appreciate you know this opportunity and really happy you know to meet you and thank you so much and wish you >> you're welcome you know many happy years of contributing to Python and >> [music]