Skip to main content
T TON Adoption
← Glossary
NODE/03 · Term

FunC

C-like domain-specific language for writing TON smart contracts. The original mainstream language for TVM; now legacy — the official compiler stopped updating after v2025.07 in favour of Tolk.

Aliases: func language, ton func

FunC is the original high-level language for writing smart contracts on TON. Its syntax borrows from C and from functional ML-style languages: static types, immutable values, explicit impure annotations on functions that touch the world.

Position in the stack

The TON compilation chain is layered:

  1. FunC source (.fc) — what the developer writes.
  2. Fift — an assembly-like, Forth-flavoured intermediate. The FunC compiler emits Fift code.
  3. TVM bytecode — the binary that validators actually execute.

Most developers never touch Fift directly, but it shows up in error messages and in advanced contract debugging.

Syntax in one minute

() recv_internal(slice in_msg) impure {
    var (sender, amount) = parse_msg(in_msg);
    ;; ...
}

int balance() method_id {
    return get_data().begin_parse().preload_uint(64);
}

Notable points:

  • impure marks a function whose order of evaluation matters (writes state, sends a message). Without it the compiler is free to reorder or drop calls.
  • inline forces inlining for hot paths.
  • method_id is how get-methods are registered.
  • Comments use ;; rather than //.

What it produced

Almost every notable TON contract written between 2020 and 2024 — Tonkeeper wallet contracts, the early STON.fi router, the TEP-74 jetton reference, Tonstakers — is FunC. The language is small (around two dozen primitives) and gives full access to TVM cells, but it’s unforgiving: type errors surface at runtime, and most safety has to be hand-rolled.

Legacy status in 2026

The TON Foundation has shifted its official tooling to Tolk. Per the docs, the FunC compiler “is no longer maintained” past version v2025.07. Existing FunC contracts continue to run unchanged — bytecode is stable — but new projects are nudged toward Tolk or Tact.

That said, FunC will not disappear quickly: the audit ecosystem, the open-source contract base, and most senior TON engineers still think in FunC. New developers in 2026 typically learn Tact first for productivity and FunC second for reading legacy code.

When you still want it

  • Auditing an existing contract whose source is FunC.
  • Hand-tuning gas in a hot path where every TVM opcode counts.
  • Working with low-level features (continuations, raw cell tricks) that higher-level languages abstract away.

Related terms