TGViewer
TON Tech TON Tech @tontech Β· 24.3K subscribers
Post #131 1.58K

Forwarded from TOLK lang

🫧 Tolk v1.0: lazy loading, partial updating, AST inlining β€” and extremely low gas fees

This is happening today.

I managed not only to finish up the compiler, but also to migrate standard contracts from FunC to Tolk.

I covered every contract with gas metrics to check whether it's more efficient than FunC or not. I didn't believe my eyes. I double-checked, triple-checked, but nothing changed. The results are correct. And now I am ready to present them to you.

πŸ§ͺ Benchmarks!

Every contract has several metrics. For example, "basic jetton β€” mint".
FunC: 19278. Tolk: 11611.
Gas savings: -39.77%

|————————————————–-
| 01 β€” Jetton (mint, transfer, burn, discover)
| -39.77% | -30.32% | -33.66% | -26.75%
|————————————————–-
| 02 β€” NFT (deploy, transfer, onchain get)
| -43.79% | -37.47% | -44.28%
|————————————————–-
| 03 β€” Notcoin
| -35.72% | -27.98% | ...
|————————————————–-
| 04 β€” tgBTC
| -23.94% | -26.99% | ...
|————————————————–-
| 05 β€” Wallet v5
| -21.66% | -22.92% | ...
|————————————————–-
| 06 β€” Vesting
| -45.30% | -29.61% | ...
|————————————————–-
| 07 β€” Telegram gifts
| -54.81% | -39.39% | ...
|————————————————–-

I have migrated 7 contracts β€” preserving the original behavior and passing the same tests.

All benchmarks are open. No cheating. Just a smart compiler β€” and a language designed to be optimized.

β€” Even wallet?! But it's very low-level and tricky!

Even wallet. You just express your thoughts without any tricks β€” and it works automatically.

β€” But how? How is it possible to achieve such numbers?

Of course, I've put a lot of smartness into the compiler. A strong type system. Automatic inlining. Built-in serialization. The magic lazy keyword.

But first of all, Tolk is built for readability. These contracts aren't "just cleaner" than their FunC equivalents β€” they're elegant. No magic. No low-level intrigues. Just clean, consistent logic β€” whether it's a Jetton or a Wallet.

And gas savings? They are a consequence. I didn't micro-optimize. Each contract was rewritten in about a day β€” just focusing on clarity. The core principle is simple: once you make it elegant, it automatically becomes efficient.


βœ… Notable changes in Tolk v1.0:

1. Lazy loading β€” only read what you actually use
2. AST-based inlining β€” zero-cost getters and methods
3. Peephole optimizations, TVM-11 β€” smaller code, lower gas

PR on GitHub with detailed info.

Just take a look:

val st = lazy Storage.load();
// the compiler skips everything and loads only what you access
return st.publicKey;


That's it. Lazy loading and partial updates (calculating immutable slices for writing) β€” one magic lazy keyword to rule them all.

βš™οΈ The Release. What's inside

- JetBrains IDE plugin β€” with completion, resolving, etc... βœ“ done
- VS Code Extension β€” with suggestions, stdlib integration, etc... βœ“ done
- Language server β€” for any LSP-compatible editor... βœ“ done
- FunC-to-Tolk converter β€” migrate a project in 10 seconds... βœ“ done
- Documentation β€” for smooth transition from FunC... βœ“ done

And the TOLK language itself β€” exactly as I've visioned it... 7 months ago


πŸ“… The essence of Numbers

At this moment, abstract yourself from the text. Take a look at the calendar.

Today is 07/07/25 (I mean 2+5, of course).

After the TON Gateway, throughout all November, I was laying out the roadmap towards Tolk v1.0. On December 1, I started working. It means, that the journey till now took exactly 7 months 7 days. If you scroll this channel to the top, you'll see an announcement... Of Tolk v0.7

πŸͺ What's next?

I could have written about my plans β€” for the language, TVM, ABI, TypeScript wrappers... but I won't.

Because today, instead of rushing into the future, maybe we can allow ourselves to look back.
To pause the endless race β€” just for a moment.
To notice how many beautiful coincidences pass us by β€” unnoticed in our constant hurry.

Just step outside.
Close your eyes.
Count to seven.
Feel it.

When you're ready β€”
Let's Tolk
  • πŸ”₯ 10
  • ❀ 3
  • ❀‍πŸ”₯ 1
  • πŸ’Š 1
More from @tontech
  1. Jun 15, 2026πŸ’Ž Toncoin β†’ Gram The rebranding is in progress πŸ”₯
  2. Jun 10, 2026Read more about all the updates, including new dApp scenarios, Structured items, Trace ID,…
  3. Jun 10, 2026TON Connect Bridge v3. The new bridge introduces horizontal scaling and shared infrastruct…
  4. Jun 10, 2026Embedded requests. Wallet connection and action execution can now be combined into a singl…
  5. Jun 10, 2026Gasless transactions. Applications can now cover transaction fees for users and accept pay…
  6. Jun 10, 2026TON Connect v3. TON Connect has received a major update with gasless transactions, connect…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’