This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git
The following commit(s) were added to refs/heads/main by this push:
new 82091a89a docs: add cpp doc in main readme.md (#3055)
82091a89a is described below
commit 82091a89a346d41fe8a576704a61a8f0e8e8eade
Author: Shawn Yang <[email protected]>
AuthorDate: Tue Dec 16 13:23:08 2025 +0800
docs: add cpp doc in main readme.md (#3055)
## Why?
## What does this PR do?
## Related issues
## Does this PR introduce any user-facing change?
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
---
README.md | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 83 insertions(+), 19 deletions(-)
diff --git a/README.md b/README.md
index e6a2550c6..82dd6771d 100644
--- a/README.md
+++ b/README.md
@@ -176,9 +176,13 @@ pip install pyfory[format]
```toml
[dependencies]
-fory = "0.13"
+fory = "0.14"
```
+**C++**:
+
+Fory C++ supports both CMake and Bazel build systems. See [C++ Installation
Guide](https://fory.apache.org/docs/docs/guide/cpp/#installation) for detailed
instructions.
+
**Golang**:
```bash
@@ -228,7 +232,7 @@ public class Example {
}
```
-For detailed Java usage including compatibility modes, compression, and
advanced features, see [Java Serialization
Guide](docs/guide/java_serialization_guide.md) and
[java/README.md](java/README.md).
+For detailed Java usage including compatibility modes, compression, and
advanced features, see [Java Serialization Guide](docs/guide/java) and
[java/README.md](java/README.md).
#### Python Serialization
@@ -253,7 +257,67 @@ result = fory.deserialize(data)
print(result.name, result.age) # Output: chaokunyang 28
```
-For detailed Python usage including type hints, compatibility modes, and
advanced features, see [Python Guide](docs/guide/python_guide.md).
+For detailed Python usage including type hints, compatibility modes, and
advanced features, see [Python Guide](docs/guide/python).
+
+#### Rust Serialization
+
+Rust native mode provides compile-time code generation via derive macros for
high-performance serialization without runtime overhead.
+
+```rust
+use fory::{Fory, ForyObject};
+
+#[derive(ForyObject, Debug, PartialEq)]
+struct Person {
+ name: String,
+ age: i32,
+}
+
+fn main() -> Result<(), fory::Error> {
+ // Create Fory instance - should be reused across serializations
+ let mut fory = Fory::default();
+ // Register your structs (required when class registration is enabled)
+ fory.register::<Person>(1);
+ let person = Person {
+ name: "chaokunyang".to_string(),
+ age: 28,
+ };
+ let bytes = fory.serialize(&person);
+ let result: Person = fory.deserialize(&bytes)?;
+ println!("{} {}", result.name, result.age); // Output: chaokunyang 28
+ Ok(())
+}
+```
+
+For detailed Rust usage including collections, references, and custom
serializers, see [Rust Guide](docs/guide/rust).
+
+#### C++ Serialization
+
+C++ native mode provides compile-time reflection via the `FORY_STRUCT` macro
for efficient serialization with zero runtime overhead.
+
+```cpp
+#include "fory/serialization/fory.h"
+
+using namespace fory::serialization;
+
+struct Person {
+ std::string name;
+ int32_t age;
+};
+FORY_STRUCT(Person, name, age);
+
+int main() {
+ // Create Fory instance - should be reused across serializations
+ auto fory = Fory::builder().build();
+ // Register your structs (required when class registration is enabled)
+ fory.register_struct<Person>(1);
+ Person person{"chaokunyang", 28};
+ auto bytes = fory.serialize(person).value();
+ auto result = fory.deserialize<Person>(bytes).value();
+ std::cout << result.name << " " << result.age << std::endl; // Output:
chaokunyang 28
+}
+```
+
+For detailed C++ usage including collections, smart pointers, and error
handling, see [C++ Guide](docs/guide/cpp).
#### Scala Serialization
@@ -284,7 +348,7 @@ object Example {
}
```
-For detailed Scala usage including collection serialization and integration
patterns, see [Scala Guide](docs/guide/scala_guide.md).
+For detailed Scala usage including collection serialization and integration
patterns, see [Scala Guide](docs/guide/scala).
#### Kotlin Serialization
@@ -385,9 +449,9 @@ fn main() -> Result<(), Error> {
For examples with **circular references**, **shared references**, and
**polymorphism** across languages, see:
-- [Cross-Language Serialization Guide](docs/guide/xlang_serialization_guide.md)
-- [Java Serialization Guide - Cross
Language](docs/guide/java_serialization_guide.md#cross-language-serialization)
-- [Python Guide - Cross
Language](docs/guide/python_guide.md#cross-language-serialization)
+- [Cross-Language Serialization Guide](docs/guide/xlang)
+- [Java Serialization Guide - Cross Language](docs/guide/java)
+- [Python Guide - Cross Language](docs/guide/python)
### Row Format Encoding
@@ -483,22 +547,22 @@ print(foo_row.f4[100000].f1) # Access nested field
print(foo_row.f4[200000].f2[5]) # Access deeply nested field
```
-For more details on row format, see [Row Format
Guide](docs/guide/row_format_guide.md).
+For more details on row format, see [Row Format
Specification](docs/specification/row_format_spec.md).
## Documentation
### User Guides
-| Guide | Description
| Source |
Website
|
-| -------------------------------- |
------------------------------------------ |
----------------------------------------------------------------------- |
-----------------------------------------------------------------------------------
|
-| **Java Serialization** | Comprehensive guide for Java
serialization |
[java_serialization_guide.md](docs/guide/java_serialization_guide.md) | [π
View](https://fory.apache.org/docs/docs/guide/java_serialization)
|
-| **Cross-Language Serialization** | Multi-language object exchange
| [xlang_serialization_guide.md](docs/guide/xlang_serialization_guide.md) | [π
View](https://fory.apache.org/docs/specification/fory_xlang_serialization_spec)
|
-| **Row Format** | Zero-copy random access format
| [row_format_guide.md](docs/guide/row_format_guide.md) | [π
View](https://fory.apache.org/docs/specification/fory_row_format_spec)
|
-| **Python** | Python-specific features and usage
| [python_guide.md](docs/guide/python_guide.md) | [π
View](https://fory.apache.org/docs/docs/guide/python_serialization)
|
-| **Rust** | Rust implementation and patterns
| [rust_guide.md](docs/guide/rust_guide.md) | [π
View](https://fory.apache.org/docs/docs/guide/rust_serialization)
|
-| **Scala** | Scala integration and best practices
| [scala_guide.md](docs/guide/scala_guide.md) | [π
View](https://fory.apache.org/docs/docs/guide/scala_serialization)
|
-| **GraalVM** | Native image support and AOT compilation
| [graalvm_guide.md](docs/guide/graalvm_guide.md) | [π
View](https://fory.apache.org/docs/docs/guide/graalvm_serialization)
|
-| **Development** | Building and contributing to Fory
| [DEVELOPMENT.md](docs/guide/DEVELOPMENT.md) | [π
View](https://fory.apache.org/docs/docs/guide/development)
|
+| Guide | Description
| Source | Website
|
+| -------------------------------- |
------------------------------------------ |
----------------------------------------------- |
-------------------------------------------------------------- |
+| **Java Serialization** | Comprehensive guide for Java
serialization | [java](docs/guide/java) | [π
View](https://fory.apache.org/docs/docs/guide/java/) |
+| **Python** | Python-specific features and usage
| [python](docs/guide/python) | [π
View](https://fory.apache.org/docs/docs/guide/python/) |
+| **Rust** | Rust implementation and patterns
| [rust](docs/guide/rust) | [π
View](https://fory.apache.org/docs/docs/guide/rust/) |
+| **C++** | C++ implementation and patterns
| [cpp](docs/guide/cpp) | [π
View](https://fory.apache.org/docs/docs/guide/cpp/) |
+| **Scala** | Scala integration and best practices
| [scala](docs/guide/scala) | [π
View](https://fory.apache.org/docs/docs/guide/scala/) |
+| **Cross-Language Serialization** | Multi-language object exchange
| [xlang](docs/guide/xlang) | [π
View](https://fory.apache.org/docs/docs/guide/xlang/) |
+| **GraalVM** | Native image support and AOT compilation
| [graalvm_guide.md](docs/guide/graalvm_guide.md) | [π
View](https://fory.apache.org/docs/docs/guide/graalvm/) |
+| **Development** | Building and contributing to Fory
| [DEVELOPMENT.md](docs/guide/DEVELOPMENT.md) | [π
View](https://fory.apache.org/docs/docs/guide/development) |
### Protocol Specifications
@@ -527,7 +591,7 @@ Apache Foryβ’ supports class schema forward/backward
compatibility across **Jav
- Version your serialized data by Fory major version
- Plan migration strategies when upgrading major versions
-- See [upgrade guide](docs/guide/java_serialization_guide.md#upgrade-fory) for
details
+- See [upgrade guide](docs/guide/java) for details
**Future**: Binary compatibility will be guaranteed starting from Fory 1.0
release.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]