- Blog
uv&marimo
735 words4 min read
I learnt coding in Python, some years ago, but I stopped coding soon after. I worked in Python on and off until Freshman year, when I suddenly knew R—I must’ve learnt it at some point but have no memory—and have been working more seriously in R ever since. This is a not a post on the language wars (see Claus Wilke’s piece if you want something closer to my views on that), but I do think R is better for serious data science. I don’t care to elaborate or stand ont he point any longer, but saying that I do have to work in Python from time to time. In my Data Science project class right now, we are working with neural nets, and while I’d want to turn to Julia and flux.jl, Torch is where the people and the money is at, so I’ve been working in Torch (very early days still, madly hacking away at things, don’t look too closely for a few weeks yet).
I distinctly remember the visceral agony I used to feel whenever I started a new Python project which I wanted to be more stable that than just a simple script. Dependency management was disgustingly bad, and I regularly could not use other peoples codebases because of some dependency related issue—and I’m a light Python user (which cuts both ways, I’m sure experts were mostly fine, regardless). uv from Astral has basically completely eliminated all dependency-derived friction, and its incredible. I have no lingering feelings of dread when starting a new project or cloning some code which also used uv. Neatly, uv also handles environment management for a fantastic double whammy, making working in Python enjoyable again. R has a similar Rust/Julia/JS/uv styled package manager called rv; I haven’t had a chance to use it yet though, and have been using renv (hot take: I really like renv and don’t think its that painful? But that’s a different post). Anyway, uv is just great and everyone should be using uv in their projects, especially if they are collaborating.
Scripts are my friend; I’m not a huge fan of notebooks. My “bar” for notebook starts at Quarto (which I still love), so needless to say I am not a fan of Jupyter. Somewhat ironically, Project Jupyter started at Cal Poly, my undergrad. I think the Jupyter kernel is great, but I think stateful notebooks are ridiculously bad and I cringe with agony and rage whenever I see people use them. My workflow (with Quarto) is to enable caching, write code, compile often, and only interpret compiled results. This means that whatever I write will always align with whatever my code is, so long as I seed the state and sometimes rerun chunks which shouldn’t pull from the cache and weren’t automagically invalidated. In short, I really dislike Jupyter and refuse to work in/with them.
Enter marimo, a sane notebook solution for Python. Marimo takes a functional approach to cells which is quite strict and very nice. It can be a bit rough not being able to redefine variables from other cells, but on a whole it is super easy to use and quite enticing. I really like the Web UI, something I didn’t think I would ever say, and to be honest I want Marimo for R—I see the appeal of the promise of Jupyter, but I will realize it exclusively through marimo. It’s polished and pretty, and pretty feature rich—enough for me to do my work. Marimo “notebooks” are just decorated Python files which means you can run them as-is and get actual diffs from git! That’s another big thing I dislike about ipynbs, unreadable commits—I almost forgot. At this point I’m probably better off sending you to the marimo main page instead of recreating and aping their main points. Marimo is what I wish Jupyter could be, and a little bit of what I wish Quarto can be, now—though that’s another discussion for another time.
Python as a language, and especially a “data science” language, is all the better with uv and marimo, and I’m excited to see these tools develop and hopefully have new ones join the fray. I wouldn’t say working in Python is anywhere comparable to R, still, but it’s now a lot closer. I promised this wasn’t a language-wars post, so this is the end—everyone can be friends and maybe Julia can win? :)
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.