Show HN: First IDL for Object-Graph Serialization (Apache Fory IDL)(fory.apache.org)
fory.apache.org
Show HN: First IDL for Object-Graph Serialization (Apache Fory IDL)
https://fory.apache.org/blog/fory_schema_idl_for_object_graph/
2 comments
Tiny Schema demo
message Customer { string id = 1; string name = 2; }
message Order {
message Customer { string id = 1; string name = 2; }
message Order {
string order_id = 1;
ref Customer customer = 2;
list<string> items = 3;
}
1. `ref` encodes shared identity/loops in the schema (weak refs supported) — no manual ID stitching
2. `union`/`any` give reusable polymorphism; same semantics across Java/Python/Go/Rust/C++/C#/Swift
3. Generated types are real domain models (POJOs, dataclasses, structs, enums), not transport wrappers
4. Compatible evolution: field-id matching, defaults, unknown-field skip
5. One `.fdl` → compatible bytes across all supported languages
Try it in 60 seconds:
```bash pip install fory-compiler foryc ecommerce.fdl \
```
Shared-identity round-trip (Java):
```java
OrderBatch restored = OrderBatch.fromBytes(new OrderBatch(first, second).toBytes());
assert restored.getOrders().get(0).getCustomer() == restored.getOrders().get(1).getCustomer();
```
Feedback welcome: where do object graphs bite you today? Try `foryc --emit-fdl` on a `.proto` / `.fbs` and tell me what feels off.