swiftlang / swiftlang/swift-java

jextract: Find ways to minimize string copying when passing Java String to Swift

Open
#202 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature:jextract
Dominant language
Swift
Stars
1.2k
Forks
123
Avg merge
1d 7h
Merged PRs (30d)
16

Description

We could consider if we never escape the Swift string or maybe also look into https://download.java.net/java/early_access/jdk24/docs/api/java.base/java/lang/foreign/Linker.Option.html#critical(boolean) if for some opt-in methods we could avoid copying.

We may also consider another JavaString type which would implement StringProtocol and we would avoid creating a real String in the Swift side which today forces another copy.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the jextract Java String-to-Swift interop path and the referenced JDK 24 Linker.Option critical(boolean) documentation. Compare the proposed no-escape/critical and JavaString/StringProtocol options; done should be an agreed approach with evidence that string copying is reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, swift
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.