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

Add support for equality operators via new 'requires' keyword for interfaces #169

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

AndrewAtAvenza
Copy link

This is the proof-of-concept for adding the new interface keyword requires(). While this keyword will currently accept both eq and ord, it only generates code for eq. Also, it currently only works for Java -> C++ (not even the reverse).

Currently, eq means defining both 'equals()andhashCode()in Java and directing them tooperator==(const & other) constandint32_t hashCode() const` respectively. The former should be fine, but the latter could clash with a user-defined method name. Maybe this is an acceptable trade-off though?

@AndrewAtAvenza AndrewAtAvenza marked this pull request as draft January 8, 2025 04:07
AndrewAtAvenza and others added 16 commits January 7, 2025 23:15
December 2024 CI runners don't have sbt anymore
Therefore, install it via actions, fix cross-language-cpp#171
…jinni-generator into AndrewAtAvenza/requires
@a4z
Copy link
Contributor

a4z commented Jan 14, 2025

you should be able to fix the formatCheck CI by running sbt scalafmtAll
see https://djinni.xlcpp.dev/djinni-generator/developer-guide/#code-formatting

if that stopped working, please let me know

@AndrewAtAvenza
Copy link
Author

you should be able to fix the formatCheck CI by running sbt scalafmtAll see https://djinni.xlcpp.dev/djinni-generator/developer-guide/#code-formatting

if that stopped working, please let me know

Much obliged! I took a look at that on Monday but thought I had to install it and could figure out how to do that. Glad it's just there, that's really handy.

Sorry it's been quiet the last couple of days. I'm landing some big branches and blocking a release. Should be back to this tomorrow or Friday. I took a quick look at how it might look publishing Java to C++ and I've got some thoughts I'll post to the discussion thread later.

@a4z
Copy link
Contributor

a4z commented Jan 15, 2025

Sorry it's been quiet the last couple of days. I'm landing some big branches and blocking a release. Should be back to this tomorrow or Friday. I took a quick look at how it might look publishing Java to C++ and I've got some thoughts I'll post to the discussion thread later.

No worries, take your time. This an OS project, so contributing shall also make fun. No stress

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

Successfully merging this pull request may close these issues.

2 participants