Computational Thinking with Marimo

Using marimo to solve problems

Sonny Bhatia

Friday, October 23, 2026

Instructional Gap

  1. Install Python
  2. Edit code -> save -> go to terminal -> run -> repeat
  3. input() is harder than it looks
  4. How many real programs use input()?
  5. Learn to write correct syntax to solve problems
  6. AI is a chat box
  7. Which model is the best?
  8. AI gave me code and it just works!

Marimo

What do we get?

  • Pure Python
  • Interactive UI
  • Reactive Execution

What we avoid?

  • Install Python
  • input()
  • notepad > edit > save > terminal > run > repeat

See Notebook

Unique Features

  • Variables owned by cells
    • Cell order irrelevant
    • Deterministic execution
    • Reproducible results
  • Private variables: _a = 5
  • Saved as .py
  • Bring your own harness
  • Publish with WASM

a = 5

b = 6

c = a x b

d = a ^ 2 + c

One-Shot “Teach me Fundamentals”

Prompt

teach me about python variables and functions

Notebook

ELI5

Prompt

ELI5 - after each cell, add a quick summary of the Python concepts

Notebook

CY105: Teaching Functions

CY350: Network Packet Analysis

  • Notebook
  • Task 1: getIPAddresses()
  • Task 2: findPrivateIPs()

Plotting with Seaborn

Seating Chart

Sudoku

Prompt

Help me to decompose a Sudoku solver in Python step-by-step

Make the game print as a markdown table instead of plain string

Running Locally

How?

winget install astral-sh.uv # on Windows
dnf install uv # on Fedora Linux
brew install uv # on MacOS or Linux with Homebrew

uvx marimo edit new.py

uv tool install marimo

Why?

  • WASM Native Runtime
    • More packages!
  • Memory, hardware access
  • Network Access
  • Real AI integration!

Which AI model to use?

Ideal World

  • Tokens are free and unlimited
  • Frontier models everywhere
    • A hammer is all you need!
  • Companies care about your privacy

Reality

  • Students must experiment and discern
  • Bring your own tokens
  • “Claude” is not a model
    • Understand what works when!
  • The lethal trifecta

Resources