tact icon indicating copy to clipboard operation
tact copied to clipboard

Extend standard library with new TVM instructions

Open Gusarich opened this issue 9 months ago • 3 comments

Closes #324

[WORK IN PROGRESS]

  • [ ] I have updated CHANGELOG.md
  • [ ] I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • [ ] I have run all the tests locally and no test failure was reported
  • [ ] I did not do unrelated and/or undiscussed refactorings

Gusarich avatar May 09 '24 20:05 Gusarich

Seems like https://github.com/tact-lang/tact-emulator doesn't support new opcodes yet: I'm getting Invalid opcode error in tests.

Gusarich avatar Jun 19 '24 09:06 Gusarich

Seems like https://github.com/tact-lang/tact-emulator doesn't support new opcodes yet: I'm getting Invalid opcode error in tests.

Looks like you are getting @tact-lang/[email protected] instead of 4.3.0 in CI

warning " > @tact-lang/[email protected]" has unmet peer dependency "ton-abi@^0.0.1".

You might need to update the yarn.lock file (and package.json too, although it uses ^ for the emulator package)

anton-trunov avatar Jun 19 '24 09:06 anton-trunov

Depends on https://github.com/tact-lang/tact-emulator/issues/13

Gusarich avatar Jul 28 '24 06:07 Gusarich

I guess since we won't use tact emulator anymore after the merge of #651, we can ignore that issue and finish this stdlib update.

Gusarich avatar Aug 27 '24 14:08 Gusarich

That would be awesome!

anton-trunov avatar Aug 27 '24 14:08 anton-trunov

Looks like you also need to commit the changes to the generated stdlib.ts

anton-trunov avatar Aug 29 '24 11:08 anton-trunov

@Gusarich Looks like after #768 this can be implemented directly in Tact

anton-trunov avatar Sep 01 '24 17:09 anton-trunov

@Gusarich Any progress on this?

anton-trunov avatar Sep 03 '24 04:09 anton-trunov

@Gusarich Looks like after #768 this can be implemented directly in Tact

yes, but I think we can keep this PR as it's now and do that for future stdlib updates

Gusarich avatar Sep 03 '24 05:09 Gusarich

I think we can keep this PR as it's now and do that for future stdlib updates

Let's do a bit of doogfooding here: the more we use our own language features for the stdlib the less bugs those are going to have. And this is important because we are going to do a new release pretty soon

anton-trunov avatar Sep 03 '24 05:09 anton-trunov

I think we can keep this PR as it's now and do that for future stdlib updates

Let's do a bit of doogfooding here: the more we use our own language features for the stdlib the less bugs those are going to have. And this is important because we are going to do a new release pretty soon

then what about all other functions from stdlib? Many of them are used in writeStdlib.ts so we can't just rewrite them natively in Tact.

Gusarich avatar Sep 03 '24 05:09 Gusarich

then what about all other functions from stdlib? Many of them are used in writeStdlib.ts so we can't just rewrite them natively in Tact.

It's fine. If it cannot be done easily (at least now), let's not do it. When I ported some stdlib functions to use asm-blocks instead of a FunC binding, I wasn't trying to go overboard with that.

anton-trunov avatar Sep 03 '24 05:09 anton-trunov

@anton-trunov so should I move the new functions from stdlib.fc to Tact stdlib for this PR?

Gusarich avatar Sep 03 '24 06:09 Gusarich

@anton-trunov so should I move the new functions from stdlib.fc to Tact stdlib for this PR?

Yes, let's go for it

anton-trunov avatar Sep 03 '24 06:09 anton-trunov

LGTM. Just the specllchecker complaints. Btw, we do have Knip now with pre-push lints running automatically and those include spellchecking

anton-trunov avatar Sep 04 '24 16:09 anton-trunov

LGTM. Just the specllchecker complaints. Btw, we do have Knip now with pre-push lints running automatically and those include spellchecking

fixed

Gusarich avatar Sep 04 '24 16:09 Gusarich