Skip to content

Conversation

@Kamirus
Copy link
Contributor

@Kamirus Kamirus commented Sep 15, 2025

  1. Fixes typing of persistent func to get motoko-core (object-oriented branch) to compile (see the successful test run here)
  2. Makes the typing consistent between eop and non-eop. Removes implicit conversion from persistent func to func in non-eop setting. This is probably less confusing route. We could revert to the "implicit conversion" way but we would need to add more of these conversions in the compiler where they were missing...
  3. Changes were pre-released (here) and used to test the motoko-core object-oriented branch (here)

@Kamirus Kamirus changed the base branch from master to luc/stable-functions September 15, 2025 09:09
@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2025

Comparing from c88e5ef to 636b15a:
In terms of gas, no changes are observed in 5 tests.
In terms of size, no changes are observed in 5 tests.

@Kamirus Kamirus changed the title experiment: stable functions pre-releases experiment: stable functions pre-releases + fixes Sep 16, 2025
persistent func h() : T { x };
h; // TODO: non-eop should still typecheck here
};
// don't allow `func() {}` to typecheck as `persistent() -> ()` for now
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I think anonymous lambdas can never be persistent in Luc's design

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They need a name, I have it in another test

Copy link
Contributor

Choose a reason for hiding this comment

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

I think even just a name ain't enough. The name needs to be unique in the path (i.e. a declaration in a persistent context).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@christoph-dfinity christoph-dfinity Sep 17, 2025

Choose a reason for hiding this comment

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

@Kamirus Kamirus changed the title experiment: stable functions pre-releases + fixes Fix typing to compile motoko-core Sep 17, 2025
@Kamirus Kamirus changed the title Fix typing to compile motoko-core Fix persistent func typing to compile motoko-core Sep 17, 2025
@Kamirus Kamirus marked this pull request as ready for review September 17, 2025 08:27
@Kamirus Kamirus requested a review from a team as a code owner September 17, 2025 08:27
@Kamirus Kamirus requested a review from luc-blaeser September 17, 2025 08:27
Copy link
Contributor

@luc-blaeser luc-blaeser left a comment

Choose a reason for hiding this comment

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

Thank you, Kamil. Much appreciated

@luc-blaeser luc-blaeser merged commit a2d1f34 into luc/stable-functions Sep 19, 2025
19 checks passed
@luc-blaeser luc-blaeser deleted the kamil/stable-functions branch September 19, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants