DEV Community

Bartosz Osiej
Bartosz Osiej

Posted on

Externum launches today: one typed source Python, Bash or bytecode (with honest benchmarks)

One statically typed source compiles to readable CPython, a standalone set -euo pipefail bash script, or a source-less bytecode artifact. The compiler is written mostly in itself, bootstrapped from a 6.4 KB Python stub.

Today Externum is launching (Show HN + DevHunt launch week). This post is the honest version of that story: what it does, what it's bad at, and the numbers I'd want to see before trusting any "multi-target compiler" pitch.

The three backends

  • Python target — emits plain CPython source. Typed source in, debuggable Python out; you can review the emitted file in a normal PR.
  • Bash target — emits a standalone set -euo pipefail script. Functions become bash functions with local params, recursion works via $(...) capture. Where bash has no equivalent (lists/dicts/classes), the compiler warns loudly instead of silently emitting junk. The first version silently produced empty files — which is how I learned that "empty output, exit 0" is the worst failure mode a compiler can have.
  • Bytecode target — a .exbc artifact run by a small VM. For "distribute the tool, not the code".

A pipeline operator x |> f(a, b) desugars to f(x, a, b) in every backend, including the VM.

The honest numbers

My first benchmark claim was wrong: I measured the CLI's code-generation mode instead of execution and briefly believed the Python path was 4.5× faster than CPython. Real numbers after fixing the harness:

  • transpiled-Python path: ~1.6× slower than hand-written CPython (the cost of the typed multi-target story)
  • ~11× faster than bash on the same arithmetic loop
  • VM: ~30× slower — it exists for source-less distribution, not speed

If a benchmark in a language launch looks too good, assume the harness is measuring the wrong thing until proven otherwise. Mine was.

Engineering facts

  • ~380 tests, differential harness in CI: every backend runs the same suite and the outputs must agree — that harness found 3 real VM bugs that unit tests missed
  • self-hosted: the compiler is written in Externum, bootstrapped from a minimal Python stub
  • MIT, self-hosted, browser playground, pip install externum

Launch week

You can also vote for Externum on DevHunt this week (launch week 22–29.09): https://devhunt.org/tool/externum

The code is MIT and free forever. If you want the curated path: the Pro Pack (70+ exercises with solutions + a 10-page production guide on choosing between targets) is $29 instead of $50 this week with code LAUNCHWEEK — link in the repo README.

Ask me anything here or on the HN thread — especially about the parts you think are wrong.

Top comments (0)