- Published on
What Io taught me about bending reality in Software Engineering
- Authors
- Name
- Eyji Koike Cuff
🧠 This is part of my series inspired by Seven Languages in Seven Weeks (Tate, 2010). I’m exploring each language not to master it, but to learn how different paradigms shape how we think as software engineers. These are the takeaways I’d share with another backend dev over coffee.
🧵 Io in a Nutshell
Io is a prototype language based on Self and Smalltalk, meaning you do everything using objects instead of classes. It’s peculiar, but to create a new class object you have to clone Object (that's how the base object is called) like:
newObject = Object clone
And voila, there you have a new instance of a class an object. Soon enough, your project will be like:
Then you may ask
But what is really happening there?
Well, you're sending a message called clone
to the Object and invoking an Object method
that has code in one of its slots. Each object has slots that contain other objects — including method objects.
In io, everything is a message
🧠 Takeaway #1: Very little syntax and a lot of freedom
In io, you don't really have much to learn since the syntax is kept to a minimum. You have a hash with all the operators, and you can literally add, modify, or remove anything at any time. The same goes for the slots, and even the clone method we just used can be modified. But take note that you have no compiler to babysit you.
You can just pass an extra argument to a function as you please:
for(i, 1, 2, 1, i prinln, "extra argument")
And then you can take that and shoot yourself in the foot by forgetting how many arguments the for loop takes and doing something like
for(i, 1, 2, i prinln, "extra argument")
Io gives you a lot of freedom, but freedom can hurt
BUT that also means you can do some beautiful stuff.
Python uses the pass-by-object-reference way to send arguments to a function, which means you're never really passing the object, just a reference to it. If that object is mutable, like a dict
, then you can modify it inside a function. If that object is immutable, modifying it will create a new object. Whereas in Io, you're just passing a message, and your arguments are tied to it as part of a context.
unless := method(
(call sender doMessage(call message argAt(0)))
ifFalse(call sender doMessage(call message argAt(1))
ifTrue(call sender doMessage(call message argAt(2)))
)
)
unless(1==2, write("One is not two"), write("One is two"))
Since Io doesn't compute the arguments, we can do beautiful stuff like this unless method that will get executed as the message finds its way on each slot it passes.
What hit me:
Io just bend reality like JavaScript and arrow functions. Python looks like it’s a well-defined building with floors, walls, windows....
🧠 Takeaway #2: Concurrency
Besides its small footprint, Io has a very advanced concurrency library. Coroutines, actors, and the famous Futures are the main stars of the show. While futures are very similar to JavaScript, they implicitly block the process if you request their value before it arrives. Now, coroutines are just an easy way of yielding control between tasks.
frusciante := Object clone
frusciante singBackvoice := method(yield "I gotta take it on the otherside" println)
anthony := Object clone
anthony sing := method(
yield "Mm, push the trigger and I pull the thread" println
yield "I gotta take it on the otherside" println
)
anthony @@sing; frusciante @@singBackvoice
// this will print
// Mm, push the trigger and I pull the thread
// I gotta take it on the otherside
// I gotta take it on the otherside
Now, simply because we passed the @@ to the methods, they are actors. They manage their own state and can interact with others through a controlled queue.
Compared to Python:
Io has embedded support for those. It doesn’t need libraries like threading or asyncio, and in Python you need to get the result of a future by explicitly calling .result()
or await
- a lot of verbose.
What I’m thinking:
For lightweight concurrency and rapid prototyping, Io gives you expressive power with very little ceremony.
🔁 From Io Back to Python
Reading about Io challenged me to understand a different concept of doing things.
- 🧼 I appreciate the freedom Io gives you.
- 🔍 I write more code, but thanks to that, my applications are less error-prone.
- 🧰 Io might be an exceptional language to make Domain Specific languages since you can change all the behavior it gives you out of the box.
- ⌨️ It might not be a good idea to use in production code since it doesn't look maintained
Working through Io after years of Python development feels like swapping a Swiss watch for a sculptor's chisel. Both are powerful, but they expect very different things from the person using them.
🧭 Final Thought
Python gives you guardrails. Io gives you a blank canvas.
When you want control, performance, and safety, Python shines. When you want expressiveness, experimentation, and to bend reality — Io whispers, there is no spoon.
Want more like this? Subscribe here to get new posts straight to your inbox.