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

Use private keyword instead of doc tag in stdlibs #9762

Open
1 task
Akirathan opened this issue Apr 22, 2024 · 2 comments
Open
1 task

Use private keyword instead of doc tag in stdlibs #9762

Akirathan opened this issue Apr 22, 2024 · 2 comments
Labels
-libs Libraries: New libraries to be implemented d-easy Difficulty: little prior knowledge required x-chore Type: chore x-on-hold x-refactor Changes that should not be visible to the end-user

Comments

@Akirathan
Copy link
Member

Akirathan commented Apr 22, 2024

After #9692, the engine now supports private constructors. Let's change all the constructors in our stdlib codebase that use ##PRIVATE doc tag to use the proper private keyword and ensure that they are checked for private access at runtime.

Follow-up of #8836

Let's not do this change with a text / regex / grep replacements. Let's try to make this change more sophisticated and use already existing infrastructure to traverse the IR of all our modules and make the changes in the underlying text buffer. There is org.enso.text.editing.model.TextEdit in the text-buffer project. There is also org.enso.compiler.context.ChangesetBuilder. As part of this issue, investigate how this infrastructure can be used for these kinds of refactorings. Not only it would potentially save time, but it would also be more safe. This refactoring can be implemented as a separate sbt project that depends only on runtime-parser and applies some changes to the sources.

Tasks

Preview Give feedback
@Akirathan Akirathan added d-easy Difficulty: little prior knowledge required x-chore Type: chore -compiler -libs Libraries: New libraries to be implemented x-refactor Changes that should not be visible to the end-user labels Apr 22, 2024
@Akirathan Akirathan self-assigned this Apr 22, 2024
@radeusgd
Copy link
Member

Let's change all the constructors in our stdlib codebase that use ##PRIVATE doc tag to use the proper private keyword and ensure that they are checked for private access at runtime.

Currently we are using the PRIVATE keyword as "don't show this in the GUI" tag as well. That means we definitely do not want to change all constructors marked as PRIVATE to be private. In many cases we have constructors that are more 'advanced' or are just not prepared for usage in interactive mode and should be hidden in the GUI, but they are OK to use for users. We probably will want to create some other tag (e.g. TEXT_ONLY or HIDDEN or whatever) to distinguish those.

Then there's the case of 'PRIVATE' things that should not be used by users, but are used by external libraries - e.g. Internal directory in Standard.Database has a lot of PRIVATE types that must not be private because they are expected to be used by additional implementations of Database backends (e.g. Standard.AWS or Standard.Snowflake).

@GregoryTravis
Copy link
Contributor

We need a way to mark certain pairs of libraries as "friends" to allow inter-library usage without possibly exposing internals to end users.

@GregoryTravis GregoryTravis added -libs Libraries: New libraries to be implemented and removed -libs Libraries: New libraries to be implemented labels Aug 6, 2024
@GregoryTravis GregoryTravis added this to the Future Release milestone Aug 6, 2024
@jdunkerley jdunkerley removed d-easy Difficulty: little prior knowledge required -compiler labels Aug 19, 2024
@GregoryTravis GregoryTravis added the d-easy Difficulty: little prior knowledge required label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-libs Libraries: New libraries to be implemented d-easy Difficulty: little prior knowledge required x-chore Type: chore x-on-hold x-refactor Changes that should not be visible to the end-user
Projects
Status: New
Development

No branches or pull requests

4 participants