Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Is it more cost-effective to use Fift instead of FunC?

As far as I understand, code in FunC language compiles to Fift, and then from Fift code the resulting bag of cells is generated. Could I make my code more cost-effective (so it will use less gas) by writing it directly in Fift without conversion from FunC? Or the difference would be too small to care?


This question was imported from Telegram Chat:https://t.me/tondev/72009

Votes Newest

Answers 2


You can do it, and it probably helps your smart contract to consume less gas, however, it makes it more difficult to read it and check it for security reasons, and also makes maintenance of it harder.

I guess it doesn't worth it to save some gas in the TON ecosystem, because gas prices are fixed, and they're very cheap.

2
2
Posted one year ago

Yes, it is possible to write your code directly in Fift to make it more cost-effective in terms of gas consumption. The reason is that Fift is a lower-level language than FunC, which means that it provides more fine-grained control over the code and allows for more efficient programming.

However, writing code directly in Fift requires more expertise and effort, as Fift is a stack-based language and has a steeper learning curve than FunC. Therefore, it may not be worth the effort for simple or small contracts.

In summary, writing code directly in Fift can result in more efficient and cost-effective contracts, but it requires more expertise and effort.

1
1
Posted one year ago