Jelly-RDF / jelly-jvm

JVM (Scala) implementation of Jelly
https://w3id.org/jelly/jelly-jvm/
Apache License 2.0
7 stars 2 forks source link

Experiment: completely override term handling in protos #118

Closed Ostrzyciel closed 2 months ago

Ostrzyciel commented 2 months ago

This removes entirely the intermittent traits and case classes for handling oneofs in RdfTriple, RdfQuad, and RdfGraphStart. Although in theory I could achieve this with scalameta, I decided to just copy and modify the generated code, as this should be less finnicky. The code works, it is also much shorter in Scala, but almost the same after bytecode compilation – I use a lot of Scala 3 inlining.

One issue with this is that it's very easy to introduce proto encoding/decoding errors this way. We should definitely add more tests, like:

I will do these once I confirm that it is indeed worth the effort. For now, I'm 99% sure it works.