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 a prelude module in the noir_stdlib #2361

Closed
jfecher opened this issue Aug 17, 2023 · 3 comments · Fixed by #3693
Closed

Add a prelude module in the noir_stdlib #2361

jfecher opened this issue Aug 17, 2023 · 3 comments · Fixed by #3693
Labels
enhancement New feature or request
Milestone

Comments

@jfecher
Copy link
Contributor

jfecher commented Aug 17, 2023

Problem

Features like dep::std::println and the upcoming assert_eq are commonly used, core features and can be annoying to have to import into most files.

Happy Case

These symbols are automatically imported into each file, along with any other symbols in a new prelude.nr file in the stdlib.

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@jfecher jfecher added the enhancement New feature or request label Aug 17, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Aug 17, 2023
@phated
Copy link
Contributor

phated commented Aug 17, 2023

Blaine's law: Eventually every language gets a Pervasives 🤣

@jfecher
Copy link
Contributor Author

jfecher commented Aug 17, 2023

Blaine's law: Eventually every language gets a Pervasives 🤣

I think they're useful 🤷. Something being a builtin keyword or being imported automatically is more of an implementation detail than anything.

I would like to experiment with a completely different import system rather than the one most languages use in which developers just pray for tools to automate it for them. Although that is a different topic and likely not for Noir with it's strong Rust influence.

@Savio-Sou
Copy link
Collaborator

For features preluded, is there a common practice in Rust / other languages on whether if they should be kept:

  • Within the stdlib codebase
  • Within the Standard Library doc section
    ?

Thinking if it would be unnecessarily noisy for users if yes.

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Dec 14, 2023
@Savio-Sou Savio-Sou mentioned this issue Dec 14, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants