Overview

Canonical syntax

Every program has exactly one indentation-based source representation (a lossless syntax tree). Programmers do not have to choose between competing ways to write the same code.

Easy-to-ship executables

Tya goes through C, so cross-compilation is straightforward and apps can ship as one runtime-included binary. No VM or external interpreter required.

All-in-one toolchain

The tya binary holds the compiler, formatter, checker, test runner, and package manager.

hello.tya
user = { name: "komagata", age: 20 }

greet = user -> "Hello, {user["name"]}!"

if user["age"] >= 20
  print(greet(user))

Install

Homebrew

brew tap komagata/tap
brew install tya

Shell installer

curl -fsSL https://tya-lang.org/install.sh | sh
curl -fsSL https://tya-lang.org/install.sh | sh
irm https://tya-lang.org/install.ps1 | iex

Toolchain

  • Run immediately: tya run

    Compile and run a source file in one step. Use it for prototypes and quick local checks.

    tya run hello.tya
  • Package for distribution: tya build

    Create an executable. The resulting binary can run without the Tya command.

    tya build hello.tya -o hello
    ./hello
  • Run tests: tya test

    Run the project test suite. The test runner is included in the same binary.

    tya test
  • Find problems: tya lint

    Detect unused variables and discouraged patterns before running or in CI.

    tya lint src
  • Call project tasks: tya task

    List tasks declared by the project and run them from the same command.

    tya task
    tya task run

Docs