Michael Kennedy: For years, building interactive widgets in Python notebooks meant wrestling with toolchains, platform quirks, and a mountain of JavaScript machinery.
Michael Kennedy: Most developers took one look and backed away slowly.
Michael Kennedy: Trevor Mance decided that barrier did not need to exist.
Michael Kennedy: His idea was simple.
Michael Kennedy: Give Python users just enough JavaScript to unlock the web's interactivity without dragging along the rest of the web ecosystem.
Michael Kennedy: That idea became anywidget, and it's quickly becoming the quiet, connective tissue of modern interactive computing.
Michael Kennedy: Today, we dig into how it works, why it's taken off, and how it might change the way we explore data.
Michael Kennedy: This is Talk Python To Me, episode 530, recorded November 25th, 2025.
Michael Kennedy: Welcome to Talk Python To Me,
Michael Kennedy: the number one Python podcast for developers and data scientists.
Michael Kennedy: This is your host, Michael Kennedy.
Michael Kennedy: I'm a PSF fellow who's been coding for over 25 years.
Michael Kennedy: Let's connect on social media.
Michael Kennedy: You'll find me and Talk Python on Mastodon, Bluesky, and X.
Michael Kennedy: The social links are all in your show notes.
Michael Kennedy: You can find over 10 years of past episodes at talkpython.fm.
Michael Kennedy: And if you want to be part of the show, you can join our recording live streams.
Michael Kennedy: That's right.
Michael Kennedy: We live stream the raw uncut version of each episode on YouTube.
Michael Kennedy: Just visit talkpython.fm/youtube to see the schedule of upcoming events.
Michael Kennedy: Be sure to subscribe there and press the bell so you'll get notified anytime we're recording.
Michael Kennedy: Look into the future and see bugs before they make it to production.
Michael Kennedy: Sentry's Seer AI Code Review uses historical error and performance information at Sentry
Michael Kennedy: to find and flag bugs in your PRs before you even start to review them.
Michael Kennedy: Stop bugs before they enter your code base.
Michael Kennedy: Get started at talkpython.fm/seer-code-review.
Michael Kennedy: And this episode is sponsored by JetBrains and the PyCharm team.
Michael Kennedy: This week only through December 19th, 2025, get 30% off of PyCharm Pro, including renewals,
Michael Kennedy: and PyCharm will donate all the proceeds to the Python Software Foundation.
Michael Kennedy: Support the PSF by getting or renewing PyCharm.
Michael Kennedy: Visit talkpython.fm/pycharm dash PSF dash 2025 and use the code STRONGERPYTHON.
Michael Kennedy: Both of these are in your podcast player show notes.
Michael Kennedy: Trevor, welcome to Talk By Than Me. Awesome to have you here. Thanks for coming.
Trevor Manz: Yeah, thanks for having me, Michael.
Michael Kennedy: We're going to talk about building Lego blocks for data scientists. Is that maybe a good way to put it?
Michael Kennedy: Yeah, definitely.
Michael Kennedy: Yeah, so we're going to talk about your project, AnyWidget, which is a super cool project that allows people to build more adaptable, more reusable widgets,
Michael Kennedy: rather than just saying I'm going to build it for Jupyter or Remo or whatever.
Michael Kennedy: but I'm going to build something that can be used broadly through your platform and a lot simpler
Michael Kennedy: deployment as well. So I know a lot of people out there are excited. Not everyone necessarily wants
Michael Kennedy: to build widgets, but this also makes more widgets available for people, right? So super cool project.
Michael Kennedy: Yeah. And before we get into that, of course, maybe just tell us a bit about yourself.
Trevor Manz: Yeah. So I'm Trevor. I'm a software engineer at Marimo, but prior to being at Marimo, I was
Trevor Manz: doing my PhD in data visualization at Harvard Medical School. So I got into this whole like
Trevor Manz: Python web world from working on tools for biological scientists to explore like large
Trevor Manz: genomics or spatial genomic data sets. That is a super interesting topic. I'm sure
Michael Kennedy: there were some really niche things you had to build, right? Like, you know, we have this crazy
Michael Kennedy: research machine. There's three of them in the world and here's the data that comes out of it.
Michael Kennedy: how do I put that into notebooks or whatever, right?
Trevor Manz: Yeah, yeah, exactly.
Trevor Manz: And it's funny you mentioned that.
Trevor Manz: I think starting off in more like the visualization side,
Trevor Manz: we'd build these very bespoke and custom applications
Trevor Manz: for looking at large biological data sets.
Trevor Manz: And then I think a motivation for me was realizing
Trevor Manz: a lot of the folks that I was working with
Trevor Manz: to build these tools for worked in Python
Trevor Manz: and worked in notebooks specifically.
Trevor Manz: And so there was sort of this gap between the research
Trevor Manz: that we were doing to build these specialized tools
Trevor Manz: and trying to meet users where they were at
Trevor Manz: to actually use those tools in their research
Trevor Manz: and as a part of their data exploration workflows.
Michael Kennedy: - And this was your PhD work?
Michael Kennedy: - Yes, yeah, this was my PhD work.
Michael Kennedy: - Incredible.
Michael Kennedy: So I'm sure it wasn't just Python.
Michael Kennedy: - No, so--
Michael Kennedy: - What was involved with it?
Trevor Manz: - So yeah, I'd say the research community,
Trevor Manz: at least in bio, is sort of split between R and Python,
Trevor Manz: but specifically some of our closest collaborators
Trevor Manz: were in the Python ecosystem.
Trevor Manz: And then my team was building a lot of user interfaces
Trevor Manz: for visual exploration of data sets.
Trevor Manz: And I think this notebook sort of became this space
Trevor Manz: and specifically Python notebooks
Trevor Manz: where you can really blend those programmatic
Trevor Manz: and user interfaces together.
Trevor Manz: That's sort of why I centered on trying to solve
Trevor Manz: some of the rough edges
Trevor Manz: about bringing these interactive tools inside of notebooks.
Michael Kennedy: - That's cool.
Michael Kennedy: Did you do any other platforms?
Michael Kennedy: I'm thinking like Unity or Reel,
Michael Kennedy: a real engine for like flying through data or what else did you all do?
Trevor Manz: Yeah, there were some folks on my team that ended up or are currently working in more like spatial,
Trevor Manz: like AR, VR type scenarios.
Trevor Manz: And that I think is based on the Unity engine.
Trevor Manz: Most of my work was like web-based and we, and specifically, and we'll probably get into it.
Trevor Manz: I think the web is just a really important platform to develop for in the sense that,
Trevor Manz: I mean, we're recording right now in a web browser.
Trevor Manz: It's a very capable platform that everyone sort of has an entry point to on some sort of device.
Trevor Manz: And so developing for the web often means that you can reuse a lot of that application amongst different devices and in different contexts.
Michael Kennedy: It's unbelievable what the web can do these days.
Michael Kennedy: I made the comment before we started, like, I can't believe this is a web browser that we're building, that we're doing this live streaming, video sharing, local recording.
Michael Kennedy: All this stuff is just like, it's so wild.
Michael Kennedy: And I built an app recently that I'm using to kind of help out with some of the interview
Michael Kennedy: stuff.
Michael Kennedy: And it's on the web.
Michael Kennedy: It just runs on my iPad.
Michael Kennedy: I mean, it goes underappreciated some of the time, I think, of just how far you can push
Michael Kennedy: it.
Michael Kennedy: It's not just documents and Ajax.
Trevor Manz: Yeah.
Trevor Manz: The fact that a version of Photoshop runs in the browser is pretty amazing.
Trevor Manz: And Figma itself is all running in the web browser.
Trevor Manz: So it's definitely a capable platform.
Trevor Manz: But one thing it's not very good at is, or doesn't have the ecosystem for, is a lot of
Trevor Manz: data work.
Trevor Manz: And I think that that's really the big divide.
Trevor Manz: So I see the web is really like
Trevor Manz: one of the most accessible platforms
Trevor Manz: for building like user interfaces and like applications.
Trevor Manz: But then there's this whole other world,
Trevor Manz: which is like tools that you actually do data science stuff in.
Trevor Manz: And that is not the web whatsoever,
Trevor Manz: but has like a similar amount of maturity
Trevor Manz: in terms of being very ergonomic and good
Trevor Manz: at doing that type of work.
Michael Kennedy: - Right, and those two worlds meet in,
Michael Kennedy: they meet in the web, right?
Michael Kennedy: But the people doing the Python work, they aren't necessarily web developers.
Michael Kennedy: You gave a talk a year ago about anywidget that I'll definitely link to.
Michael Kennedy: And you have this graphic here like, okay, we've got the front end, which often is Jupyter.
Michael Kennedy: Not always, as we'll see in a minute.
Michael Kennedy: But often is Jupyter with the way you build for it is with all these web front end tools
Michael Kennedy: that even me doing web development is a lot of times I'm like, what is this?
Michael Kennedy: And why is it so complicated?
Michael Kennedy: I just don't even know.
Michael Kennedy: And I do web stuff all the time.
Michael Kennedy: And then you've got the backend stuff
Michael Kennedy: where Python people live doing NumPy,
Michael Kennedy: pollers, AppLotlib, et cetera.
Michael Kennedy: Do you want to riff on that challenge a little bit?
Michael Kennedy: Because I know your project is really here
Michael Kennedy: to kind of solve some of this disjointedness.
Trevor Manz: Yeah, I think one interesting thing,
Trevor Manz: like taking a step back,
Trevor Manz: and I mentioned this in the talk that I gave a while back,
Trevor Manz: but like the web and Python ecosystems
Trevor Manz: have been around for almost the same exact amount of time.
Trevor Manz: Like I think like the first webpage
Trevor Manz: was around the same year that the first release of Python came out.
Trevor Manz: And so they sort of have been evolving in their own respective,
Trevor Manz: or developing their own respective ecosystems for that period of time.
Trevor Manz: And then as the web became really this platform for building user interfaces,
Trevor Manz: I think that some pretty visionary folks saw that you could connect
Trevor Manz: these backend resources to these very interactive applications
Trevor Manz: that could be developed very quickly.
Trevor Manz: So over the years, these things that started off very far apart
Trevor Manz: have now come very close together.
Trevor Manz: And now with WebAssembly, sometimes it's just all the,
Trevor Manz: like turtles all the way down,
Trevor Manz: it's all actually running in the browser.
Trevor Manz: So it's pretty amazing.
Trevor Manz: But I think that there definitely is this friction.
Trevor Manz: And one thing I've also noticed from being in both these,
Trevor Manz: the web and Python ecosystems for so long
Trevor Manz: is sort of these like ebbs and flows of like maturity
Trevor Manz: or like places that need to catch up to one another.
Trevor Manz: And so I came from definitely like the website originally.
Trevor Manz: And there's a lot that I took for granted, I guess,
Trevor Manz: and that ecosystem of tooling that for a while, I think,
Trevor Manz: gave the language a very bad rap
Trevor Manz: because it was sort of the scripting language that was invented,
Trevor Manz: I think, famously in two weeks.
Trevor Manz: And now people are trying to build applications in it.
Trevor Manz: But over the years, there have been standards and things have matured.
Trevor Manz: And actually, the web is very backwards compatible
Trevor Manz: and has some of these properties that are kind of amazing
Trevor Manz: for something that's been around for that long.
Trevor Manz: And then I'd say in the last couple of years,
Trevor Manz: we've seen a bunch of new developer tool work going into the Python ecosystem that in some part
Trevor Manz: is also inspired by some of the tooling in the web ecosystem. So I love to see how these things
Trevor Manz: go back and forth. And I think if you haven't checked in on the ecosystem for a while,
Trevor Manz: you might think it isn't what it was five years ago as it is today. And one of the goals of AnyWidget
Trevor Manz: is to try to demystify some of maybe those prior bad experiences folks had developing and just
Trevor Manz: you know, get back to like opening up some HTML and writing some JavaScript and getting your Python
Michael Kennedy: data in the browser. Yeah, absolutely. You know, I wonder, as you describe it being made in two
Michael Kennedy: weeks, which I also think this is true, when it was made, I think, at Mozilla, right? Yeah. Anyway,
Michael Kennedy: one of the JavaScript's real issues is it doesn't have a real numerical system, right? Everything is
Michael Kennedy: afloat. That has a lot of problems for data science when it really, really has to be integers
Michael Kennedy: or whatever, right? Like you need more control over the numbers. I wonder how much of Python's
Michael Kennedy: benefit in the data science space originates from people going, JavaScript's super popular,
Michael Kennedy: but can't do numbers there. I do science, can't do JavaScript. What am I doing now? You know what
Trevor Manz: I mean? What do you think about that? It just occurred to me. Yeah, it's interesting. Like that
Trevor Manz: is originally like a constraint of the language. And maybe, you know, when you're picking ecosystems
Trevor Manz: on. Also, there was no server way to run JavaScript until 2010. So the idea of just running this
Trevor Manz: without a browser was also not very good. So yeah, I'm not quite sure, but it's funny because
Trevor Manz: JavaScript has sort of reacted to that by adding some big ints as a data type. But also now there's
Trevor Manz: sort of like a fourth language for the web, which is WebAssembly, and there are proper data types
Trevor Manz: in WebAssembly. So I guess it is sort of reactionary, but I haven't really seen. So now you can run
Trevor Manz: Python in the browser. And, but you'd have to have all this like ecosystem grift or migration that I
Trevor Manz: just don't think anybody wants. So it's more, maybe these ecosystems can play a lot nicer together.
Michael Kennedy: Yeah. Yeah. And certainly they are with things like Jupyter and stuff, right? Like most users
Trevor Manz: of Jupyter don't write JavaScript. Yes. And I think that everyone's happy about that. So
Michael Kennedy: exactly. That's true. There's a lot of people are like, you know what, that's not for me.
Michael Kennedy: So, you know, you were at Harvard doing your work and now you're at Marimo?
Michael Kennedy: Marimo?
Michael Kennedy: I always mess up saying this.
Michael Kennedy: Tell us how to do it.
Trevor Manz: It's Marimo.
Michael Kennedy: Marimo.
Michael Kennedy: Okay, Marimo.
Michael Kennedy: Yeah.
Michael Kennedy: And I'd actually on, and I know we talked a lot about it and he set me straight and then
Michael Kennedy: I drifted, I'm sure.
Michael Kennedy: So what's your experiences here?
Michael Kennedy: Like, how's it coming from academia to this world?
Trevor Manz: It's been great.
Trevor Manz: I think that having worked with, so part of AnyWidget was trying to address some user needs working inside of Notebooks.
Trevor Manz: And there's only so much that you can do as a plugin to get that extra bit to help users.
Trevor Manz: And so I think one really exciting thing about working on this team with Marimo is they got very involved,
Trevor Manz: or they were aware of AnyWidget a while ago, and they kind of actually legitimized AnyWidget as,
Trevor Manz: hey, this is a standard because we were able to implement around this specification.
Trevor Manz: And so that got us together.
Trevor Manz: And then from there, it's just been super exciting to work with a team that is so passionate about notebooks and thinking about this next generation of notebooks and what that environment needs to look like.
Trevor Manz: And so there's much more that we can do inside of Marimo beyond the AnyWidget specification, but also AnyWidget is an important component of that.
Trevor Manz: So I like to be able to sort of think about both of these two worlds.
Michael Kennedy: That's cool.
Michael Kennedy: So when I use widgets in Marimo, it's often an AnyWidget?
Trevor Manz: Yep. Yeah, exactly. So if when folks usually come and they want to like extend Marimo with their own custom UI elements, like our answer is you should make an AnyWidget. So that's pretty exciting. But then if you're using things in like the sidebar or things that like sort of integrate outside of like the notebook view, those aren't more custom elements that we've created at Marimo that aren't necessarily based on AnyWidget.
Michael Kennedy: This portion of Talk Python To Me is brought to you by Sentry.
Michael Kennedy: Let me ask you a question.
Michael Kennedy: What if you could see into the future?
Michael Kennedy: We're talking about Sentry, of course,
Michael Kennedy: so that means seeing potential errors, crashes, and bugs before they happen,
Michael Kennedy: before you even accept them into your code base.
Michael Kennedy: That's what Sentry's AI Sears Code Review offers.
Michael Kennedy: You get error prediction based on real production history.
Michael Kennedy: AI Sear Code Review flags the most impactful errors
Michael Kennedy: your PR is likely to introduce before merge using your app's error and performance context,
Michael Kennedy: not just generic LLM pattern matching.
Michael Kennedy: Seer will then jump in on new PRs with feedback and warning if it finds any potential issues.
Michael Kennedy: Here's a real example.
Michael Kennedy: On a new PR related to a search feature in a web app,
Michael Kennedy: we see a comment from Seer by Sentry bot in the PR.
Michael Kennedy: And it says,
Michael Kennedy: potential bug, the process search results function,
Michael Kennedy: can enter an infinite recursion
Michael Kennedy: when a search query finds no matches,
Michael Kennedy: as the recursive call lacks a return statement
Michael Kennedy: and a proper termination condition.
Michael Kennedy: And Seer AI Code Review also provides additional details
Michael Kennedy: which you can expand for further information
Michael Kennedy: on the issue and suggested fixes.
Michael Kennedy: And bam, just like that,
Michael Kennedy: Seer AI Code Review has stopped a bug in its tracks
Michael Kennedy: without any devs in the loop.
Michael Kennedy: A nasty infinite loop bug never made it into production.
Michael Kennedy: Here's how you set it up.
Michael Kennedy: You enable the GitHub Sentry integration on your Sentry account.
Michael Kennedy: Enable Seer AI on your Sentry account.
Michael Kennedy: And on GitHub, you install the Seer by Sentry app
Michael Kennedy: and connect it to your repositories that you want it to validate.
Michael Kennedy: So jump over to Sentry and set up code review for yourself.
Michael Kennedy: Just visit talkpython.fm/seer-code-review.
Michael Kennedy: The link is in your podcast player show notes and on the episode page.
Michael Kennedy: Thank you to Sentry for supporting Talk Python To Me.
Michael Kennedy: Why Marimo?
Michael Kennedy: I know I had Axion people talked about.
Michael Kennedy: When I look at this, it feels like a super modern UI that is just,
Michael Kennedy: it's got a lot of polish and a lot of, it feels 2025 and working with it, right?
Michael Kennedy: And it solves some of the, I consider Jupyter Notebooks like the world's most insane,
Michael Kennedy: not the world's most insane, the second most insane series of go-to statements
Michael Kennedy: that have no record of how you got the go-to,
Michael Kennedy: you know, it doesn't even say go to 10.
Michael Kennedy: It's like, well, what did you go and run?
Michael Kennedy: I don't know, like, look at the numbers,
Michael Kennedy: but there's like potentially, you know,
Michael Kennedy: some lost as you rerun them.
Michael Kennedy: And it solves that problem as well.
Michael Kennedy: But like, you know, what's the elevator pitch for Marimo?
Trevor Manz: Yeah, my elevator pitch for Marimo
Trevor Manz: is that I think notebooks are incredibly important
Trevor Manz: and that it's hard to deny that like they're a tool
Trevor Manz: that many folks use to do their daily work.
Trevor Manz: But there are very few like guardrails
Trevor Manz: to help you do that work and work on a team with other folks.
Trevor Manz: And so I think one of the big selling points to me with Marimo
Trevor Manz: is just that you sort of get to free yourself
Trevor Manz: from thinking about those go-to statements,
Trevor Manz: and instead you have this very deterministic execution
Trevor Manz: that sort of just feels natural.
Trevor Manz: As you write cells, they will re-execute.
Trevor Manz: And then on top of that, I think that Jupyter and Marimo
Trevor Manz: have slightly different goals.
Trevor Manz: So Jupyter, when I showed that diagram,
Trevor Manz: we had that diagram before,
Trevor Manz: you have this split between these diversity of front ends.
Trevor Manz: So that's like you could use it in Colab,
Trevor Manz: you could use a Jupyter kernel inside of VS Code,
Trevor Manz: you could use a Jupyter kernel sort of within the Jupyter CLI.
Trevor Manz: But then there's all another requirement of that ecosystem
Trevor Manz: is to support many different kernels.
Trevor Manz: So it's not just Python, it could be an R kernel,
Trevor Manz: it could be a Julia kernel.
Trevor Manz: And so I think ultimately attention that ends up happening
Trevor Manz: is like a priority of that ecosystem is to support all these languages
Trevor Manz: and all these different front ends.
Trevor Manz: And instead, by just focusing on Python,
Trevor Manz: we can really try to develop a really integrated
Trevor Manz: and rich experience specifically for Python notebooks.
Trevor Manz: So the trade-off there being some folks come and they say,
Trevor Manz: oh, we'd love Marimo, but for R.
Trevor Manz: And we're like, well, we can't really do that.
Trevor Manz: It's called JupyterLab.
Trevor Manz: Yeah, but we are hyper-focused on Python
Trevor Manz: and that lets us integrate with other trends within the ecosystem too.
Trevor Manz: So we're a huge fan of all the work from the astral folks.
Trevor Manz: And we have a tight integration with uv, for example,
Trevor Manz: to allow you to sort of use that PEP 723 script metadata.
Trevor Manz: And as you're working, we'll like install packages for you
Trevor Manz: and write that metadata so that at the end,
Trevor Manz: you can send that document to someone else
Trevor Manz: and they can like bootstrap their notebook
Trevor Manz: and get all their dependencies
Trevor Manz: and have their environment set up.
Trevor Manz: And I think that type of like last mile with these notebooks
Trevor Manz: is something that's been hard to get at
Trevor Manz: without really focusing on like an ecosystem.
Michael Kennedy: That last mile though, that's a lot of polish.
Michael Kennedy: And that's often what kind of gets lost
Michael Kennedy: in projects where, I don't know, it's not exactly the focus, right?
Michael Kennedy: It's something where you want to take on the most interesting features
Michael Kennedy: and it's not like it's necessarily a company
Michael Kennedy: and there's somebody who's like,
Michael Kennedy: no, we're polishing every little rough edge, period.
Michael Kennedy: You know what I mean?
Michael Kennedy: And I think you mentioned Astral and uv.
Michael Kennedy: I think that is an example of they got funding
Michael Kennedy: and it's like, okay, we're not going to do 95% of the packaging.
Michael Kennedy: We're going to do 99.9% of the packaging.
Michael Kennedy: You know what I mean?
Michael Kennedy: And it's made a tremendous difference.
Trevor Manz: Yeah.
Trevor Manz: Yeah, I mean, I have plenty to say about Astro.
Trevor Manz: We love all their tooling over here too.
Michael Kennedy: Yeah, so do I.
Michael Kennedy: I switched all my stuff to Astro and it's to uv and rough and yeah, super, super neat.
Michael Kennedy: Okay, so another thing that you all just released is a new VS Code plugin.
Michael Kennedy: So I guess one of the aspects of Marimo that is not necessarily apparent from looking at
Michael Kennedy: it going there is that it's backed by a Python file, not a JSON file that contains both the
Michael Kennedy: inputs and outputs, which is like one of the big shortcomings of Jupyter. Like how much of Jupyter
Michael Kennedy: would have benefited if it just had an input in an output file? So you don't check in the output
Trevor Manz: file potentially. You know what I mean? Yeah. Yeah. We, I think that was pretty visionary or maybe it
Trevor Manz: was just, it's more that we have this ability to observe what's happened in the Jupyter ecosystem
Michael Kennedy: and make adjustments from there. A little bit of a second mover benefit of like, we saw that,
Michael Kennedy: That was 80% good.
Trevor Manz: Definitely.
Trevor Manz: Yeah, it was surprising.
Trevor Manz: I mean, I think to rip more on Marimo,
Trevor Manz: just there are all these,
Trevor Manz: when people ask that question of like why Marimo,
Trevor Manz: I think there are all these like very small things,
Trevor Manz: but like that in net, I think are certainly
Trevor Manz: like a order of magnitude kind of like richer experience
Trevor Manz: for our users.
Trevor Manz: But it's funny how many times just the fact
Trevor Manz: that like our notebooks are get diffable,
Trevor Manz: that's like one of the first things
Trevor Manz: that folks like really latch onto
Trevor Manz: and love about Marimo notebooks.
Michael Kennedy: Yeah, yeah, very cool. And so the VS Code extension, what's the, like, how's this, how's this help us?
Trevor Manz: Yeah, so I see this as, I think the best experience with using Marimo will always be sort of our CLI or like our, our web interface that we've like really curated around this experience.
Trevor Manz: But we have a broad range of users that want to collaborate or work on Maremo documents.
Trevor Manz: And so some of them are like, you know, I live in my VS Code, my cursor, my Windsurf, my IDE, and like I never want to leave this environment.
Trevor Manz: And so getting them to come and like collaborate on these documents has been a little bit of a barrier there.
Trevor Manz: So they could, of course, edit a Python file on disk, but having like a native notebook view like they do for Jupyter was something that we sort of lacked in those environments.
Trevor Manz: And so we made it a priority shortly after I joined the team where we really wanted to address that user base of folks that want to live in that editor environment.
Trevor Manz: And sort of from the ground up wrote this new extension where we have a very integrated view with sort of reactive outputs, similarly to what we have in our user interface.
Trevor Manz: But it sort of lives inside of the VS Code ecosystem and uses the VS Code APIs.
Michael Kennedy: Yeah, that makes a lot of sense.
Michael Kennedy: and it's available on the, what is it?
Michael Kennedy: VSX open marketplace for like cursor and anti-gravity.
Michael Kennedy: That's a thing as of like three days ago.
Michael Kennedy: Yes, all these different skins of VS Code,
Trevor Manz: our extension should work as well.
Trevor Manz: And we publish it to both marketplaces.
Trevor Manz: So folks should be able to install it and get started.
Michael Kennedy: It's a weird time for editors.
Michael Kennedy: Yes.
Michael Kennedy: It was really kind of straight.
Michael Kennedy: When I first started Talk Python 11 years ago
Michael Kennedy: or whatever it was,
Michael Kennedy: I would ask people what editor they use
Michael Kennedy: at the end of the show
Michael Kennedy: I didn't know what they were going to say. It could have been anything. And then it just narrowed
Michael Kennedy: down to VS Code, PyCharm. Those are the answers. And now it's kind of back to a lot of options
Michael Kennedy: again. But it generally works in the VS Code variants as well. All right. Super cool. Okay.
Michael Kennedy: Let's talk about just what is a Jupyter widget? Yeah. So like I mentioned before, Jupyter really
Trevor Manz: reaches, and Marimo also, reach across this chasm between your Python code that's running in some,
Trevor Manz: we call it like a kernel environment that's like a stateful environment that has your variables and
Trevor Manz: when you run cells like things update there and then on the front end there's like the cell outputs
Trevor Manz: that um are reflection of like whatever is sort of like living in the kernel and a jupiter widget
Trevor Manz: is like a very interesting part of that like uh of that uh crossing of that chasm and that
Trevor Manz: you can actually author both the front end code and the back end code to talk to one another so
Trevor Manz: typically it's like you're if you write a python library you're only writing something that runs
Trevor Manz: on the server. And then if you're making a Jupyter extension, for example, that's something that only
Trevor Manz: lives in the front end. But a widget allows a library author to connect those two worlds together.
Trevor Manz: And so for your small object that lives in the Python kernel, you can define ways that it can
Trevor Manz: render itself and also be updated from that front end. And so it's a very powerful mechanism that's
Trevor Manz: officially a part of Jupyter that allows you to extend your output cells with, I like to think of
Trevor Manz: it as these web-based superpowers to be able to update your code in the kernel.
Michael Kennedy: You have a really interesting point that you made in your SciPy talk, saying basically,
Michael Kennedy: we can do lots of UI stuff in notebooks, but often those are kind of like isolated snapshots,
Michael Kennedy: right? Maybe you have a graph and there's like outliers or something along those lines,
Michael Kennedy: but you can see them, but you can't like programmatically interact with them in the
Michael Kennedy: way that you could a widget, whereas you might drag and select to get a zoom area that actually
Michael Kennedy: becomes a data frame, or you could move some widgets that then redraw the picture, but also
Michael Kennedy: becomes something you could program against in like a machine learning algorithm or whatever,
Michael Kennedy: right? Maybe I think that's a pretty powerful distinction that people want to have in mind as
Trevor Manz: we dive into anywidget. Yeah, definitely. I like to think of it as like in a traditional like
Trevor Manz: REPL kind of environment, like your two modes of input are sort of like writing code and running
Trevor Manz: so you can write the code and you can run the cell and then you can observe the output but in order
Trevor Manz: to like act on something that you see in that output you have to write more code so um if you
Trevor Manz: have a plot for example that you produce from one of those outputs if there's some outliers or
Trevor Manz: something a very natural thing to think is what is that point and you want to like circle that point
Trevor Manz: and that is much easier to do with a gesture than it is to express as some sort of like
Trevor Manz: query in in uh typing out some program and kind of looking at the axes to say like what are those
Trevor Manz: points there. And so I think widgets really allow for you to be creative in terms of how you
Trevor Manz: might like another mode of input for adjusting things that might be in the kernel. And like
Trevor Manz: you're saying, now you can transform a selection into just a data frame that you get out and now,
Trevor Manz: and then you're off to the races with running the next part of your program. And so I think it,
Trevor Manz: it adds this degree of freedom to like let the algorithms and data, like use code when that's
Trevor Manz: useful. And then for those pieces where you want to step in as a human and maybe use a gesture
Trevor Manz: and that's easier to express as a gesture,
Trevor Manz: then we have that mechanism now
Trevor Manz: to allow you to extend your analyses.
Michael Kennedy: Right.
Michael Kennedy: If you don't need pictures and interaction,
Michael Kennedy: just do it in Python straight.
Michael Kennedy: You know what I mean?
Michael Kennedy: You don't need notebooks.
Michael Kennedy: And part of the value of notebooks
Michael Kennedy: is this mix of like a visual plus code plus visual
Michael Kennedy: and this sort of iterative back and forth between those.
Michael Kennedy: And widgets reconnect the visual
Michael Kennedy: back to the code, I guess, right?
Trevor Manz: Yeah, exactly.
Trevor Manz: I like to think of it as the types of workflows in notebooks
Trevor Manz: are not typically batch scripts.
Trevor Manz: I mean, in Marimo, you can write your notebook
Trevor Manz: and run it as a script because it's just Python.
Trevor Manz: But often when people are working
Trevor Manz: and really getting their hands on data,
Trevor Manz: these are long-lived sessions
Trevor Manz: where you have a lot of data in memory
Trevor Manz: and you really want to get your hands on that data.
Trevor Manz: And I think if you only had the ability
Trevor Manz: to write and run cells and not add that extra dimension,
Trevor Manz: it would be pretty limited to what you could actually do.
Trevor Manz: And so something like widgets allows you to really extend and be creative with how you'd like to explore that data and sort of like debug your data as it's in memory and get your hands on it.
Michael Kennedy: Yeah.
Michael Kennedy: I mean, that's what blew the world open when all that came around, right?
Michael Kennedy: Yeah.
Michael Kennedy: So that brings us to anywidget.
Michael Kennedy: Why a new widget framework?
Michael Kennedy: Why not just IPy widgets or whatever?
Trevor Manz: Yeah, it's a great question.
Trevor Manz: And it's something that when I started my PhD, like I was not, I guess I didn't really have a hand on either.
Trevor Manz: But AnyWidget was definitely born out of a need of myself to like solve a problem that I was running into during the PhD.
Trevor Manz: So as I mentioned before, we had all these visualization tools that we were building sort of in.
Trevor Manz: And specifically, one of the tools I was building was a like a web-based genome browser.
Trevor Manz: And so this is something that people put their genomes into and you can align different tracks and you can zoom in and try to understand like different types of things.
Trevor Manz: types of functional assays in genomics.
Trevor Manz: And then we had users that wanted to use these inside
Trevor Manz: of computational notebooks.
Trevor Manz: And one thing that immediately happened
Trevor Manz: when we tried to build these integrations for notebooks
Trevor Manz: is that you'd spend all this engineering effort trying
Trevor Manz: to build an integration for a specific notebook.
Trevor Manz: But then someone would come in and say, oh, I'd actually
Trevor Manz: want this to work in Google Colab,
Trevor Manz: or I need this to work in VS Code,
Trevor Manz: or I need this to work in this other environment.
Trevor Manz: And all of those environments are very similar on the back end
Trevor Manz: but they're very different on the front end
Trevor Manz: in terms of the way that you can register like front end code.
Trevor Manz: And so it ended up putting a lot on a library author like myself
Trevor Manz: to try to build those adapters for each of those environments.
Trevor Manz: And so anywidget was sort of an attempt to standardize
Trevor Manz: maybe how we can write that front end code
Trevor Manz: such that it's more,
Trevor Manz: and then we can build those adapters in one place
Trevor Manz: that then we can support all those different environments.
Michael Kennedy: Right, right.
Michael Kennedy: We talked about building the widgets
Michael Kennedy: largely in JavaScript earlier already,
Michael Kennedy: but I think what people maybe who haven't tried this
Michael Kennedy: don't realize is how many variations you would have to build to say, have I also, I wanted to
Michael Kennedy: work in Jupyter and I wanted to work in Colab and you've got to build and publish the PyPI and NPM
Michael Kennedy: and right. There's like, so everyone who built one of those had to, and wanted to cross use,
Michael Kennedy: they had to do all those adaptation, adaptation. So, and your thought was basically, well,
Michael Kennedy: I could create an adapter that everyone could use and then we don't have to do this ever again.
Trevor Manz: Yeah, exactly. And to what you're saying as well, I think that adapter craziness that's in the web ecosystem of like, oh my gosh, I had to transpile my code into all these different formats.
Trevor Manz: It's kind of a nightmare in terms of tooling. And it's something that came as a result of the state of the JavaScript ecosystem being pretty immature before 2018.
Trevor Manz: And basically because JavaScript didn't have a module system.
Trevor Manz: And so everyone had to come up with a way to bundle code.
Trevor Manz: And there are all these third-party adapters.
Trevor Manz: They're figuring out a way that they could load JavaScript modules.
Trevor Manz: And so whatever these tools chose and the way that they chose to load their front-end code
Trevor Manz: would affect the way that me as the library author would need to package up the code.
Michael Kennedy: By modules and loading, you're talking where people might see the word require at the top
Michael Kennedy: or something like that.
Michael Kennedy: Kind of like our import.
Trevor Manz: Yes, exactly.
Trevor Manz: It's very much like import statements in Python.
Trevor Manz: And in fact, the official, if you open up your browser,
Trevor Manz: you can just type, you can use a syntax that's called ES modules
Trevor Manz: and type in import.
Trevor Manz: And you can import a bit of JavaScript code via URL.
Trevor Manz: And this just works natively in the browsers like today,
Trevor Manz: but wasn't sort of standardized until late 2015, or late 2018.
Trevor Manz: So you mentioned require, that's actually a different module system
Trevor Manz: that's not based in browsers.
Trevor Manz: And if you were to type require in your browser,
Trevor Manz: that would not work.
Trevor Manz: And that is sort of like the tension
Trevor Manz: that was the JavaScript ecosystem.
Trevor Manz: So I was aware of some of the trends
Trevor Manz: and things that have happened
Trevor Manz: post this new module system
Trevor Manz: because I've been working in the web ecosystem.
Trevor Manz: And yet when I came to work
Trevor Manz: on like Jupyter widgets specifically,
Trevor Manz: there was like,
Trevor Manz: I felt like I was writing code
Trevor Manz: like I had been like a while ago for the browser.
Trevor Manz: And so the idea behind anywidget was to like,
Trevor Manz: let's just simplify this so like that my source
Trevor Manz: and the code that I publish
Trevor Manz: is more like what the browser understands natively.
Trevor Manz: And then we take care of this like transpilation stuff
Trevor Manz: once for everybody and package that up
Trevor Manz: inside of anywidget to deal with sort of like
Trevor Manz: the legacy module systems of like JupyterLab,
Trevor Manz: VS Code, and a Google collab.
Michael Kennedy: This portion of Talk Python To Me
Michael Kennedy: is brought to you by JetBrains and the PyCharm team.
Michael Kennedy: The PSF, the Python Software Foundation,
Michael Kennedy: is a nonprofit organization behind Python.
Michael Kennedy: They run or oversee the conferences,
Michael Kennedy: handle all the legal business to do with Python,
Michael Kennedy: oversee the steering council and other groups, and much more.
Michael Kennedy: But let's focus in on one key word here, non-profit.
Michael Kennedy: Unlike some software ecosystems,
Michael Kennedy: which grew out of and are supported by a single tech giant,
Michael Kennedy: think.NET and Microsoft or Swift and Apple,
Michael Kennedy: Python is by developers for developers.
Michael Kennedy: That makes it a truly special place.
Michael Kennedy: Everyone here is here because they chose to be here.
Michael Kennedy: It's our garden.
Michael Kennedy: and we have to tend it. That means supporting the ecosystem, and a big part of that is supporting
Michael Kennedy: the PSF. That's why I was thrilled when JetBrains and the PyCharm team in particular reached out to
Michael Kennedy: me to help spread the word about their PSF fundraiser. Here's the deal. You can purchase
Michael Kennedy: PyCharm Pro for 30% off this week until December 19th, 2025. And when you do, not only do you get
Michael Kennedy: a deal on PyCharm, but the PyCharm team will donate all the proceeds to the PSF. Let me say
Michael Kennedy: that again because it's easy to miss. They will donate all the proceeds to the PSF. And a positive
Michael Kennedy: addition this year is that this also applies to renewals, not just new customers. So if you're
Michael Kennedy: already a PyCharm fan and customer, renew this week and you get a discount plus you support the PSF.
Michael Kennedy: To take part in this, you'll need to be sure to use Talk Python's exclusive promo code,
Michael Kennedy: STRONGERPYTHON, all caps, two words. That's STRONGERPYTHON for the code and the link is
Michael Kennedy: talkpython.fm/PyCharm dash PSF dash 2025. Both of these are in your podcast player's show
Michael Kennedy: notes. Thank you to PyCharm for supporting the show. I'm trying to decide if I feel like it's
Michael Kennedy: in the interest, if the motivation of any of those platforms would have been to create something like
Michael Kennedy: this, right? Like the Jupyter people are like, I don't know the problem. You just write for Jupyter
Michael Kennedy: and it works. And the Colab people are like, I don't see a problem. You just write for Colab and
Michael Kennedy: it works, right? Like what is the platform people's motivation to create integrations and smooth the
Michael Kennedy: transition to the other ones? That's one tension. On the other though, they might have more stuff
Michael Kennedy: come to them if they make it more reusable across them, right? So it's interesting that none of them
Trevor Manz: actually did that. Yeah, I think, I mean, in hindsight, it makes sense why someone in my
Trevor Manz: position, like, I guess, focused on this because it was like, I had two widgets and then times the
Trevor Manz: number of platforms. And then if something broke, you'd have to go fix it a bunch of different
Trevor Manz: places and it just becomes a maintenance nightmare.
Trevor Manz: But one thing that's been really interesting is I think that there is a good pressure to
Trevor Manz: support a healthy ecosystem.
Trevor Manz: So I'd say before anywidget, it was pretty complicated to create custom widgets.
Trevor Manz: And so one of my goals was I want the feeling of being able to author a widget to be very
Trevor Manz: similar to the way that you can copy and paste code into a notebook, but move it into a file.
Trevor Manz: And then you could publish that to PyPI.
Trevor Manz: And that workflow always worked for Python,
Trevor Manz: but there was no way to start prototyping a widget
Trevor Manz: inside of a notebook before and then move it out.
Trevor Manz: And I really wanted to bring sort of,
Trevor Manz: to lower that barrier to entry.
Trevor Manz: And then what I think came out of that
Trevor Manz: is you get a much richer ecosystem of people
Trevor Manz: that are willing to try and make things.
Trevor Manz: And then when there's a cool widget that comes out,
Trevor Manz: then that's a good positive pressure
Trevor Manz: for other ecosystems,
Trevor Manz: because then people are trying to request,
Trevor Manz: they go, hey, I want this widget to work in your environment.
Trevor Manz: And that puts more pressure on various environments
Trevor Manz: to implement sort of a more standardized approach.
Michael Kennedy: Or adopt a adapting layer like anywidget.
Michael Kennedy: Yep. Yeah, exactly.
Michael Kennedy: Yeah, to sort of back you up here,
Michael Kennedy: Kostal says, thank you for building anywidget.
Michael Kennedy: Having gone through creating an IPy widget,
Michael Kennedy: it was a lot of work.
Michael Kennedy: So yeah, exactly.
Michael Kennedy: Let's just take a tour through the widget gallery.
Michael Kennedy: Like what widgets are available here?
Michael Kennedy: Got some favorites?
Trevor Manz: Yeah, we definitely have some favorites.
Trevor Manz: I would say that one of the early adopters of AnyWidget
Trevor Manz: is a fairly popular plotting library called Altair.
Trevor Manz: And it allows to do exactly what you were talking about earlier
Trevor Manz: with selecting points and allowing you to get those back
Trevor Manz: as data frames in the kernel.
Trevor Manz: So for a while, the way that Altair worked,
Trevor Manz: and I think it still by default works inside of a Jupyter environment,
Trevor Manz: is that it creates sort of an interactive output
Trevor Manz: that isn't connected back to the kernel.
Michael Kennedy: So you can get your output.
Michael Kennedy: It feels interactive because you can zoom in and you can select and you can do all the things, but it's just a view.
Trevor Manz: Exactly.
Trevor Manz: That state, I like to think of it as like is trapped in the output and you can't get it back in the notebook.
Trevor Manz: And so what the AnyWidget does behind the scenes is it allows for that output to communicate back with the kernel,
Trevor Manz: which then allows you to update an object or a selection and then run your cell again and view some output.
Trevor Manz: And just that bi-directional communication
Trevor Manz: between your kernel and your front end
Trevor Manz: allows you to do things like create a data frame
Trevor Manz: that is updated when you select.
Michael Kennedy: Yeah.
Michael Kennedy: Nice.
Michael Kennedy: Yeah, it's sort of that example
Michael Kennedy: we talked about the outliers before, right?
Michael Kennedy: Yeah, exactly.
Michael Kennedy: Altair's super cool.
Michael Kennedy: You know, I talked to Jake Vanderplass about it
Michael Kennedy: when it first came out and it's very beautiful.
Trevor Manz: Yeah, Altair was actually, I think,
Trevor Manz: how I got into open source contributions forever ago.
Trevor Manz: Like I made like documentation examples
Trevor Manz: and it was very like,
Trevor Manz: it was very fun to come full circle
Trevor Manz: to actually have like a dependency
Trevor Manz: that somehow like got back into that library
Michael Kennedy: many years later.
Michael Kennedy: Now you build something that makes it more,
Michael Kennedy: that supercharges Altair
Michael Kennedy: because now it has like bidirectional data integration
Michael Kennedy: sort of thing.
Michael Kennedy: Yeah, yeah.
Michael Kennedy: Yeah, that's wild.
Michael Kennedy: Yeah, maybe just talk to people really quick about that.
Michael Kennedy: Like you don't have to write a revolutionary feature
Michael Kennedy: to be part of open source.
Trevor Manz: Yeah, yeah, definitely.
Trevor Manz: I think my entry to open source was just
Trevor Manz: I got interested in a plotting library and they had some open tickets for making examples for their documentation.
Trevor Manz: And I wanted to learn how to use the plotting library.
Trevor Manz: So then I started contributing to them.
Trevor Manz: And it was really like those interactions, I think, with maintainers that kind of got a tick in my head where I was like, oh, I think I like this way of working and communicate.
Trevor Manz: Like there's a lot of, I don't know, oftentimes the challenges in open source aren't so technical as they are just social and figuring out how to communicate expectations to different users.
Trevor Manz: And I think specifically interacting with Jake Vander Plaats
Trevor Manz: and some of those issues,
Trevor Manz: I think I learned a lot about that
Trevor Manz: and I was attracted to trying to find new ways
Trevor Manz: to work on problems in open source.
Michael Kennedy: Yeah, awesome.
Michael Kennedy: All right, well, that's number one
Michael Kennedy: with 10,000 favorites out of the community.
Michael Kennedy: What are some others?
Trevor Manz: Some of the other, I would say like,
Trevor Manz: so Vincent Womerdam, who is one of my colleagues
Trevor Manz: and you've had it on the podcast any times before.
Michael Kennedy: A couple times, yeah.
Trevor Manz: Yeah, it's created this draw data widget.
Trevor Manz: And I would say when this widget came out,
Trevor Manz: this was very much,
Trevor Manz: there are many different,
Trevor Manz: it demos very well.
Trevor Manz: So the idea is that you have like a canvas
Trevor Manz: that you can draw some points
Trevor Manz: and you get those points back out as a data frame.
Trevor Manz: And yes, so Vincent has a nice Marimo notebook
Trevor Manz: that's running in the browser.
Michael Kennedy: Yeah, that's right.
Michael Kennedy: There we go.
Trevor Manz: And I believe if you draw some points.
Michael Kennedy: I don't like the brush.
Michael Kennedy: I'm going to change the brush.
Michael Kennedy: We've got precise data.
Michael Kennedy: So you could have one kind of data set here and then you could go like, okay, we're going to do,
Michael Kennedy: you know, this is super interesting because maybe you say like the data kind of looks like this and
Michael Kennedy: I want to run an algorithm against it, but there's a ton of work to get the data in the right format.
Michael Kennedy: You could just start, you know, kind of just visually doing these things. And then you can
Michael Kennedy: go on and analyze it and do all sorts of stuff by just literally by drawing.
Trevor Manz: Yeah. We found this is like educators are quite excited about like this kind of widget.
Trevor Manz: because it's like, hey, here's this,
Trevor Manz: how does a random forest algorithm work?
Trevor Manz: It's like, okay, we can just draw a data set
Trevor Manz: and then we can actually view
Trevor Manz: how a classification would work
Trevor Manz: over a specific type of data set.
Trevor Manz: And I think it's really that type of interplay
Trevor Manz: between something that you can play with
Trevor Manz: to create something with the data
Trevor Manz: and then maybe you take scikit-learn or something
Trevor Manz: and apply an algorithm
Trevor Manz: and you can help build intuition
Trevor Manz: for how these algorithms work
Trevor Manz: just by plugging in with the actual workhorse
Trevor Manz: of doing the operations
Trevor Manz: and like computing, like your classifier.
Trevor Manz: But instead you have this new input,
Trevor Manz: which is like allowing for a bit more play
Trevor Manz: with like learning how those algorithms work.
Michael Kennedy: Yeah, you have an algorithm and you say,
Michael Kennedy: I want to see how, if the data looked like this,
Michael Kennedy: what would happen?
Michael Kennedy: If the data looked like that, what would happen?
Michael Kennedy: And a lot of times people will result
Michael Kennedy: to generating that data with code,
Michael Kennedy: either by writing it themselves,
Michael Kennedy: using a library like Faker or something like that,
Michael Kennedy: you know, like, how am I going to get it?
Michael Kennedy: What if it looks like this?
Michael Kennedy: And here you just say, whatever looks like this, and you draw it.
Michael Kennedy: And then you run your algorithm based on the output of it because it's a widget, an AnyWidget widget.
Michael Kennedy: And then you just keep going.
Michael Kennedy: It's super neat, actually.
Trevor Manz: Yeah.
Trevor Manz: So to go back to, I think, something you mentioned before as well,
Trevor Manz: AnyWidget sort of serves two communities.
Trevor Manz: So I think for one, there are folks that never will ever need to touch or learn any JavaScript,
Trevor Manz: but can just use these libraries like they would Python packages.
Trevor Manz: So the idea is, hey, I can pip install draw data,
Trevor Manz: and now I get to use a scatter widget.
Trevor Manz: And I don't care at all how it works,
Trevor Manz: but now I get to understand how this algorithm works.
Trevor Manz: But for those that are interested,
Trevor Manz: they can go and learn maybe a little bit of JavaScript
Trevor Manz: or progressively a little bit more JavaScript
Trevor Manz: to create something and package it up
Trevor Manz: for many different platforms.
Trevor Manz: So you sort of have people that want to make libraries
Trevor Manz: and then you have library consumers.
Trevor Manz: And depending on how much front-end stuff you want to learn,
Trevor Manz: that's how deep you can go into either of those sides.
Trevor Manz: But I'd say probably many more people
Trevor Manz: are just widget users and happily wire them together and don't worry about it and move on
Trevor Manz: with their day. And then there's some folks that maybe go a little bit deeper on the JS side and
Michael Kennedy: learn how to create these interactive experiences. When you say wire them together, do you mean like
Michael Kennedy: put one in a notebook in one cell and then another in another cell, but then say the input of it is
Michael Kennedy: the output of the other, that kind of wire together? Exactly. Yeah. So you can really think of these as
Trevor Manz: like building blocks that you can like compose inside of a notebook environment. And I think
Trevor Manz: specifically in marimo a really cool thing is that when you update that value that lives in the
Trevor Manz: kernel that cell below will rerun so now it's not just like you do the thing and then you have to
Trevor Manz: manually rerun the cell you actually start to build up based of our reactivity graph like a little bit
Trevor Manz: of an application of like i select some cells and now that reruns this python code and and if i have
Trevor Manz: more cells that run after that it all is sort of wired up from this new input which is your widget
Michael Kennedy: Yeah, I kind of riffed on this a little bit when I said like the world's craziest go-to.
Michael Kennedy: And I said the second craziest because the most crazy is Excel.
Michael Kennedy: But that's because the way Marimo solves that is it actually understands the way these variables
Michael Kennedy: used across cells.
Michael Kennedy: So when I move a widget in one, it redraws.
Michael Kennedy: It's like, oh, the thing that depended upon it also now has to change.
Michael Kennedy: And then like you can, it cascades that execution across the widgets, right?
Trevor Manz: Exactly.
Trevor Manz: And that would normally just happen if you use our built-in UI elements or if you rerun cells.
Trevor Manz: And because it's just this reactive model where we trace the dependency, we just track what the dependencies are statically between your cells.
Trevor Manz: We know that when you update this property on a widget, we know it sells that you have to update that depend on that widget.
Trevor Manz: And so, yeah, it just sort of all falls out of this simple idea of your notebooks are a graph.
Trevor Manz: They're not just like this manual.
Trevor Manz: I think of it as like a lot of like running cells is like manual callbacks.
Trevor Manz: Like you, you like do something and you're like, oh, I have to click a callback and run it.
Trevor Manz: And by modeling it as a graph, we can run those for you.
Trevor Manz: And so that we know exactly what needs to update when this dependency of that part of the graph is invalidated.
Michael Kennedy: I've talked to some data scientists who are like, that is both a feature and a problem that you can just be so freeform in Jupyter Notebooks, right?
Michael Kennedy: Like I can just iterate and play.
Michael Kennedy: And I think while you're iterating and playing, that freedom is great.
Michael Kennedy: But as soon as you want to start making decisions, then it becomes like a real danger point, right?
Michael Kennedy: Yeah, I think there's kind of a nice balance.
Trevor Manz: So specifically in Marimo, there are some requirements for how you have to write your Python code that are slightly more limiting than within a Jupyter environment.
Trevor Manz: And one that often trips folks up is that you can't redeclare variables across cells or else it would be ambiguous.
Trevor Manz: Like, is this the cell that defines X or is this the cell that defines X?
Michael Kennedy: But I like to think of it as-
Michael Kennedy: Which order did you run it in?
Michael Kennedy: That's the one.
Trevor Manz: Yeah, exactly.
Michael Kennedy: That's tricky.
Trevor Manz: So we're fairly strict on that.
Trevor Manz: But what we believe is if you buy into this constraint, then we can give you all these
Trevor Manz: properties, which are deterministic execution order and the ability to turn these scripts
Trevor Manz: into reproducible, or turn these sort of open-ended workflows into more reproducible artifacts
Trevor Manz: that have a deterministic execution order.
Trevor Manz: And so I like to think of it a little bit as like,
Trevor Manz: I used to type Python code without type hints.
Trevor Manz: Then I started using type hints,
Trevor Manz: and now I can't imagine not having any autocomplete.
Trevor Manz: And now I think like maybe our type,
Trevor Manz: like when you start working with data in long-lived sessions,
Trevor Manz: having some of these guardrails actually help you keep on track
Trevor Manz: such that if you accidentally delete a variable,
Trevor Manz: we'll let you know that you deleted it,
Trevor Manz: and it's not something that the next time you boot up the notebook,
Trevor Manz: you're just missing that variable.
Trevor Manz: So it's something that you buy into,
Trevor Manz: but then I think has all these nice consequences
Trevor Manz: that come out that--
Michael Kennedy: - As a newbie, you'll see like,
Michael Kennedy: these things are not defined,
Michael Kennedy: or this library doesn't exist.
Michael Kennedy: And you know what it does exist,
Michael Kennedy: you just skipped running the top import cell,
Michael Kennedy: or you know, that stuff's a little frustrating.
Michael Kennedy: So during this talk you talked about,
Michael Kennedy: during your talk previously,
Michael Kennedy: you talked about like how anywidget allows you to write
Michael Kennedy: just enough JavaScript.
Michael Kennedy: What do you mean by that?
Trevor Manz: - What do I mean by just enough JavaScript?
Michael Kennedy: - Yeah, like, so one person's just enough JavaScript,
Michael Kennedy: another person's like, whoa, way too much JavaScript.
Trevor Manz: Sure.
Trevor Manz: So when I first started learning any front-end code,
Trevor Manz: my experience was I opened up an HTML file
Trevor Manz: and I just wrote some JavaScript on the page.
Trevor Manz: And I completely love this workflow
Trevor Manz: for playing and learning how to write code
Trevor Manz: for the first time in the browser.
Trevor Manz: But I think over the years,
Trevor Manz: as people have started to build things
Trevor Manz: like Figma and Adobe in the browser,
Trevor Manz: there's a ton of tooling that has come up
Trevor Manz: to help build those types of applications.
Trevor Manz: So many people's first experience with writing JavaScript
Trevor Manz: is someone telling them that they need to learn React
Trevor Manz: or learn a specific framework.
Trevor Manz: And then it's a bit like, well, this isn't technically JavaScript.
Trevor Manz: This is a flavor of JavaScript that we transform.
Trevor Manz: And so the experience that I wanted for anywidget
Trevor Manz: was to write this standardized JavaScript code
Trevor Manz: as sort of the entry point to your widgets.
Trevor Manz: So it should feel as simple as you could just open up
Trevor Manz: browser console and start typing in code.
Trevor Manz: And the code that you write is exactly what the browser understands.
Trevor Manz: And so it should be dead simple from the beginning.
Trevor Manz: Just learning some APIs and probably pattern matching between, okay, this is some syntax.
Trevor Manz: But it should feel pretty familiar.
Trevor Manz: Should you want to learn those frameworks or use those frameworks, those all have the
Trevor Manz: ability to be transformed into this standardized JavaScript.
Trevor Manz: And in fact, they have to be in order to run in the browser.
Trevor Manz: That's how that all works.
Trevor Manz: So I wanted that initial experience to be, if you want to learn and you've never tried it out before, send a variable and you can console log that variable and it just works.
Trevor Manz: But should you want to build something very ambitious and a lot of our most popular complicated widgets do use some of these frameworks, that's something that you can learn.
Michael Kennedy: So I could do a view or an AlpineJS or I could do a React and all of that kind of stuff if I want.
Trevor Manz: Yeah, so in our documentation, there is like a, I think it's, I call it, we call it, we have like a little CLI to bootstrap a project that's like ready to be used with React.
Trevor Manz: And I think we had a contributor contribute one for Vue and Svelte as well.
Trevor Manz: And the whole idea there is like, yes, in order to, like, the tradeoff is that now you are introducing like some JavaScript build tooling into your, like into this process.
Trevor Manz: But hopefully if you're familiar with those frameworks, that isn't like a big overhead to trying out some of those things.
Trevor Manz: Versus like for the Python beginner that wants to learn something in the front end and they're just trying to get their data into the front end.
Trevor Manz: I just don't want them to have to worry about TypeScript or React or any of these things that they might hear about.
Trevor Manz: And instead they can just get started with trying to paint some pixels on the screen and then progressively learn outside of that ecosystem.
Trevor Manz: So the entry point will always be sort of this simple front end standard.
Trevor Manz: And then how far you want to go into that ecosystem, then you can experience more of
Trevor Manz: like the tooling there to help with reactivity and things in the front end.
Michael Kennedy: Yeah, that's super interesting to think of injecting little miniature view applications
Michael Kennedy: and stuff to allow that work.
Michael Kennedy: But they are super powerful if you're willing to go through the build steps and all the
Michael Kennedy: hoops that those different frameworks ask you to do to get it to run.
Michael Kennedy: And once you get it set up, it's like, okay, these things all bi-directionally data bind to each other internally.
Michael Kennedy: And so I can see how that plays just like perfectly naturally with the already binding of the dynamic interaction here.
Trevor Manz: Yeah, exactly.
Trevor Manz: So we model this as like we have the standard, which is like this ECMAScript standard, which is the JavaScript code that you write.
Trevor Manz: And then all of the libraries are modeled as like adapters on top of that standard.
Trevor Manz: I think we call them bridges.
Trevor Manz: So in React, you get hooks that you can call,
Trevor Manz: and then you're writing code that looks like idiomatic React,
Trevor Manz: but behind the scenes, it's calling anywidget APIs.
Trevor Manz: And our Vue bridge does the same thing, but with Vue APIs.
Trevor Manz: So you get to write front-end code that feels like it's Vue-like or React-like,
Trevor Manz: but behind the scenes, you have these custom bridges
Trevor Manz: that are written by folks that are familiar with those frameworks
Trevor Manz: for how they should interface with our standard specification.
Michael Kennedy: Yeah, wild.
Michael Kennedy: Let's talk about not using one of those,
Michael Kennedy: but instead talking through building a simple widget.
Michael Kennedy: Now, just to be clear,
Michael Kennedy: I know we can't read all of the code audio version
Michael Kennedy: because most people just listen to the show,
Michael Kennedy: but maybe just give us a sense going through this.
Michael Kennedy: You have a build a counter widget.
Michael Kennedy: Yeah.
Michael Kennedy: Or I can click a button and it counts or something.
Michael Kennedy: Yeah, just walk us through,
Michael Kennedy: just to give people a sense of what does it mean
Michael Kennedy: to build one of these AnyWidget widgets.
Trevor Manz: Yeah, so the idea within AnyWidget
Trevor Manz: is that you create a class that extends from a single class
Trevor Manz: that's in anywidget called anywidget.
Trevor Manz: And that is what you define both your view,
Trevor Manz: so the front end part of that code,
Trevor Manz: and then also the back end code for that.
Trevor Manz: So it fully encapsulates the idea of a widget
Trevor Manz: that has both a back end and a front end component.
Michael Kennedy: Yeah, and just to be clear for people,
Michael Kennedy: let's say when you say a class,
Michael Kennedy: it's not one of those weird prototype JavaScript type things.
Michael Kennedy: It's the more modern class keyword,
Michael Kennedy: but in ECMAScript, is that right?
Trevor Manz: Oh, sorry.
Trevor Manz: So right, what we're looking at here is just a Python class that's extending.
Michael Kennedy: Oh, this is a Python class.
Michael Kennedy: Okay.
Michael Kennedy: Yeah.
Michael Kennedy: A Python class.
Michael Kennedy: Great.
Michael Kennedy: And so you create a Python class, but then it has the JavaScript.
Michael Kennedy: Exactly.
Trevor Manz: So ESM is like a private field that defines a front end module.
Trevor Manz: And the whole idea there is that you define a function that's called render that takes
Trevor Manz: in two arguments, a model and an element.
Trevor Manz: So the model is like this object that talks back to the kernel.
Trevor Manz: And an element is whatever the front end, like Jupyter or VS Code gives you as like the output on the screen.
Trevor Manz: And so those two things combined, you can call methods on that model to set a value or get a value.
Trevor Manz: And then you can update some part of the UI.
Michael Kennedy: I see.
Michael Kennedy: So you're past like a DOM element, which might be a div or whatever.
Michael Kennedy: And then you can just inject JavaScript, like a pen child and other stuff and set a class and whatever.
Michael Kennedy: And that builds out the little, the part of the DOM that you control or it's given to you?
Trevor Manz: Exactly. And then you can style that however way that you want.
Trevor Manz: And then the key thing is that as a part of this adapter,
Trevor Manz: when you call methods on this model object that you get,
Trevor Manz: I think there's only a few methods that are on it,
Trevor Manz: like get, set, and save changes.
Trevor Manz: And that just synchronizes values back and forth
Trevor Manz: between the front end and the back end.
Trevor Manz: And that same sort of API is on the Python side as well.
Trevor Manz: And so you can react to those values as they update
Trevor Manz: or set them as well on the Python side.
Trevor Manz: And then we'll deal for the most part,
Trevor Manz: like with serialization of simple data types to one.
Trevor Manz: So if you have a float or an int in Python,
Trevor Manz: we'll just map that to a number data type.
Trevor Manz: We have that mapping in our documentation.
Trevor Manz: If you want to serialize to something like JSON,
Trevor Manz: that's totally fine too.
Trevor Manz: And then you just send that over the wire.
Michael Kennedy: Yeah, that's wild.
Michael Kennedy: So how does it actually,
Michael Kennedy: so we've got a Python class,
Michael Kennedy: which I guess probably lives in the kernel.
Michael Kennedy: And then it's got HTML JavaScript stuff it's doing
Michael Kennedy: that it's setting values.
Michael Kennedy: What's this exchange?
Michael Kennedy: Where do different pieces run?
Michael Kennedy: How do they communicate?
Trevor Manz: Sure.
Trevor Manz: So that is up to the implementation.
Trevor Manz: So whoever builds an adapter for anywidget.
Trevor Manz: But the idea is that the front-end code that you write is in the standardized form.
Trevor Manz: So you can just call import and import this JavaScript module that you have.
Trevor Manz: And then the front-end is responsible for when these different methods get called on model
Trevor Manz: for sending that data back and communicating over some sort of mechanism to the backend.
Michael Kennedy: Jupyter already has defined something like that.
Michael Kennedy: Yeah, so Jupyter has a notion of something called a com,
Trevor Manz: and that is implemented over a web socket to communicate back and forth.
Trevor Manz: And similar in Marimo, we're not based on Jupyter at all,
Trevor Manz: but our any-witted adapter just talks over a web socket with some different messages.
Trevor Manz: But basically, we call this a host platform that takes care of that implementation
Trevor Manz: and wires up those two ends.
Trevor Manz: But then as the widget author, you just care about like,
Trevor Manz: here's my JavaScript module, here's my Python code.
Trevor Manz: And they use these APIs.
Trevor Manz: And then it's someone else's problem to figure out how to wire those up together.
Michael Kennedy: Yeah, super neat.
Michael Kennedy: Kasaasa, interesting thought here.
Michael Kennedy: I'd be super interested to see this working purely in Python.
Michael Kennedy: Front end running in Wasm.
Michael Kennedy: No need for JavaScript streams in Python.
Michael Kennedy: What do you think here?
Trevor Manz: Yeah, yeah.
Trevor Manz: I haven't played around with some of the PyDide or the PyScript APIs.
Trevor Manz: I think that that would probably be possible.
Trevor Manz: the example that you had of draw data before
Trevor Manz: for the Marimo notebook that Vincent had
Trevor Manz: that is entirely running in the browser
Trevor Manz: so that is like the Marimo Python kernel is running in Wasm
Trevor Manz: and then we're also loading the JavaScript code
Trevor Manz: so we do have folks that just create a Marimo notebook
Trevor Manz: and then compile it to WebAssembly
Trevor Manz: and then they have a static website that has both of these bits together
Michael Kennedy: Okay, that's actually pretty wild, isn't it?
Michael Kennedy: So I've seen that there's some other places that I can, anywidget, like Myst.
Michael Kennedy: Yeah.
Michael Kennedy: And also Mosaic.
Michael Kennedy: Tell us about these.
Trevor Manz: Yeah, yeah, definitely.
Trevor Manz: So Myst, I think on our community page, we have a notion of widgets, and then we have a notion of host platforms.
Trevor Manz: And so the two primary host platforms right now are things that are Jupyter-based, so like VS Code, Notebooks, Google Colab.
Trevor Manz: binder, like all these things that are based off of a Jupyter kernel and run Python behind the scenes.
Trevor Manz: Then Marimo is another host platform and Mist is currently working on an integration
Trevor Manz: around that specification for the front-end code. And so the idea is like as long as they have a way
Trevor Manz: to, and I'm not sure how far along that is at the moment, but as long as there is a way to run Python
Trevor Manz: code and sort of maintain that relationship between that front-end code and back-end code, then
Trevor Manz: And you could drop anywidgets within your MIST markdown, for example, as well.
Michael Kennedy: Yeah.
Michael Kennedy: MIST is wild.
Michael Kennedy: I had that team on the podcast a while ago.
Michael Kennedy: It's like, you want to create an e-book based on notebooks or whatever, LaTeX paper, or
Michael Kennedy: you name it, right?
Trevor Manz: Yeah.
Michael Kennedy: And yeah.
Michael Kennedy: I haven't done anything with Mosaic.
Trevor Manz: Yeah, Mosaic.
Trevor Manz: I think this is a really cool project.
Trevor Manz: So at its core, Mosaic is a bit more of like an architecture.
Trevor Manz: And this is probably one of the things that I'm most excited about,
Trevor Manz: like the ability that anywidget is bringing to folks
Trevor Manz: to experiment with new types of architectures
Trevor Manz: for building high-performance visualizations.
Trevor Manz: So inside a Mosaic, you have a notion of some database source
Trevor Manz: that I believe is typically DuckDB.
Trevor Manz: And then you write a bunch of front-end code
Trevor Manz: that basically expresses all of the data that it needs
Trevor Manz: as queries to that database.
Trevor Manz: And then there's a lot of optimizations that can happen
Trevor Manz: between those individual views and the database
Trevor Manz: that can all be coordinated and allow for very scalable data visualizations.
Trevor Manz: One cool thing about Mosaic is that this architecture lends itself very well to notebooks
Trevor Manz: because you can keep that database, that DuckDB running completely in the kernel,
Trevor Manz: and then you just have your front-end client. But then there's also an option where you just
Trevor Manz: completely compile everything into WebAssembly, and then that DuckDB is running in the browser as
Trevor Manz: well. And so you get to reuse a lot of this architecture and allows just a lot of code
Trevor Manz: reuse and you're just kind of moving that lever of like okay do i need like high performance compute
Trevor Manz: okay let me put my database in my hpc and then i'll just have a thin client on top of it versus
Trevor Manz: okay actually i want to look at everything in the browser like maybe we can just compile to web
Trevor Manz: assembly and let someone drop in a csv and then we can use reuse the same visualization so yeah
Michael Kennedy: this is super yeah that's super flexible duckdb has a very interesting WebAssembly story as well so
Michael Kennedy: yeah definitely it's definitely catching a lot of attention and people you know it's
Michael Kennedy: It's the data science SQLite, right?
Trevor Manz: Yeah.
Trevor Manz: And I'd say like a growing trend that I've seen by being able to,
Trevor Manz: like one thing I didn't, that didn't fully,
Trevor Manz: I wasn't fully aware of when I started on anywidget,
Trevor Manz: but it has been fun to see is because it became easier to sort of start playing
Trevor Manz: with like both front end code and Python code in the same environment.
Trevor Manz: Like there've been a lot more, I think, like experimentations around,
Trevor Manz: like trying out new types of architectures for building like visualizations.
Trevor Manz: And so one trend that I've noticed in our community gallery
Trevor Manz: is that a lot of our most popular widgets
Trevor Manz: are taking advantage of new data formats like Apache Arrow
Trevor Manz: to be able to send lots of data to the browser
Trevor Manz: to put on the GPU and render very quickly.
Trevor Manz: And so basically, there's a really cool example
Trevor Manz: of a widget called Lawnboard,
Trevor Manz: which is a geospatial visualization widget,
Trevor Manz: which is a wrapper around a front-end library called DeckGL
Trevor Manz: that was made by Uber to do geospatial visualization.
Trevor Manz: And the previous Jupyter integration,
Trevor Manz: like serialized data to JSON to be able to like render inside of DeckGL.
Trevor Manz: So the moment that you had to render maybe a few million points,
Trevor Manz: it's like you're spending a ton of time serializing that data
Trevor Manz: to be able to put it in the browser.
Michael Kennedy: Right.
Michael Kennedy: It's like using an ORM.
Michael Kennedy: They're great until you try to do a query with 100,000 records.
Michael Kennedy: You're like, why is this so slow?
Trevor Manz: Exactly.
Trevor Manz: And so I think there's an example with Lawnboard where
Trevor Manz: some data set with like 3.5 million rows just like crashed in the previous,
Trevor Manz: or never rendered, maybe it took a few seconds to render,
Trevor Manz: or a minute to render.
Trevor Manz: But Lawnboard uses Apache Arrow
Trevor Manz: and grabs that data from either Arrow, Parquet,
Trevor Manz: or all these different file formats.
Trevor Manz: And that's very fast to do,
Trevor Manz: because you just copy that buffer and ship it to the front end
Trevor Manz: and put it on the GPU.
Trevor Manz: And so it can do that same example in, I think,
Trevor Manz: one or two seconds on modern machines.
Trevor Manz: And so it really is this, get your data into a data frame
Trevor Manz: and dump it on the GPU and visualize it.
Trevor Manz: And that whole idea of,
Trevor Manz: oh, what format do I need to convert to to be able to use this tool, this visualization tool
Trevor Manz: that I've heard? It's like, no, no, no, just load it as a data frame. And then as long as you get
Trevor Manz: your data as a data frame, we can throw it into the web browser. Yeah, super neat. That's the kind
Michael Kennedy: of stuff that normal web people don't think about, right? You're like, well, how much is it to
Michael Kennedy: serialize a little JSON response? Or, you know, we're talking about a million of them. Oh.
Trevor Manz: Yeah, yeah, exactly. And I guess one thing I've been impressed with is just at times where my
Trevor Manz: understanding of how good computers have gotten is like, it's just shocking. It's more like, oh,
Trevor Manz: I think we're holding ourselves back at times by maybe some of the standard practices versus like,
Trevor Manz: yeah, hardware has gotten very good. And if you can make use of that hardware efficiently,
Trevor Manz: there's quite a bit that you can do on very low powered devices and visualize a ton of data.
Michael Kennedy: Yeah. Quite a while ago, like really long time ago, I did some OpenGL programming and you see,
Michael Kennedy: you know, like here, we gave this, the scene a hundred thousand triangles and it's rendering
Michael Kennedy: at 200 frames a second. You're like, how, how many operations is that? Like, that is insane. You know,
Michael Kennedy: this is like 30 years ago. You were just like, that just blows my mind. Yeah. I think people
Michael Kennedy: underestimate what computers can do sometimes, especially if you work with them, right? You're
Michael Kennedy: not doing three levels of serialization and deserialization and, and so on. Yeah. Yeah,
Michael Kennedy: exactly. That's wild. So what about publishing one of these things? If we go and write,
Michael Kennedy: I've created an AnyWidget and it's amazing for me to use, but I want to put it on PyPI so people can UVPIP install it or whatever in their notebook.
Trevor Manz: Yeah.
Trevor Manz: So I have a couple.
Trevor Manz: One, I would recommend if folks are really interested in it, there's a couple of videos I have on my YouTube of just like publishing some widgets and they're linked in the AnyWidget documentation.
Trevor Manz: But that file that you see there, that's open in the current view that we have.
Trevor Manz: If you know how to publish a Python file, you can just publish that to PyPI.
Trevor Manz: and it should just work.
Trevor Manz: So yeah, the one caveat I'd have is like,
Trevor Manz: you're looking at an inline string here,
Trevor Manz: and that's not always the nicest way
Trevor Manz: to write your front end code.
Trevor Manz: So you can also just import,
Trevor Manz: like you can require that as a file instead.
Trevor Manz: And so you can put that code into a separate file,
Trevor Manz: type check that or like lint it or like format it
Trevor Manz: as JavaScript.
Michael Kennedy: - So write a JavaScript file,
Michael Kennedy: and then somehow set just,
Michael Kennedy: would I just read that in Python?
Michael Kennedy: And then just set the text result,
Michael Kennedy: like use path and say read text and then jam it in there?
Trevor Manz: Yeah, we support if you just pass a path,
Trevor Manz: lib path to ESM, we'll read it for you.
Michael Kennedy: Oh, okay, perfect, yeah.
Michael Kennedy: So as long as I have a package
Michael Kennedy: and the package points out that these JavaScript files
Michael Kennedy: are to be included at build, then you're good to go?
Trevor Manz: Yep, and our starter kit template
Trevor Manz: is all configured with Hatchling to do that for you.
Michael Kennedy: Yeah, very nice.
Michael Kennedy: Okay, and I've been using uv build, uv publish these days,
Michael Kennedy: and it's pretty seamless.
Trevor Manz: Yeah, yeah.
Trevor Manz: I think maybe we might need to update the build script
Trevor Manz: to have uv build as the backend.
Trevor Manz: So, yeah.
Michael Kennedy: Yeah, even if you do uv build against something
Michael Kennedy: with a different backend,
Michael Kennedy: I think uv just runs that backend instead.
Michael Kennedy: So not a big deal.
Michael Kennedy: Not a big deal.
Michael Kennedy: So what are maybe some of the rough edges
Michael Kennedy: that people need to look out for these days?
Michael Kennedy: It's got a lot of stuff that makes things easy,
Michael Kennedy: but what should they be maybe on the lookout for?
Trevor Manz: I think the thing that if folks are getting,
Trevor Manz: Hopefully if you want to try out a widget, it should be as simple as installing any other Python package.
Trevor Manz: And that is really a goal that we've had for the project, is that if you want to use this like you would some algorithm library that just does computation,
Trevor Manz: we want that to be as simple as pip installing and getting started.
Trevor Manz: I would say probably the highest barrier to entry is that it is just this idea of just enough JavaScript.
Trevor Manz: And so one thing that I try to emphasize in the docs is that I'd really start with a very
Trevor Manz: simple example if you've never played around in the browser and get used to opening up
Trevor Manz: your developer tools and logging things and just understanding how to develop maybe a
Trevor Manz: little bit in the front end.
Trevor Manz: If you're coming from the front end side, then it would be learning a little bit more
Trevor Manz: of how does Python work and how do I debug things on the Python side.
Michael Kennedy: And what is PyPI and how do I even work with that thing?
Trevor Manz: Exactly. So it's really, I'd say, most of the rough edges are just these problems of working
Trevor Manz: with two language ecosystems. But that's also been a very important part of AnyWidget because we don't
Trevor Manz: want people that are ambitious to build things that sort of bridge this gap to feel restricted
Trevor Manz: from either using things in the Python ecosystem or the web ecosystem. Because we could always write
Trevor Manz: wrappers to make things easier for authors, but then we'll probably get a bunch of issues that
Michael Kennedy: then say, hey, I want to use this API and you haven't exposed it. And they're like, hey, we'd like to use
Michael Kennedy: view, you're like, well, you use our Python thing that defines the DOM.
Michael Kennedy: Like, oh, okay.
Michael Kennedy: Yeah, exactly.
Trevor Manz: So with great power comes great responsibility, but we want to give that to people that want
Trevor Manz: to build these types of integrations.
Trevor Manz: Yeah.
Michael Kennedy: So what about agentic AI for this kind of stuff?
Michael Kennedy: I know five years ago, you have to learn every step of the JavaScript.
Michael Kennedy: How much can I say, take my inline JavaScript, put it into a JS file, and then point it at,
Michael Kennedy: you know, ask Claude Sonnet, hey, this is an AnyWidget widget, and this is the JavaScript.
Michael Kennedy: and here's what I'm trying to accomplish.
Michael Kennedy: I bet you could go pretty far
Michael Kennedy: with a marginal understanding of JavaScript
Michael Kennedy: as a Python person, plus some kind of AI.
Michael Kennedy: What do you think?
Trevor Manz: Oh, yeah, absolutely.
Trevor Manz: I think, like I mentioned earlier,
Trevor Manz: Vincent works and I work very closely together.
Trevor Manz: And his joke that he likes to tell
Trevor Manz: is that I created anywidgets
Trevor Manz: so that he could make anywidgets.
Trevor Manz: And the ability to vibe code
Trevor Manz: sort of the front end for an object
Trevor Manz: really is eye-opening if you've never tried it.
Trevor Manz: before if you're working with your data.
Trevor Manz: And I think one of the barriers maybe of trying out
Trevor Manz: or of thinking about how to use anywidget
Trevor Manz: is knowing when it might be useful.
Trevor Manz: And really, it's like anytime you have an object
Trevor Manz: that you might want to visualize in a particular way
Trevor Manz: or maybe extend with some extra capabilities
Trevor Manz: in your notebook environment,
Trevor Manz: that's a perfect time to open up some agentic tool
Trevor Manz: and start trying to explain what you're thinking about.
Trevor Manz: because it's just JavaScript and not like a custom framework that we wrote or, and it's not like,
Trevor Manz: they're very good at like writing this type of code. And so sometimes you might need to,
Trevor Manz: we have a set of rules to try to like help it, make sure it doesn't like try to do React or
Trevor Manz: something, but it can go very far. And because it's just like a view on top of like your data,
Trevor Manz: it's like, it's kind of the perfect thing to play around with vibe coding, I think is.
Michael Kennedy: It's incredible how far you can go with this stuff. You can, you can give it your data source
Michael Kennedy: and say, here's the data source,
Michael Kennedy: here's what I'm trying to do.
Michael Kennedy: And because the data sources often can be
Michael Kennedy: really foundational like CSV or whatever.
Michael Kennedy: And then importantly, because it's just pure JavaScript,
Michael Kennedy: AI goes crazy on pure JavaScript and pure Python, right?
Michael Kennedy: It's unleashed.
Michael Kennedy: Yeah, it's crazy.
Trevor Manz: So to plug it back to Marimo for a second,
Trevor Manz: I think because it's just Python and just JavaScript,
Trevor Manz: it's a really fun environment
Trevor Manz: to actually create anywidgets in.
Trevor Manz: And we have some integrations with like AI chat
Trevor Manz: within our editor where we actually will inspect some of your Python variables and include that
Trevor Manz: in the prompts as you're trying to work on things.
Trevor Manz: So if you're saying, "Hey, I want to make a widget and I want to visualize this data
Trevor Manz: frame," you can actually tag the object that you want to start programming around.
Trevor Manz: And that will include things like the schema and stuff as it gives it to the model, such
Trevor Manz: that then you get that sort of grounds it at least when it's writing that JavaScript code
Trevor Manz: to grab the right columns and things off the data set and get to the ground running without
Trevor Manz: you having to procure those things as well.
Trevor Manz: So it's a pretty fun environment to create these things.
Michael Kennedy: It's a weird time, isn't it, that we live in?
Michael Kennedy: Kind of magical and also scary, but just weird.
Michael Kennedy: Yeah, definitely.
Michael Kennedy: But very much fun as well.
Michael Kennedy: I would throw out there, if people are interested,
Michael Kennedy: check out the Matt Makai episode I did on HHC programming
Michael Kennedy: three or four episodes ago.
Michael Kennedy: And choose a good model.
Michael Kennedy: I find people are like, I tried this.
Michael Kennedy: It did a bunch of junk.
Michael Kennedy: It's like, yeah, but use the free tier, right?
Michael Kennedy: I see.
Michael Kennedy: There's a big difference between the top tier models
Michael Kennedy: and the cheaper ones.
Michael Kennedy: So, all right. Where are we going? What's the roadmap look like for anywidget?
Trevor Manz: Yeah. So the roadmap for anywidget, I think looks a lot like trying to iron, like trying to get users to, or authors to understand some of these patterns that are like emerging in the ecosystem for like building some of these, maybe more like high performance, like visualization tools.
Trevor Manz: In terms of the library itself, there may be a few features that we want to add for users.
Trevor Manz: But I think one of the most important things is that we just ensure that we stay backwards compatible now that we have something that people are building around.
Trevor Manz: And so my call to action is just to try to get more folks, if they are curious, to try out building new widgets and let's keep this ecosystem pretty healthy.
Trevor Manz: And then on top of that, if there are places where folks are like running into limitations of like the specification as is, then getting like invested parties either from, you know, the implementers to try to understand like what APIs we need to add to support things in the future.
Trevor Manz: So, yeah.
Michael Kennedy: Amazing.
Michael Kennedy: It was up my mind, but I forgot to ask it when we were talking about this, where things run.
Michael Kennedy: If this is running in the kernel and you're doing HPC type stuff, I could potentially use Rust or C++ as part of building my widget.
Michael Kennedy: Is that right?
Trevor Manz: Yeah, definitely. So one pattern we've seen is like, you know, you just try to do as little as you like just the interactive bits that you want in the front end. And then you have the full resources of anything that you can do in Python on the on the back end side, right. And because Python is such a language that has sort of grown to be able to be extended with all these like systems level programming languages, there's like a lot that you can tap into there in terms of like, yeah, high performance compute or like.
Trevor Manz: So my hope is that really we push user or push anywidget authors of creating like interesting interactive elements that then allow us to really like have that extra input into these like really scalable like ecosystem, data ecosystem that we have on the Python side.
Michael Kennedy: Awesome.
Michael Kennedy: PR is accepted?
Trevor Manz: Absolutely.
Trevor Manz: Yeah.
Michael Kennedy: Yeah.
Michael Kennedy: Okay.
Michael Kennedy: So yeah, people can check it out here on GitHub.
Michael Kennedy: Of course, we'll link to that.
Michael Kennedy: And yeah, you got ideas.
Michael Kennedy: All right.
Michael Kennedy: Get in there and add it.
Trevor Manz: Yeah.
Michael Kennedy: And we also have a Discord.
Trevor Manz: So folks, like you open up a notebook
Trevor Manz: and you run into something or you just, you have an idea,
Trevor Manz: like there's plenty of folks or I'm in there.
Trevor Manz: And I love to try to get people
Trevor Manz: for their first bit of JavaScript ever.
Trevor Manz: I think it's pretty fun when someone has an idea
Trevor Manz: and you just, we help them get there.
Michael Kennedy: So like, but it's JavaScript.
Michael Kennedy: Like, no, no, you're going to be okay.
Michael Kennedy: It's not that much.
Michael Kennedy: It's just enough JavaScript, right?
Michael Kennedy: Exactly.
Trevor Manz: Whatever that means to you.
Michael Kennedy: Exactly.
Michael Kennedy: Just enough is so that my thing works.
Michael Kennedy: All right.
Michael Kennedy: Trevor, thank you so much for being on the show.
Michael Kennedy: I really appreciate it.
Michael Kennedy: And congrats on anywidget.
Michael Kennedy: Looks super cool.
Michael Kennedy: It definitely looks like it's all of any need
Michael Kennedy: and easy to work with.
Trevor Manz: Yeah, thanks so much for having me.
Michael Kennedy: Yeah, you bet.
Michael Kennedy: See you later.
Trevor Manz: See ya.
Michael Kennedy: This has been another episode of Talk Python To Me.
Michael Kennedy: Thank you to our sponsors.
Michael Kennedy: Be sure to check out what they're offering.
Michael Kennedy: It really helps support the show.
Michael Kennedy: Look into the future and see bugs
Michael Kennedy: before they make it to production.
Michael Kennedy: Sentry's Seer AI code review
Michael Kennedy: uses historical error and performance information
Michael Kennedy: at Sentry to find and flag bugs in your PRs before you even start to review them. Stop bugs before
Michael Kennedy: they enter your code base. Get started at talkpython.fm/seer-code-review. And this
Michael Kennedy: episode is sponsored by JetBrains and the PyCharm team. This week only through December 19th, 2025,
Michael Kennedy: get 30% off of PyCharm Pro, including renewals, and PyCharm will donate all the proceeds to the
Michael Kennedy: Python Software Foundation. Support the PSF by getting or renewing PyCharm. Visit talkpython.fm
Michael Kennedy: slash pycharm dash PSF dash 2025 and use the code strongerpython. Both of these are in your podcast
Michael Kennedy: player show notes. If you or your team needs to learn Python, we have over 270 hours of beginner
Michael Kennedy: and advanced courses on topics ranging from complete beginners to async code, Flask, Django,
Michael Kennedy: HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML, HTML.
Michael Kennedy: And if you're not already subscribed to the show on your favorite podcast player,
Michael Kennedy: what are you waiting for?
Michael Kennedy: I'm out.