Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9297861
swift: Add zero-fill and little-endian store helpers to ByteBuffer.
yash-agarwa-l Oct 24, 2026
d14da6e
swift: Add null bitmap helpers for the row format.
yash-agarwa-l Oct 24, 2026
87a81d7
swift: Add offset and size slot encoding for the row format.
yash-agarwa-l Oct 24, 2026
b44887d
swift: Add the row schema model.
yash-agarwa-l Oct 26, 2026
c38ea5a
swift: Add the Row reader.
yash-agarwa-l Oct 26, 2026
46c9edb
swift: Add the RowArray and RowMap readers.
yash-agarwa-l Oct 26, 2026
c5eb1ad
swift: Add RowWriter for fixed and variable-width fields.
yash-agarwa-l Oct 29, 2026
774e48f
swift: Add array, map, and nested struct writers.
yash-agarwa-l Oct 30, 2026
962ef65
swift: Add schema bytes and the schema hash.
yash-agarwa-l Nov 3, 2026
5468083
swift: Add RowCodable with scalar and temporal conformances.
yash-agarwa-l Nov 3, 2026
a3a4b95
swift: Add collection conformances and RowEncoder.
yash-agarwa-l Nov 4, 2026
7d90f34
swift: Add the @ForyRow macro.
yash-agarwa-l Nov 10, 2026
3cf2ff7
swift: Test @ForyRow encoding end to end.
yash-agarwa-l Nov 11, 2026
30451ad
swift: Rename a one-letter test variable.
yash-agarwa-l Nov 12, 2026
84adbf0
swift: Add a row format peer for the Java interop tests.
yash-agarwa-l Nov 12, 2026
3f9db94
java: Add SwiftCrossLanguageTest.
yash-agarwa-l Nov 12, 2026
980b76d
ci: Run the Swift row format interop test.
yash-agarwa-l Nov 12, 2026
4aa161e
Merge remote-tracking branch 'upstream/main' into row-format-swift
yash-agarwa-l Nov 12, 2026
f3c79cd
docs: Add the Swift row format guide.
yash-agarwa-l Nov 12, 2026
03e497a
swift: Format the row reader and writer tests.
yash-agarwa-l Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -562,18 +562,19 @@ jobs:
~/.swiftpm
~/Library/Caches/org.swift.swiftpm
swift/.build
key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-xlang-release-${{ steps.swift-package-cache.outputs.toolchain }}-${{ hashFiles('swift/Package.resolved', 'swift/Package.swift', 'swift/Sources/**', 'swift/Tests/ForyXlangTests/**') }}
key: ${{ runner.os }}-${{ runner.arch }}-swiftpm-xlang-release-${{ steps.swift-package-cache.outputs.toolchain }}-${{ hashFiles('swift/Package.resolved', 'swift/Package.swift', 'swift/Sources/**', 'swift/Tests/ForyXlangTests/**', 'swift/Tests/ForyRowXlangPeer/**') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-swiftpm-xlang-release-${{ steps.swift-package-cache.outputs.toolchain }}-
- name: Prebuild Swift xlang peer for cache reuse
- name: Prebuild Swift xlang peers for cache reuse
run: |
cd swift
if [[ "${{ steps.swift-build-cache.outputs.cache-hit }}" == "true" && -x .build/release/ForyXlangTests ]]; then
echo "Using cached Swift xlang peer at swift/.build/release/ForyXlangTests"
if [[ "${{ steps.swift-build-cache.outputs.cache-hit }}" == "true" && -x .build/release/ForyXlangTests && -x .build/release/ForyRowXlangPeer ]]; then
echo "Using cached Swift xlang peers at swift/.build/release/ForyXlangTests and swift/.build/release/ForyRowXlangPeer"
echo "FORY_SWIFT_PEER_PREBUILT=1" >> "$GITHUB_ENV"
exit 0
fi
swift build -c release --disable-automatic-resolution --product ForyXlangTests
swift build -c release --disable-automatic-resolution --product ForyRowXlangPeer
echo "FORY_SWIFT_PEER_PREBUILT=1" >> "$GITHUB_ENV"
- name: Run Swift Xlang Test
env:
Expand All @@ -584,6 +585,8 @@ jobs:
mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true
cd fory-core
mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.xlang.SwiftXlangTest
cd ../fory-format
mvn -T16 --no-transfer-progress test -Dtest=org.apache.fory.format.SwiftCrossLanguageTest

swift_idl:
name: Swift IDL Tests
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,8 @@ deserialization, see the [Java row-format guide](docs/row-format/java.md),
[Python row-format guide](docs/row-format/python.md),
[C++ row-format guide](docs/row-format/cpp.md),
[Rust row-format guide](docs/row-format/rust.md),
[Go row-format guide](docs/row-format/go.md), and
[Go row-format guide](docs/row-format/go.md),
[Swift row-format guide](docs/row-format/swift.md), and
[row-format specification](docs/specification/row_format_spec.md).

## Fory JSON
Expand Down
12 changes: 6 additions & 6 deletions docs/introduction/choose-a-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ license: |
limitations under the License.
---

| Format or mode | Data model | Use it when | Interoperability | Start here |
| -------------- | ----------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------- |
| Xlang binary | Portable object graphs | Data crosses language boundaries | Shared wire format across supported Fory implementations | [Cross-language guide](../object-serialization/xlang.md) |
| Native binary | Language-native object graphs | Producer and consumer use one Fory implementation family | One Fory implementation family only | [Object Serialization](../object-serialization/index.md) |
| Row Format | Random-access binary rows | You need random field access or analytics-style partial reads | Standard Row is shared by Java, Python, C++, and Rust; Compact is Java-only | [Row Format guide](../row-format/index.md) |
| Fory JSON | Standard JSON mapped to JVM objects | Java, Kotlin, or Scala applications need standard JSON | Standard JSON text | [Fory JSON guide](../json/index.md) |
| Format or mode | Data model | Use it when | Interoperability | Start here |
| -------------- | ----------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Xlang binary | Portable object graphs | Data crosses language boundaries | Shared wire format across supported Fory implementations | [Cross-language guide](../object-serialization/xlang.md) |
| Native binary | Language-native object graphs | Producer and consumer use one Fory implementation family | One Fory implementation family only | [Object Serialization](../object-serialization/index.md) |
| Row Format | Random-access binary rows | You need random field access or analytics-style partial reads | Standard Row is shared by Java, Python, C++, Rust, and Swift; Compact is Java-only | [Row Format guide](../row-format/index.md) |
| Fory JSON | Standard JSON mapped to JVM objects | Java, Kotlin, or Scala applications need standard JSON | Standard JSON text | [Fory JSON guide](../json/index.md) |

Xlang and native are sibling modes of Object Serialization. Use them when the receiver needs to
reconstruct an object graph. Row Format and Fory JSON are separate formats, not additional Object
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ optimized for analytics and partial-read workloads:
- **Zero-copy random access**: Read fields, arrays, and nested values without rebuilding whole objects.
- **Partial operations**: Read only the values needed for a query or pipeline stage.
- **Apache Arrow integration**: Convert to columnar data for analytics pipelines.
- **Multi-language support**: Exchange Standard Row Format data across Java, Python, C++, and Rust.
- **Multi-language support**: Exchange Standard Row Format data across Java, Python, C++, Rust, and Swift.

### Optimized Fory Implementations

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/support-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ does not imply support for every Fory capability.
| --------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Xlang object serialization | Java, Python, C++, Go, Rust, JavaScript/TypeScript, C#, Swift, Dart, Scala, Kotlin | One shared xlang wire format |
| Native object serialization | Java, Python, C++, Go, Rust, Scala, Kotlin | One Fory implementation family only |
| Standard Row Format | Java, Python, C++, Rust | Shared Standard Row layout |
| Standard Row Format | Java, Python, C++, Rust, Swift | Shared Standard Row layout |
| Compact Row Format | Java | Java-only compact layout |
| Fory JSON | Java, Kotlin, Scala | Standard JSON text |
| Fory compiler output | Java, Python, C++, Go, Rust, JavaScript/TypeScript, C#, Swift, Dart, Scala, Kotlin | Generated models use supported Fory APIs |
Expand Down
2 changes: 1 addition & 1 deletion docs/row-format/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,5 @@ underlying bytes are not modified.
## Related Topics

- [Basic Serialization](../object-serialization/go/basic-serialization.md) - Object graph serialization
- [Standard Row Format](index.md#standard-row) - Shared layout for Java, Python, C++, Rust, and Go
- [Standard Row Format](index.md#standard-row) - Shared layout for Java, Python, C++, Rust, Go, and Swift
- [Row Format Specification](../specification/row_format_spec.md) - Protocol details
15 changes: 8 additions & 7 deletions docs/row-format/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ reconstruction as its primary access pattern.

## Choose a Layout

| Layout | Language support | Compatibility |
| ------------ | --------------------------- | -------------------------------- |
| Standard Row | Java, Python, C++, Rust, Go | Shared Standard Row layout |
| Compact Row | Java | Java-only, space-oriented layout |
| Layout | Language support | Compatibility |
| ------------ | ---------------------------------- | -------------------------------- |
| Standard Row | Java, Python, C++, Rust, Go, Swift | Shared Standard Row layout |
| Compact Row | Java | Java-only, space-oriented layout |

## Standard Row

Standard Row is the interoperable layout for Java, Python, C++, Rust, and Go.
Standard Row is the interoperable layout for Java, Python, C++, Rust, Go, and Swift.

### Features

- **Zero-copy random access**: Read selected fields directly from encoded data.
- **Partial deserialization**: Reconstruct only the values an application needs.
- **Cross-language compatibility**: Share Standard Row bytes between Java, Python, C++, Rust, and Go.
- **Cross-language compatibility**: Share Standard Row bytes between Java, Python, C++, Rust, Go, and Swift.
- **Apache Arrow integration**: Convert rows to Arrow data in Java and Python.

### Layout
Expand All @@ -62,6 +62,7 @@ layout, alignment rules, type table, and endianness are defined by the
| C++ | Compatible | [C++](cpp.md) | Native row readers and writers |
| Rust | Compatible | [Rust](rust.md) | Borrowed struct, array, and map views |
| Go | Compatible | [Go](go.md) | Reflection struct encoder; zero-copy row views |
| Swift | Compatible | [Swift](swift.md) | Macro-generated struct encoder; zero-copy row views |

Use the language guides for installation, schema construction, encoding, random access, partial
reads, and language-specific integrations.
Expand Down Expand Up @@ -94,7 +95,7 @@ Reuse the encoder within one thread. Create separate encoders for concurrent thr
- Fixed-size nested structs can be stored inline.

Choose Compact Row only when every reader is Java and the space reduction justifies the
Java-specific layout. Use Standard Row for Java, Python, C++, Rust, and Go interchange.
Java-specific layout. Use Standard Row for Java, Python, C++, Rust, Go, and Swift interchange.

See the [Row Format specification](../specification/row_format_spec.md) for the exact Standard and
Compact binary layouts.
Loading
Loading