TGViewer
TOLK lang TOLK lang @tolk_lang Β· 809 subscribers
Post #23 7.95K
🫧 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
  • πŸ”₯ 65
  • πŸ‘ 25
  • ❀ 23
  • πŸ‘ 7
  • ⚑ 2
  • 🀯 2
  • 😱 2
More from @tolk_lang
  1. Jun 23, 2026🫧 Tolk v1.4.x: internal progress and maintenance Since the v1.4 release we've published T…
  2. May 11, 2026🫧 TON enters a new era of smart-contract development I promised this would happen in May.…
  3. Mar 27, 2026🫧 Tolk v1.3: moving toward a general-purpose language After the previous post, this relea…
  4. Mar 19, 2026🫧 Tolk v1.3... not released yet: what's happening inside I know it has been quiet. The la…
  5. Dec 5, 2025🫧 Tolk documentation β€” now complete and available for learning from scratch From now on,…
  6. Nov 14, 2025🫧 Tolk v1.2: rich bounced messages, cheap deployment, and a breaking change that you'll l…
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 β†’