-
Notifications
You must be signed in to change notification settings - Fork 66
Update on SwiftJavaDocumentation #372
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
Conversation
| ### JExtract: Java -> Swift | ||
|
|
||
| SwiftJava's `swift-java jextract` tool automates generating Java bindings from Swift sources. | ||
| SwiftJava's `swift-java jextract` tool automates generating Java bindings to Swift sources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is "from"; we take swift sources as input and generate java; so it's not that the bindings are 'to' swift but that we generate them "from swift sources" 🤔
Maybe this whole sentence needs rewording?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, I was trying to align with the README line 34
**swift-java jextract**
Is a source generator which will **generate Java bindings to existing Swift libraries**.
How about changing the README to "from" for now, and rewording them both afterwards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through the subcommand help message. If I am not mistaken, it should be:
wrap-java: Generates Swift bindings from Java code (Java → Swift).
jextract: Generates Java bindings from Swift code (Swift → Java).
| TODO: Some general intro | ||
|
|
||
| If you prefer a video introduction, you may want to this | ||
| **SwiftJava** provides Java and Swift interoperability with minimal overhead. It eliminates the complex, error-prone process such as manually compiling Java classes to C headers for native access. With SwiftJava, developers can achieve a flexible, safe, and high-performance connection between the two languages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes of a bit weird, no-one is manually compiling java classes in either approach. Maybe something like
| **SwiftJava** provides Java and Swift interoperability with minimal overhead. It eliminates the complex, error-prone process such as manually compiling Java classes to C headers for native access. With SwiftJava, developers can achieve a flexible, safe, and high-performance connection between the two languages. | |
| **SwiftJava** provides a set of tools and libraries to enable Java and Swift interoperability. It allows developers to generate bindings to either language from the other, by using either source generation (for Java consuming Swift code), or by using a combination of Swift macros and source generation (for Swift consuming Java libraries). | |
| The generated code is highly efficient, and less error-prone than manually writing the mappings by hand, and also guarantees memory safety across the boundaries between the languages. |
| If you prefer a video introduction, you may want to this | ||
| **SwiftJava** provides Java and Swift interoperability with minimal overhead. It eliminates the complex, error-prone process such as manually compiling Java classes to C headers for native access. With SwiftJava, developers can achieve a flexible, safe, and high-performance connection between the two languages. | ||
|
|
||
| **Interoperability promotes** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **Interoperability promotes** | |
| Reasons why you might want to reach for Swift and Java interoperability include, but are not limited to, the following scenarios: |
| **SwiftJava** provides Java and Swift interoperability with minimal overhead. It eliminates the complex, error-prone process such as manually compiling Java classes to C headers for native access. With SwiftJava, developers can achieve a flexible, safe, and high-performance connection between the two languages. | ||
|
|
||
| **Interoperability promotes** | ||
| - Incremental adoption of Swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Incremental adoption of Swift | |
| - Incremental adoption of Swift, in an existing Java codebase |
| **Interoperability promotes** | ||
| - Incremental adoption of Swift | ||
| - Reuse of libraries across languages | ||
| - Access libraries with or without native APIs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Access libraries with or without native APIs | |
| - Reuse existing libraries which exist in one ecosystem, but don't have a direct equivalent in the other |
| - Reuse of libraries across languages | ||
| - Access libraries with or without native APIs | ||
| - Implement performance-sensitive code in Swift | ||
| - Support for ecosystem-specific build tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop this, as we're just listing why you might want to use this project now
| - Support for ecosystem-specific build tools |
| - Implement performance-sensitive code in Swift | ||
| - Support for ecosystem-specific build tools | ||
|
|
||
| **Tools** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **Tools** | |
| SwiftJava is offering a number of core libraries which support the language interoperability: |
|
|
||
| **Tools** | ||
| - Swift Package: | ||
| - JavaKit (Java -> Swift) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - JavaKit (Java -> Swift) | |
| - JavaKit (Swift -> Java) - JNI based support library and Swift macros |
| - Swift Package: | ||
| - JavaKit (Java -> Swift) | ||
| - Java Library: | ||
| - SwiftKit (Swift -> Java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - SwiftKit (Swift -> Java) | |
| - SwiftKit (Java -> Swift) - Suport library for Java calling Swift code (either using JNI or FFM) |
| - Java Library: | ||
| - SwiftKit (Swift -> Java) | ||
| - Tooling: | ||
| - swift-java: command line tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - swift-java: command line tool | |
| - `swift-java` - command line tool; Supports source generation and also dependency management operations |
| - SwiftKit (Swift -> Java) | ||
| - Tooling: | ||
| - swift-java: command line tool | ||
| - Build tool integration: SwiftPM Plugin or Gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Build tool integration: SwiftPM Plugin or Gradle | |
| - Build tool integration: SwiftPM Plugin |
we don't yet have a gradle plugin
ktoso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of notes to make it flow a bit better. Please have a look; thanks for the effort updating our docs!
|
Thank you very much for the feedback! I will update it accordingly |
Corrected the direction of interoperability in the documentation and updated the status of Java features.
Sources/SwiftJavaDocumentation/Documentation.docc/SupportedFeatures.md
Outdated
Show resolved
Hide resolved
|
Thanks :) |
Description
SupportedFeatures.mdJExtract Java -> Swift section