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

invokeMember should behave the same as readMember.execute #12589

Merged
merged 3 commits into from
Mar 21, 2025

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Mar 20, 2025

Pull Request Description

Turns out new version of GraalPy uses readMember . execute instead invokeMember. The silent assumption is that these two approaches yield the same result. That wasn't the case in Atom so far. This PR fixes that by binding self to a function returned from readMember interop message.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
  • Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 20, 2025
@JaroslavTulach JaroslavTulach added this to the 2025-Q1 Release milestone Mar 20, 2025
@JaroslavTulach JaroslavTulach self-assigned this Mar 20, 2025
Copy link
Member

@Akirathan Akirathan left a comment

Choose a reason for hiding this comment

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

If I understand your PR correctly, you basically ensure that if we read at atom method member via interop, we get a method that has the self preapplied. This kind of makes sense. Note however, that the intended contract for atom members, is that all methods are internal members. So I am wondering why does GraalPy read our internal Atom members?

@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Mar 21, 2025

The best is to ask the authors, but ...

all methods are internal members. So I am wondering why does GraalPy read our internal Atom members

...as far as I see by looking into sent messages there is no call to isMemberInternal at all. Neither in version 24.0.0 nor 24.2.0. E.g. GraalPy doesn't care whether a foreign member is internal or not.

However, according to the java of isMemberInternal:

Internal members are only relevant to guest language implementations and tools, but not to guest applications or embedders

We certainly want GraalPy to invoke methods on Enso objects. Thus either:

  • GraalPy continues to ignore isMemberInternal
  • Enso methods cannot be isMemberInternal

It is doesn't really matter if GraalPy uses invokeMember or readMember . execute. That's completely orthogonal question to isMemberInternal.

@JaroslavTulach JaroslavTulach merged commit a9f16f9 into develop Mar 21, 2025
71 of 72 checks passed
@JaroslavTulach JaroslavTulach deleted the wip/jtulach/InvokeVsReadAndExecute12500 branch March 21, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants