Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Extend Protobuf/FlatBuffers Schema IDL with Shared/Circular Reference Support (apache.org)
1 point by chaokunyang 5 months ago | hide | past | favorite | 3 comments


If you already have .proto or .fbs schemas and you want shared/circular reference support, with the Fory compiler you can keep those schemas, add a small set of Fory options, then foryc generates idiomatic native models across Fory-supported languages

With fory first-class object graph serialziation support, you can serialize object graphs without manual *_id link reconstruction or rewriting your entire schema into Fory Schema.

1. GitHub: https://github.com/apache/fory

2. Compiler docs: https://fory.apache.org/docs/compiler


Flatbuffer Example:

namespace demo;

table Node {

  parent: Node (fory_weak_ref: true);

  children: [Node] (fory_ref: true);

  cached: Node (fory_ref: true, fory_thread_safe_pointer: false);

}


Protobuf Example:

syntax = "proto3";

message TreeNode {

  TreeNode parent = 1 [(fory).weak_ref = true];

  repeated TreeNode children = 2 [(fory).ref = true];

}




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: