TGViewer
TON Dev News TON Dev News @tondev_news · 41.1K subscribers
Post #217 2.79K

Forwarded from TOLK lang

🫧 Tolk v0.99: universal message composition

This update introduces a high-level, type-safe way to compose and send messages to other contracts.

No more manual beginCell().storeUint(...).storeRef(...) boilerplate. Just describe the message in a literal, and let the compiler do the rest.

✅ Notable changes in Tolk v0.99:

1. Universal createMessage – control body, extra currency, stateInit, and more
2. Universal createExternalLogMessage — emit logs efficiently
3. Sharding — calculate addresses "close to another contract"

PR on GitHub with detailed info.

✔ createMessage: short demo


val reply = createMessage({
bounce: false,
value: ton("0.05"),
dest: senderAddress,
body: RequestedInfo { ... }
});
reply.send(SEND_MODE_REGULAR);


Key features:

1. Supports extra currencies
2. Supports stateInit with automatic address computation
3. Supports different workchains
4. Supports sharding (formerly splitDepth)
5. Integrated with auto-serialization of body
6. Automatically detects "body ref or not"

✔ Union types as the foundation

Almost every field is a union — flexible API while staying strictly typed:


// value: either tons, or tons + extra currencies
value: ton("1.5")
value: (ton("1.5"), extraDict)

// destination: various forms
dest: someAddress
dest: (workchain, hash)


✔ Body: inline or ref?

Don't think about refs — the compiler does:
- small structs are inlined
- large ones are wrapped in a ref
- detected at compile-time — no runtime checks


// any serializable struct — no toCell!
body: RequestedInfo { ... }


Don't need body? Just leave it out.

✔ Deployment: a variant of "destination"


dest: {
    workchain: BASECHAIN,
    stateInit: { code, data },
}


The beauty of TON is that it doesn't have a dedicated deployment mechanism. You just send a message to some void — and if this void doesn't exist, but you've attached a way to initialize it — it's initialized immediately, and accepts your message.

✔ Sharding!

Built-in features to calculate an address "in the shard of contract B."


dest: {
...
toShard: {
fixedPrefixLength: 8,
closeTo: ownerAddress,
}
}


Perfect for optimized sharded jettons. All the hashing, StateInit packing, and bit-level work is done automatically.

⚙️ What about gas costs?

Even with all this flexibility, createMessage is not bloated. The compiler unfolds all union branches and constant conditions at compile time, producing flat, minimal code — often more optimal than hand-crafted cell composition.

❓ v0.99? So, what's next?

Yes, it's the last version before the final release. Tolk now covers the entire initial roadmap and is ready for real-world use. On top of that, we'll add several compiler optimizations and rewrite standard contracts from FunC to Tolk — to demonstrate how exactly everything ties together.
  • 👍 16
  • ❤ 7
  • 🔥 3
  • ⚡ 2
  • 🥰 1
  • 💯 1
  • 👨‍💻 1
More from @tondev_news
  1. Jun 15, 2026🤑GRAM is live! The ticker, logo and name are changing. Everything else stays the same. Sa…
  2. Jun 11, 2026Bot API 10.1 📝 Markup Revolution This update introduces native text styling tools to enab…
  3. Jun 10, 2026TON Connect v3. TON Connect has received a major update with gasless transactions, connect…
  4. Jun 4, 2026MTONGA / MGRAMGA: the next step is clear: 30% extra on any top-up at @dtontech_bot / dton.…
  5. Jun 1, 2026🪙 Toncoin Name Change — Community Vote TON has changed substantially in recent months. Te…
  6. May 18, 2026🧠 AI devs asked for this — and we delivered. 🤖 Bots can now talk to other bots on Telegr…
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 →