[main page]

Benefits of dynamic typing, part 3

25 October, 2026 / color theme: ef-spring

Interactivity in production

“If it compiles, it works”, they say. But what do we do when it doesn’t work because of wrong assumptions?

Imagine we have an e-commerce shop, and suddenly something has stopped working. What would we use for debugging?

If we have a statically typed program as a binary running somewhere on a server, we'll usually use logs, metrics and tracing. But what if they didn’t cover the bug?

Shells are dynamically typed

Then we turn to other tools.

We have SQL shells to inspect data in a database, shells for our cache services, Postman for calling 3rd-party services and so on.

These tools are dynamically typed in nature: SQL as a language is statically typed, yes, but when we use the SQL shell to select something from a replica, we don’t need to specify the types. We just write SELECT * FROM table, and SQL figures out what the types of the columns are.

Redis is dynamically typed, and it’s very liberating to use its shell. Kafka is dynamically typed, and so are all the message queues. Postman helps to select stuff from public APIs, they usually return JSONs, and JSONs can contain any value.

Also notice how many tools we need to debug a simple GET endpoint that goes to the cache and the database. It adds friction. An admin dashboard helps combine the shells into one view.

The problem with observability and admin panels is that they tackle known unknowns, the things we were prepared for. In my experience, in a complex system everything can go wrong, so we need to be able to tackle unknown unknowns.

When a brutal bug happens, we need to override all the safety measures and take manual control.

REPL

REPL in production is like an admin panel on steroids.

We launch the REPL, and every function in our code can suddenly be executed or changed.

For example, using the Flask shell in Python is very liberating experience. We could execute functions that don’t write anything, and the path covers the database query, the parsing into a Python object, and the business logic we apply to the object afterwards. If bug happened somewhere in code, it's much faster to try and execute the code.

Also, the programs with a REPL usually have helper functions and are optimized for debugging with the REPL. In Clojure, people store lots of little helpers in a “scratch” file. After connecting to production they can either execute the helpers, or write new ones at the end of the file.

REPL also helps tremendously when we develop the program.

Prev

Next