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

Add standard library prelude #2769

Merged
merged 5 commits into from
Sep 14, 2022
Merged

Add standard library prelude #2769

merged 5 commits into from
Sep 14, 2022

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Sep 12, 2022

Closes #841.

This adds the standard library prelude with some initial suggested items as per #841 (comment).

The approach is to have the module std::prelude which is then "glob re-exported" by the compiler into init in every module. Extending the prelude is then done in Sway and not in Rust.

@Centril Centril added enhancement New feature or request forc lib: std Standard library compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Sep 12, 2022
@Centril Centril requested a review from a team September 12, 2022 13:43
@Centril Centril requested a review from otrho as a code owner September 12, 2022 13:43
@Centril
Copy link
Contributor Author

Centril commented Sep 12, 2022

(Need to fix shadowing errors temporarily, but feel free to start reviewing as-is...)

Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

Nice one, looks good! Just a couple tiny nits

@mohammadfawaz
Copy link
Contributor

I'm merging this because I'm very excited about it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen enhancement New feature or request forc lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an implicit Sway prelude
4 participants