Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new TVM instructions in stdlib #331

Merged
merged 14 commits into from
Sep 4, 2024

Conversation

Gusarich
Copy link
Member

@Gusarich Gusarich commented May 9, 2024

Closes #324

  • 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

@anton-trunov anton-trunov added this to the v1.4.0 milestone May 24, 2024
@anton-trunov anton-trunov self-assigned this Jun 12, 2024
@Gusarich
Copy link
Member Author

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

@anton-trunov
Copy link
Member

anton-trunov commented Jun 19, 2024

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/emulator@4.2.3 instead of 4.3.0 in CI

warning " > @tact-lang/emulator@4.2.3" 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 anton-trunov modified the milestones: v1.4.0, v1.5.0 Jun 21, 2024
@Gusarich
Copy link
Member Author

Depends on tact-lang/tact-emulator#13

@Gusarich Gusarich added enhancement New feature or request stdlib The Tact standard library has dependency Some other issues need to be resolved first labels Jul 28, 2024
@Gusarich
Copy link
Member Author

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 Gusarich removed the has dependency Some other issues need to be resolved first label Aug 27, 2024
@anton-trunov
Copy link
Member

That would be awesome!

Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some old comments of mine + a new one

stdlib/std/send.tact Outdated Show resolved Hide resolved
stdlib/stdlib.fc Show resolved Hide resolved
stdlib/stdlib.fc Show resolved Hide resolved
stdlib/stdlib.fc Show resolved Hide resolved
@Gusarich Gusarich marked this pull request as ready for review August 29, 2024 09:20
@anton-trunov anton-trunov changed the title Extend standard library with new TVM instructions feat: new TVM instructions in stdlib Aug 29, 2024
@anton-trunov
Copy link
Member

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

stdlib/stdlib.fc Outdated Show resolved Hide resolved
@anton-trunov
Copy link
Member

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

@anton-trunov
Copy link
Member

@Gusarich Any progress on this?

@Gusarich
Copy link
Member Author

Gusarich commented Sep 3, 2024

@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

@anton-trunov
Copy link
Member

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

@Gusarich
Copy link
Member Author

Gusarich commented Sep 3, 2024

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.

@anton-trunov
Copy link
Member

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.

@Gusarich
Copy link
Member Author

Gusarich commented Sep 3, 2024

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

@anton-trunov
Copy link
Member

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

Yes, let's go for it

@Gusarich Gusarich requested review from anton-trunov and a team and removed request for anton-trunov and novusnota September 3, 2024 06:28
stdlib/std/contract.tact Outdated Show resolved Hide resolved
stdlib/stdlib.fc Outdated Show resolved Hide resolved
Gusarich and others added 2 commits September 4, 2024 19:14
Co-authored-by: Anton Trunov <anton.a.trunov@gmail.com>
…d.tact` already && add comments to new functions && remove parameters shuffling
@anton-trunov
Copy link
Member

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

@Gusarich
Copy link
Member Author

Gusarich commented Sep 4, 2024

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

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stdlib The Tact standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend standard library with new TVM instructions
3 participants