> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ton.org/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.ton.org/feedback

```json
{
  "path": "/tolk/overview",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Tolk language

Tolk is a statically typed language for writing smart contracts on TON. It provides declarative data structures, automatic cell serialization, and message handling primitives.

The language compiles to [TVM](/tvm/overview) and provides direct control over execution.

```tolk theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
type AllowedMessage = CounterIncrement | CounterReset

fun onInternalMessage(in: InMessage) {
    val msg = lazy AllowedMessage.fromSlice(in.body);
    match (msg) {
        CounterIncrement => { ... }
        CounterReset => { ... }
    }
}

get fun currentCounter() {
    val storage = lazy Storage.load();
    return storage.counter;
}
```

Tolk is compatible with existing [TON standards](/from-ethereum#standards).

## Key features

Tolk provides high-level readability while preserving low-level control:

* a type system for describing [cell](/foundations/serialization/cells) layouts;
* [`lazy` loading](/languages/tolk/features/lazy-loading) that skips unused fields;
* unified message composition and deployment;
* a compiler targeting the Fift assembler;
* tooling with IDE integration.

## From FunC to Tolk

Tolk evolved from FunC and is now the recommended language for TON smart contracts. To migrate from FunC:

* see [Tolk contract examples](/languages/tolk/examples) for embedded jetton and NFT examples;
* check [gas benchmarks](https://github.com/ton-blockchain/tolk-bench);
* read [Tolk vs FunC](/languages/tolk/from-func/tolk-vs-func) for an overview;
* use the [FunC-to-Tolk converter](/languages/tolk/from-func/converter) to migrate existing projects.

## Quick start

1. Run the command:

   ```bash theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
   npm create ton@latest
   ```

2. Enter a project name and choose "A simple counter contract (Tolk)".

3. Follow [Your first smart contract](/contract-dev/first-smart-contract) page to write the contract in Tolk.

## IDE support

1. [JetBrains IDEs plugin](/contract-dev/ide/jetbrains#tolk) provides syntax highlighting and code navigation.
2. [VSCode extension](/contract-dev/ide/vscode#tolk) adds syntax highlighting, code navigation, and other language features for VS Code and VS Code-based editors such as VSCodium, Cursor, and Windsurf.
3. [Language server](https://github.com/ton-blockchain/ton-language-server#other-editors) supports (Neo)Vim, Helix, and other editors with LSP support.

## Start with

* [Basic syntax](/languages/tolk/basic-syntax)
* [Idioms and conventions](/languages/tolk/idioms-conventions)
* [Contract examples](/languages/tolk/examples)
* [Type system](/languages/tolk/types/list-of-types)
* [Message handling](/languages/tolk/features/message-handling)
