Skip to content

Prototyping Swift Array Accessor #207

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

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

Conversation

ktoso
Copy link
Collaborator

@ktoso ktoso commented Jan 15, 2025

Early prototyping of a type that is able to operate from Java on native Swift arrays without copying them out of Swift land.

The wrapper should be able to be generic and reasonably safe, where lifetime is managed with an arena, and it is typesafe when used with jextract imported types.

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
}

let DATA = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: make it not global and deal with lifetime

@@ -77,6 +91,15 @@ public class MySwiftClass {
p("i:\(i)")
}

// TODO: workaround until we expose properties again
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: Seems we didn't yet finish moving to the "thunk way" the properties, gotta do that.

// ==== ------------------------------------------------------------------------
// swap

public Wrapped swap(int i, int j) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixme, wrong signature

@ktoso ktoso force-pushed the wip-swift-array-accessor branch 2 times, most recently from a5b2057 to 2d7fb88 Compare January 17, 2025 01:38
@ktoso ktoso force-pushed the wip-swift-array-accessor branch from 2d7fb88 to 49d8ffa Compare January 17, 2025 01:46
@ktoso
Copy link
Collaborator Author

ktoso commented Jan 30, 2025

This is fully expected to conflict a lot right now; I pulled pieces out from it and had changed around a bit to make incremental progress on value types support for now.

@ktoso ktoso marked this pull request as draft January 30, 2025 11:55
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.

1 participant