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

Share code between engine and stdlib #5259

Closed
2 tasks
wdanilo opened this issue Feb 5, 2023 · 2 comments
Closed
2 tasks

Share code between engine and stdlib #5259

wdanilo opened this issue Feb 5, 2023 · 2 comments
Labels
-compiler -libs Libraries: New libraries to be implemented p-low Low priority x-chore Type: chore

Comments

@wdanilo
Copy link
Member

wdanilo commented Feb 5, 2023

This task is automatically imported from the old Task Issue Board and it was originally created by Pavel Marek.
Original issue is here.


As pointed out in this comment, we should investigate how (and if) to share code between engine and std libs. Now, this includes something from std-bits/base

Maybe introduce a library that is independent of engine and provides some specialization for primitives?

Some examples where std-bits duplicate functionality from the engine:

  • std-bits/base/src/main/java/org/enso/base/ObjectComparator.java
    • Should delegate to LessThanNode.

Tasks:

  • Ensure the shared text utilities between engine and std-base use shared backing code
  • Ensure that hashing in std-table is consistent with engine hashing

Comments:

As pointed out in this comment, we should investigate how (and if) to share code between engine and std libs. Now, this includes something from std-bits/base (Pavel Marek - Dec 20, 2022)


@radeusgd
Copy link
Member

Parts of this were done as #5855 - this gives us the shared library which allows for having common code used both on engine and polyglot libraries side.

However, we still need to ensure that the hashing and object comparison/equality mechanism used in the in-memory Table library is delegating to the same code that the engine uses - so that we can avoid code duplication which may lead to potential inconsistency.

The places to look at in particular (not necessarily an exhaustive list):

  • ObjectComparator.java
  • MultiValueKeyBase.java and its 2 implementations: OrderedMultiValueKey and UnorderedMultiValueKey,
  • MatcherFactory.java.

@radeusgd
Copy link
Member

cc: @Akirathan as you may be interested in this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler -libs Libraries: New libraries to be implemented p-low Low priority x-chore Type: chore
Projects
None yet
Development

No branches or pull requests

3 participants