Tact Kitchen
566 subscribers
36 photos
4 videos
60 links
πŸ§‘β€πŸ³ Peek behind the scenes and into the steaming pot of hot updates to Tact compiler, tooling, documentation and ecosystem

⚑️ You know what's cooking β€” Tact!
⌨️ Sources: github.com/tact-lang
πŸ‘‰ t.iss.one/boost/tact_kitchen

Brought to you by the Tact team
Download Telegram
Channel created
⚑️ Probably a navigation post, cooking it up!
⚑173
πŸ—Ώ Where am I? What's Tact Kitchen?

πŸ§‘β€πŸ³ Welcome, fellow chef! Here we bring you tech updates from the Tact team in a digestible form. Read notes on things guaranteed to make it into future releases: from compiler news to plugin enhancements, all ready to be served.

❓ Why, you might ask? Sure, you can subscribe to any repository under github.com/tact-lang and get email notifications right away.

❗️ But if you do it too much, the sheer amount of updates will definitely keep your inbox busy. That's why we've made this channel β€” to make things nice and simple for you ❀️

πŸ“ Now, to navigation!

Main repositories on GitHub:
β€’ Compiler
β€’ Documentation (in the same repo)
β€’ Awesome Tact, the place to collect all community creations
β€’ …and the whole tact-lang, nothing is minor 😎

Community:
β€’ Telegram chat, for tech Q&As πŸ› 
β€’ X/Twitter profile
β€’ and Tact Kitchen β€” you're here, chef 🀌

🍲 Let's cook with Tact!
♨️ @tact_kitchen
⚑11
⚑️ Debugging page just got a massive update: Yay!

Very narrowed table of contents (there's more!):
1️⃣ Description of general debugging approaches for Tact smart contracts
2️⃣ Reference to commonly used debugging functions of Tact
3️⃣ How-to: enable debug mode
4️⃣ How-to: write tests in Blueprint, with Sandbox and Jest
5️⃣ How-to: log via emit()
6️⃣ How-to: handle bounced messages
7️⃣ Experimental lab setup

🍲 Chef's Kiss
♨️ @tact_kitchen
⚑9
Comments have been activated. Health inspectors are invited to make their observations βš•οΈ
⚑️ Remember those weird lvalue expected before ~load_int errors?

Like, when you tried to write this:

beginCell().storeInt(42, 7).asSlice().loadInt(7);


Or something similar, but still got that error?

βœ… Well, not anymore!

Now you can freely use .load() or any other extension function on Slices and compile your code successfully!

πŸ§‘β€πŸ³ Contributor: Gusarich
πŸ‘‰ Released in: v1.3.1
πŸ†™ To upgrade your projects, use npm upgrade, or a similar command in other Node.js package managers.

🍲 Gotta Stay Cookin'
♨️ @tact_kitchen
⚑7
⚑️ 0. Cleared invalid return type from Slice.skipBits()

If you've previously tried to assign it's results somewhere, it failed with an unwieldy FunC error. But now, the return type is cleared, so one more unreadable error got out of the way!

If you need its return value for some reason, take a look at Slice.preloadBits()

πŸ§‘β€πŸ³ Contributor: Gusarich
πŸ™ Implementation: #388
🍽 To be released in: v1.4.0


⚑️ 1. Added bitwise NOT ~ operator

// Let's flip some bits! (~Λ˜β–ΎΛ˜)~
let nice: Int = ~~~~42 + ~~~~27;

// ~(Λ˜β–ΎΛ˜~)
dump(nice);


πŸ§‘β€πŸ³ Contributor: Gusarich
πŸ™ Implementation: #337
🍽 To be released in: v1.4.0


⚑️ 2. Added &=, |= and ^= operators

They combine operations (&, |, ^) with an assignment, so that you can move from this:

a = a & 01000101; // bitwise AND
b = b | 01000101; // bitwise OR
c = c ^ 01000101; // bitwise XOR


To this:

a &= 01000101;
b |= 01000101;
c ^= 01000101;


πŸ§‘β€πŸ³πŸŽ‰ Community contributor: Alejandbel
πŸ™ Implementation: #350
🍽 To be released in: v1.4.0

🍲 When cooking, make sure not to leave the trail of bits
♨️ @tact_kitchen
⚑6
⚑️ Made last semicolon optional in Struct and Message field declarations

// This now works:
struct You { likeJazz: Bool }

// And that works too:
message GuessCoin {
probably: Int as coins;
nothing: Int as coins
// no trailing semicolon above!
}


πŸ§‘β€πŸ³ Contributor: anton-trunov
πŸ™ Implementation: #395
🍽 To be released in: v1.4.0

🍲 The more you shave away, the clearer things become
♨️ @tact_kitchen
⚑4
⚑️ Added local type inference for let statements

It's a fancy way of saying that let statements can now be used without specifying a type after the colon. Tact will infer the type from the value of expression on the right.

// Now you can omit the obvious:
let a = 42;
let b = 27;
let c = a + b; // nice

// Explicit approach continues to work:
let d: Int = a + b; // also nice


πŸ§‘β€πŸ³ Contributor: Gusarich
πŸ™ Implementation: #198
🍽 To be released in: v1.4.0

🍲 Hey, that's my type!
♨️ @tact_kitchen
⚑8
⚑️ 0. Added a Slice.loadBool() function to the core library

It nicely mirrors the existing Builder.storeBool() function, loading a single bit as a signed Int and producing true if it's 1 in binary, and false otherwise.

let slice = beginCell().storeBool(true).asSlice();
let dice = slice.loadBool(); // true


πŸ’‘ Inspired by a discussion with a community member
πŸ§‘β€πŸ³ Contributor: Gusarich
πŸ™ Implementation: #412
🍽 To be released in: v1.4.0


⚑️ 1. Fixed a compilation failure with as coins serialization in maps

Previously, if you've tried to compile the following (or similar):

import "@stdlib/deploy";

contract WhatCoin with Deployable {
c: map<Address, Int as coins>; // ← πŸ‘€
}


It produced a compilation error, telling you that coins is unsupported in map values. But that wasn't right, coins serialization format for Ints as map keys and values should've been supported!

βœ… And now it is, so the snippet above compiles just fine.

⁉️ Reported by: howardpen9
πŸ§‘β€πŸ³ Fixed by: Gusarich
πŸ™ Implementation: #413
🍽 To be released in: v1.4.0

🍲 Gimme, gimme, gimme your bugs after midnight
♨️ @tact_kitchen
⚑6
Tact Kitchen
⚑️ 0. Added a Slice.loadBool() function to the core library It nicely mirrors the existing Builder.storeBool() function, loading a single bit as a signed Int and producing true if it's 1 in binary, and false otherwise. let slice = beginCell().storeBool(…
πŸ’‘ Both those things are somewhat small, but in no way are they minor. That's because they were a direct result of community discussions in Tact chat and elsewhere.

πŸ‘€ We, as Tact devs, keep an eye on every message left in that chat. And even if they don't get an answer from us or other community members sometimes, their existence provides a great fuel and reference for future improvements, fixes and documentation updates.

❀️ Keep your quality questions and feedback coming, and cool stuff won't have to wait!

🍲 Cooking with great care
♨️ @tact_kitchen
❀7