Comparison

Tern vs Python

If you like how Python reads but not how it deploys or how fast it runs, Tern keeps the indentation and the feel, and checks every type before anything runs.

curl -fsSL https://ternlang.dev/install.sh | sh
tern new myapp && cd myapp

Side by side

struct Account:
    owner: str
    balance: int

fn deposit(a: mut Account, amount: int):
    a.balance += amount

fn main():
    acct = Account("ada", 0)
    acct.deposit(50)
    print(acct.owner, acct.balance)     # ada 50

Classes become structs plus functions, and acct.deposit(50) still works. The coming-from guide has the full mapping.

What you get

What you give up

Questions

Is Tern a compiled Python?

No. It borrows Python's syntax, but it is its own statically typed language and doesn't run Python code.

Is Tern faster than Python?

Yes. It compiles to native code and benchmarks ahead of Rust and Go on our compute tests.

More about Tern

Tern (ternlang) is an early release: the language will change, and so will these numbers. Benchmarks run on an Apple M4 Pro; the full tables, losses included, are on the home page.