A language built in the open
Myxo is a small, from-scratch, zero-dependency language with one idea at its core: used paths strengthen, unused ones decay. That isn't a tagline bolted on top — it's the semantics. Functions are agents. Variables are pathways that gain strength each time they're read. The mesh behind this text is that law, running.
Same results on both sides. The difference is how much you have to write.
Remembering answers · caching
A pure function called over and over — the classic case, Fibonacci.
from functools import lru_cache @lru_cache(maxsize=None) # you add this line def fib(n): return n if n < 2 else fib(n-1) + fib(n-2)
Without it, fib(32) makes 7,049,155 calls. You have to know to add it.
agent fib(n) { when n < 2 { report n } report fib(n-1) + fib(n-2) }
No annotation. The language caches a hot, pure agent itself — fib(32) returns instantly.
Sending work to the faster worker · load-balancing
Two workers do the same job; one is faster. Push more work to the fast one.
# you write the balancer yourself: def run(workers, items): weight = [1.0]*len(workers) for i, item in enumerate(items): w = pick_by_weight(weight) t = now() out[i] = workers[w](item) weight[w] = faster(weight[w], now()-t) # + pick_by_weight(), faster(), ...
You own the timing, the weighting, the loop — and the helpers.
schedule("pool", [fast, slow], items) flows("pool") # -> { fast: 5.98, slow: 1.03 }
One line. The pool measures speed and sends more work to the fast tube — and remembers it next time.
When a worker dies · failover
One worker breaks mid-job. The work still has to get done.
for i, item in enumerate(items):
for w in by_health(workers): # you write retry
try:
out[i] = w(item); break
except Exception:
mark_unhealthy(w) # you write this
You write the retry, the health tracking, the reroute.
schedule("pool", [maybe_broken, ok], items) # a dead worker decays; # its items reroute to the survivors
The same one line. Failover is already in the scheduler — nothing extra to write.
Myxo is not faster than Python for everyday work — it's an interpreter, and for tight number-crunching Python wins. The point isn't speed. The point is the red: in Python you write the cache, the balancer, and the failover. In Myxo, one rule carries all three, so that code simply isn't there.
And the part that earns its keep today isn't the self-tuning — it's safety. An Myxo program can only touch what you explicitly hand it. Nothing else exists in its world to misuse. That's the one you can hand to an AI.
A script declares what it may use with needs. Undeclared tools don't exist to it.
Budgets cap how often. Every privileged call returns in an audit ledger — successes and denials alike.
needs db_query, notify, spend(max 1) seed rows = db_query("SELECT count(*) FROM leads") notify("count is " + rows) spend(20) # over budget pm2_restart("all") # never declared
needs never fires — it's refused before it runs.spend(max 1) means the second call short-circuits, logged.| db_query | ok | 1 row |
| notify | ok | delivered |
| spend | refused | over budget of 1 |
| pm2_restart | refused | unknown pathway |
Node 18+ and nothing else — install the CLI from npm:
$ npm i -g myxo-lang $ myxo # drops you into the REPL
Or clone and run any example:
$ git clone https://github.com/thefinalmilkman/myxo $ cd myxo $ node myxo.js examples/the-law.myx --trace
Myxo keeps the building blocks and names them after the law.
| seed | declare a value |
| agent | a function |
| report | return |
| reinforce | loop while true |
| decay | remove a value |
| needs | declare capabilities |
| gather | run tasks on real threads |