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

Enso facility for finding implementations of SPI across loaded/available libraries #11724

Open
radeusgd opened this issue Nov 29, 2024 · 1 comment · May be fixed by #11868
Open

Enso facility for finding implementations of SPI across loaded/available libraries #11724

radeusgd opened this issue Nov 29, 2024 · 1 comment · May be fixed by #11868
Assignees

Comments

@radeusgd
Copy link
Member

We are currently relying on "SPI" provided by ServiceLoader.

The bug #11707 showed us some limitations of this approach in conjunction with Native Image.

Additionally, some of our libraries contain Java code solely to register their SPIs, for example the Microsoft library contains only SPI registrations and no other Java code.

At some point we would like to get a "native" facility giving us ability to implement a similar pattern in pure Enso. We would like to be able to register some types defined in various libraries as "implementations" of a base SPI and then ability for the base type to query a list of all available registrations.

This way we:

  • no longer need to add a Java library just to register SPI types,
  • can have more control - can not expose SPIs for libraries that are not loaded within Native Image.
@radeusgd
Copy link
Member Author

One other thing that has been discussed lately is being able to discover libraries that are not currently loaded but are available (on user's system or in current edition).

Perhaps this new facility could give us a way to query either currently loaded libraries or additionally also all libraries that are available to be imported. This will allow us to move towards not importing all libraries in the default GUI project but only the basic stuff (Base, Table, Database) and being able to add additional imports on demand. The full ability to do this will require co-ordination between engine, libs and GUI, so it probably requires additional design. But I'm noting this requirement here so that we can take into consideration that listing all 'available' and not necessarily currently loaded implementations of an SPI is one of the things that we may need in the future, so it would be good if this new facility was prepared to handle this.

@radeusgd radeusgd changed the title Enso facility for finding implementations of a type across loaded/available libraries Enso facility for finding implementations of SPI across loaded/available libraries Nov 29, 2024
@JaroslavTulach JaroslavTulach self-assigned this Dec 3, 2024
@JaroslavTulach JaroslavTulach moved this from ❓New to 📤 Backlog in Issues Board Dec 3, 2024
@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to ⚙️ Design in Issues Board Dec 13, 2024
@JaroslavTulach JaroslavTulach linked a pull request Dec 16, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⚙️ Design
Development

Successfully merging a pull request may close this issue.

2 participants