Learning Lab

Pyodide makes blog posts feel less theoretical

2 min read

Pyodide changes what a technical post asks the reader to trust.

Static code examples say, “copy this later, install the right version, hope the dependency still works.” Running Python in the page says, “try it now and see what moves.”

That makes the article feel less like a brochure and more like a tiny lab.

what runnable code changes

If I am explaining a probability distribution, a small classifier, a parser edge case, or a ranking function, I want the reader to be able to poke the example. Change the input. Break the assumption. See the output move.

<script src="https://cdn.jsdelivr.net/pyodide/v0.26.4/full/pyodide.js"></script>
<script>
  const pyodide = await loadPyodide()
  const result = pyodide.runPython("1 + 2")
  console.log(result)
</script>

The page loads a Python runtime compiled to WebAssembly, and the browser can execute tiny examples without leaving the post.

small labs beat giant notebooks

I do not want every post to become a notebook. A blog lab should stay small. One concept. One input. One output. Maybe a textarea, a slider, or a few editable lines.

Good candidates are tokenization examples, simple ranking functions, vector similarity, regex failures, small data transforms, JSON schema validation, and toy classifiers. Bad candidates are giant dependency stacks and anything that turns the environment itself into the subject.

state has to stay visible

The reader should know when the runtime is loading, when a package is being installed, when execution is running, and when something failed. Otherwise the lab is just a broken text box with extra ambition.

The reason I like Pyodide is simple. For the right kind of post, it lets the reader mutate the example instead of just believing it. That is a better deal.

Jeremy London

About Jeremy London

Engineering leader and builder in Denver. I write about AI platforms, agents, security, reliability, homelab infrastructure, and the parts of engineering work that have to survive production.