Open StuartFarmer opened 1 week ago
Hey Stuart, thanks for opening this issue! The example you shared is also covered in #9 and I still think that having messages defined separately from functions is a better option than embedding that information into the definition of receivers. This is due to the fact that you need to share message declarations between several contracts or even several projects to ensure compatibility.
Having said that, I think we should improve the Tact tooling to support smart contract programmers in this area. For instance, the 'go-to-definition' functionality in editors/IDEs would come handy when you need to see the fields of messages.
Another useful tool that we can implement would be something that gives you a diagram of inter-contract communication with all contracts' senders and receivers linked to each other with the message type info included.
also have some ideas around the send(SendParameters{}) function call which is used a lot which I will write something up on
Please do share, I'd love to hear your thought on this. This is an especially good time for this, since we are designing Tact 2.0: #249. (The design phase is not very active right now, since the Tact team is focusing on adding new features and fixing bugs in Tact v1.0)
Tact is a great language, but there are some things that can be improved to make the developer experience much smoother and improve the speed of development. Improving developer experience allows for more developers to be onboarded because the language is easier to learn, and increases productivity because the time to develop is reduced. This is a win-win for Ton.
I built a fully functional Python smart contracting system for my last startup (https://github.com/lamden/contracting) which was heavily focused on developer experience and speed of development, so I'm pretty passionate about this subject and would love to discuss how to improve the DX for Tact.
Let's use this thread to discuss potential DX improvements that we would like to see.
Firstly, Ton is a message-based blockchain. Therefore, Tact diverges from traditional 'function calls' and opts for processing messages through a singular 'receive' system. However, this breaks down when there are many different types of messages to receive, and it causes the developer to have to continuously look up what the components of each message struct are. Example:
From this function, I do not know what
GetRoyaltyParams
contains without opening up my separatemessages.tact
file. This makes auditing and development frustrating.What if receive functions were mocked up more like RPC calls?
Tact would be able to construct the message code dynamically here because it is essentially encapsulated in the function definition. Consider a more complex example:
In the new concept, it would be simplified to:
Nice.
I would love all your thoughts on this. I also have some ideas around the
send(SendParameters{})
function call which is used a lot which I will write something up on.