Hacker News new | ask | show | jobs
by kenhwang 238 days ago
Looks like there's a type mapping chart for supported types: https://fory.apache.org/docs/docs/guide/xlang_type_mapping

Otherwise, the schema seems to be derived from the class being serialized for typed languages, or otherwise annotated in code. The serializer and deserializer code must be manually written to be compatible instead of both sides being codegen'd to match from a schema file. He's the example I found for python: https://fory.apache.org/docs/docs/guide/python_serialization...

1 comments

You don’t need to hand‑write serializer code. In typed languages you just define your class or struct as usual; in dynamic languages you can use type hints.

When running in compatible mode, Fory automatically derives a compact schema from those definitions at runtime time and sends it along to peers for the first time serialization. That way, both sides know the structure without needing a separate schema file.

The idea is to make cross‑language exchange work out‑of‑the‑box, while still allowing teams to add an explicit IDL later if they want a single source of truth.

He's saying you need to hand-write the class or struct. You don't need to do that in systems with an explicit schema like Protobuf.
Exactly, i'm using protobuf, i've got those proto files which generate code in python, ruby, go and typescript. I can share the package into those different services and i'm gonna be sure i'll use common interface.

It's not clear for me how to achieve the same with fory?