Skip to content
temperlangPublic

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Temper

Write once. Compile to every language.
A programming language for problem solvers.

Docs · Quick tour · Tutorial · Reference · Playground


Temper lets a developer or a small team solve a problem once, for every programming language community. It's a language designed for one purpose: to translate well to all the others. You write a library in Temper, and get idiomatic, semantically equivalent libraries in each language, with their tests.

export let half(x: Int): Int {
  x / 2
}

becomes, in Python,

from temper_core import int_div as _int_div

def half(x: int, /) -> int:
    return _int_div(x, 2)

and likewise in each of these*:

C++
C++
C#
C#
Java
Java
JavaScript TypeScript
JS / TS
Lua
Lua
Python
Python
Rust
Rust
…
and more to come

This repository

This is tempest, Temper's compiler written from scratch in Rust (edition 2024): the same language, behavior, and generated APIs as Temper's first compiler, from a much smaller, simpler, and faster code base. It's one small binary, tempest, and it also runs in the browser.

  • The whole pipeline works: parsing, the settle loop (names, macros, and types), an interpreter, tmpl (the backend IR), and seven backends.
  • Temper's functional tests all pass on the interpreter and on every backend, and the generated code passes each language's strict checkers (clippy, tsc --strict, pyright and mypy, LuaLS, and compilers with warnings as errors).
  • Real libraries (Hrefine, Chromarite, Ordable, Kelpto, and Wherewith) pass all their tests in all seven languages.
  • Editors: a language server, tempest lsp, and a VS Code extension (editors/vscode).
  • The command line takes temper's commands and flags: build, test, run, repl, init, serve, version, license, licenses, and help; watch and doc are coming (docs/tools/cli.md).

Try it

  • In your browser: the playground runs the whole compiler as wasm: type Temper and see every language's output, errors, and test results as you type.

  • From source, with Rust 1.85 or later:

    cargo build --release -p tempest
    target/release/tempest test DIR        # run a library's tests
    target/release/tempest build -w DIR    # write temper.out/LANGUAGE/…
    

    A library is a directory with a config.temper.md; the getting started guide makes one. Temper's standard library is built in, so the binary needs nothing beside it.

Documentation

Everything lives under docs/, and on the docs site, beside the playground:

Community

License

COPYRIGHT has the details: code is dual licensed as Apache 2.0 or MIT, and documentation as CC BY-SA 4.0. Third-party materials are listed in NOTICE.

Not endorsed or affiliated

We use other programming language projects' logos and names with permission, but don't imply any official relationship with, or endorsement by, those projects' contributors or sponsors. (We refer to them because we love them, as we love all programming languages, their contributors, and their communities.) Where each logo comes from, and its terms, is in docs/images/lang-icons.

Written with Claude Code and Opus 5.5.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages