πΏ 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
π§βπ³ 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
6οΈβ£ How-to: handle bounced messages
7οΈβ£ Experimental lab setup
π² Chef's Kiss
β¨οΈ @tact_kitchen
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
Like, when you tried to write this:
Or something similar, but still got that error?
β Well, not anymore!
Now you can freely use
π§βπ³ Contributor: Gusarich
π Released in: v1.3.1
π To upgrade your projects, use
π² Gotta Stay Cookin'
β¨οΈ @tact_kitchen
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
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
π§βπ³ Contributor: Gusarich
π Implementation: #337
π½ To be released in: v1.4.0
β‘οΈ 2. Added
They combine operations (
To this:
π§βπ³π 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
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 ^= operatorsThey 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
π§βπ³ Contributor: anton-trunov
π Implementation: #395
π½ To be released in: v1.4.0
π² The more you shave away, the clearer things become
β¨οΈ @tact_kitchen
// 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
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.
π§βπ³ Contributor: Gusarich
π Implementation: #198
π½ To be released in: v1.4.0
π² Hey, that's my type!
β¨οΈ @tact_kitchen
let statementsIt'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
It nicely mirrors the existing Builder.storeBool() function, loading a single bit as a signed Int and producing
π‘ 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
Previously, if you've tried to compile the following (or similar):
It produced a compilation error, telling you that
β 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
Slice.loadBool() function to the core libraryIt 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 mapsPreviously, 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
π 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