tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
396 stars 112 forks source link

Debug's `dump` should support more data types #233

Open 0kenx opened 7 months ago

0kenx commented 7 months ago

Currently, debug's dump() supports String, Int, and Bool. It doesn't support dumping Address, Cell, Slice etc.

To enhance developer experience it makes sense for dump to support all native data types.

anton-trunov commented 7 months ago

Address is supported since PR #175, will be released in v1.3.0

novusnota commented 7 months ago

Address is supported since PR #175, will be released in v1.3.0

Which makes all native data types supported in dump() function. Soon-to-be documented

Gusarich commented 7 months ago

I think we can implement formatted recursive dumping for cells and slices, the same way as csr. from Fift works.

Gusarich commented 7 months ago

I think we can implement formatted recursive dumping for cells and slices, the same way as csr. from Fift works.

While trying to implement this feature, I've came to a problem: STRDUMP doesn't allow printing of a string longer than 127 symbols because it only takes data from the current slice which is limited by 1023 bits. So the implementation will break if cells have more than 508 bits (even less with the indentation).

So I think there's no good way to implement beautiful Cell and Slice dumping at the moment. However, if something like DUMPSLICE is ever introduced in TVM we'll add it to Tact's dump function.

anton-trunov commented 7 months ago

Let's keep this as a reminder