DEV Community

Bartosz Osiej
Bartosz Osiej

Posted on

Externum — a typed language that compiles to Python, Bash and bytecode (Show DEV)

I've been building Externum — a self-hosted, statically typed language whose backends are runtimes that already exist everywhere:

  • Python target — emits readable CPython source (code-review friendly)
  • Bash target — standalone set -euo pipefail\ scripts; unsupported constructs warn loudly instead of silently emitting junk
  • Bytecode target — .exbc artifacts run by a small VM, no source needed

The pipeline operator x |> f(a, b)\ works on every backend. The compiler is self-hosted (bootstrapped from a 6.4 KB Python stub), every backend is tested against the others by a differential harness in CI, and the benchmark suite found 3 real VM bugs that unit tests missed.

Honest numbers: 1.6x slower than CPython, 11x faster than bash. ~380 tests. MIT. On PyPI (pip install externum\).

Feedback welcome — especially on the bash backend's design tradeoffs (what to emit when the typed semantics can't map cleanly).

showdev #python #compilers #opensource

Top comments (0)