About
The Tern programming language
Tern (search for ternlang) is a compiled, statically typed language that reads like Python, built so AI coding agents get it right and what they write runs fast and lean. Its home is ternlang.dev.
curl -fsSL https://ternlang.dev/install.sh | sh
tern new myapp && cd myappNot to be confused with
- Tern for JavaScript (tern.js), the code-analysis engine for editors. Different project; Tern the language has its own TypeScript tool, ternTS.
- tern, the PostgreSQL migration tool written in Go. Tern the language has its own migrations package,
migrate. - Ternary logic or the
?:operator. Unrelated; the name is the bird.
Tern in one paragraph
Tern compiles through C to native code for macOS and Linux, and to WebAssembly, iOS and Android. Every value is a copy, so there are no pointers, no null and no borrow checker, and the compiler rejects data races in parallel code. It ships with an HTTP server, JSON, regex, CSV, crypto and compression in the standard library, and packages for PostgreSQL, SQLite, Redis and the roost web framework. Files end in .tn, and projects have a tern.mod.
Questions
What is ternlang?
Ternlang is the Tern programming language: a compiled, statically typed language with Python-like syntax, at ternlang.dev.
What file extension does Tern use?
.tn for source files, and tern.mod for a project's module file.
How do I install Tern?
On macOS or Linux, run curl -fsSL https://ternlang.dev/install.sh | sh. Tern compiles through C, so you also need clang.
Who makes Tern?
The Tern team, who also build ternTS, StackGrep and SkimmerDB with it.
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.