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

Scala 3 #367

Open
bblfish opened this issue Jun 14, 2021 · 1 comment
Open

Scala 3 #367

bblfish opened this issue Jun 14, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@bblfish
Copy link
Member

bblfish commented Jun 14, 2021

The move to Scala3 requires a very serious rewrite, as Scala 3 has dropped projection types.
I started a conversation on the lampepfl github discussion space to see how others are coping with this. That has a number of important links too. But I should perhaps move the conversation to a more visible forum.

Anyway, I think when I last tried to compile banana-rdf in Scala3 I ended up with way over 500 problems.

The obvious answer is to use projection types, but it is not that easy. I tried 10 months ago, but at the time my understanding of Scala3 was very small.

@bblfish bblfish added this to the Scala3 milestone Jun 14, 2021
@bblfish bblfish self-assigned this Jun 14, 2021
@bblfish
Copy link
Member Author

bblfish commented Jun 14, 2021

Projection types are not the panacea either I think. Using bananas-rdf in a Scala3 project, I have noticed that there are two problems:

  1. Inheritance of types does not work. So inference from Rdf#Bnode to Rdf#Node do not work automatically.
  2. There is leakage from the underlying projection types if one does not parameterize one's code with Rdf in class SomeClass[Rdf <: RDF](...). I noticed this because I wanted to add a find method to GraphW that returns an Iterator. But if I have Rdf hard code to Jena I get
				acRulesGraph.find(node,wac.default,ANY).exists{ (cnode: Rdf#Node) =>
[error]    |					^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value exists is not a member of org.apache.jena.util.iterator.ExtendedIterator[org.apache.jena.graph.Triple], but could be made available as an extension method.

So Scala3's opaque types may help avoid this type of problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant