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

Extension methods & conversions for Java host types #8821

Closed
JaroslavTulach opened this issue Jan 22, 2024 · 1 comment
Closed

Extension methods & conversions for Java host types #8821

JaroslavTulach opened this issue Jan 22, 2024 · 1 comment
Assignees

Comments

@JaroslavTulach
Copy link
Member

Based on the #8346 (comment) idea.

Since #7858 was implemented, we can use polyglot java import types (e.g. host Java classes) in type ascriptions. The host Java classes are recognized in Meta.type_of and we can even use them in case of statements:

polyglot java import java.math.BigDecimal

c x = case x of
  _ : BigDecimal -> "big"
  _ -> "small"

However there are still few areas where the support of host Java classes isn't on par with Enso types - one cannot add extension methods to them and one cannot define conversion methods. Both of these features are technically possible and they would smooth interoperability between Enso and Java when designing the Enso libraries.

@JaroslavTulach JaroslavTulach moved this from ❓New to 📤 Backlog in Issues Board Jan 23, 2024
@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to 🔧 Implementation in Issues Board Feb 21, 2024
@JaroslavTulach JaroslavTulach linked a pull request Feb 22, 2024 that will close this issue
3 tasks
@JaroslavTulach JaroslavTulach moved this from 🔧 Implementation to 📤 Backlog in Issues Board Mar 12, 2024
@JaroslavTulach
Copy link
Member Author

Now, when the attempts to compile some of the libraries by native image are discussed at

it makes little sense to invest in making Java types first class citizens in Enso. As it is not going to be possible to exchange an object from NI with object from JVM - even if they have the same java.lang.Class they will be different.

@github-project-automation github-project-automation bot moved this from 📤 Backlog to 🟢 Accepted in Issues Board May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants