{"id":28441579,"url":"https://github.com/apache/fory","last_synced_at":"2026-05-21T08:03:54.287Z","repository":{"id":181137820,"uuid":"633686625","full_name":"apache/fory","owner":"apache","description":"A blazingly fast multi-language serialization framework for idiomatic domain objects, schema IDL, and cross-language data exchange.","archived":false,"fork":false,"pushed_at":"2026-05-18T05:38:52.000Z","size":41482,"stargazers_count":4333,"open_issues_count":97,"forks_count":414,"subscribers_count":46,"default_branch":"main","last_synced_at":"2026-05-18T19:50:41.992Z","etag":null,"topics":["compression","cpp","cross-language","encoding","fast","golang","hacktoberfest","java","javascript","jit","lightning","marshalling","multiple-language","persistence","python","rpc","rust","serialization","transfer","zero-copy"],"latest_commit_sha":null,"homepage":"https://fory.apache.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2023-04-28T03:57:00.000Z","updated_at":"2026-05-18T05:37:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"d10c59c6-5f8d-488d-843a-d5eb007e2176","html_url":"https://github.com/apache/fory","commit_stats":{"total_commits":1047,"total_committers":77,"mean_commits":"13.597402597402597","dds":"0.30754536771728747","last_synced_commit":"a3a22381a67451327f1b000cad780f730db951d7"},"previous_names":["alipay/fury","fury-project/fury","apache/incubator-fury","apache/fury","apache/fory"],"tags_count":105,"template":false,"template_full_name":null,"purl":"pkg:github/apache/fory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/fory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Ffory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33292256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","cpp","cross-language","encoding","fast","golang","hacktoberfest","java","javascript","jit","lightning","marshalling","multiple-language","persistence","python","rpc","rust","serialization","transfer","zero-copy"],"created_at":"2025-06-06T05:05:36.215Z","updated_at":"2026-05-21T08:03:54.280Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"65%\" alt=\"Apache Fory logo\" src=\"docs/images/logo/fory-horizontal.png\"\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/apache/fory/ci.yml?branch=main\u0026style=for-the-badge\u0026label=GITHUB%20ACTIONS\u0026logo=github)](https://github.com/apache/fory/actions/workflows/ci.yml)\n[![Slack Channel](https://img.shields.io/badge/slack-join-3f0e40?logo=slack\u0026style=for-the-badge)](https://join.slack.com/t/fory-project/shared_invite/zt-36g0qouzm-kcQSvV_dtfbtBKHRwT5gsw)\n[![X](https://img.shields.io/badge/@ApacheFory-follow-blue?logo=x\u0026style=for-the-badge)](https://x.com/ApacheFory)\n[![Maven Version](https://img.shields.io/maven-central/v/org.apache.fory/fory-core?style=for-the-badge)](https://search.maven.org/#search|gav|1|g:\"org.apache.fory\"%20AND%20a:\"fory-core\")\n[![Crates.io](https://img.shields.io/crates/v/fory.svg?style=for-the-badge)](https://crates.io/crates/fory)\n[![PyPI](https://img.shields.io/pypi/v/pyfory.svg?logo=PyPI\u0026style=for-the-badge)](https://pypi.org/project/pyfory/)\n[![npm](https://img.shields.io/npm/v/%40apache-fory%2Fcore?logo=npm\u0026style=for-the-badge)](https://www.npmjs.com/package/@apache-fory/core)\n[![NuGet](https://img.shields.io/nuget/v/Apache.Fory?logo=nuget\u0026style=for-the-badge)](https://www.nuget.org/packages/Apache.Fory)\n[![pub.dev](https://img.shields.io/pub/v/fory?logo=dart\u0026style=for-the-badge)](https://pub.dev/packages/fory)\n\n**Apache Fory™** is a blazingly fast multi-language serialization framework for\nidiomatic domain objects, schema IDL, and cross-language data exchange.\n\n\u003chttps://fory.apache.org\u003e\n\n## Why Fory\n\nFory is built for fast, compact serialization across languages and runtimes. It\nworks with idiomatic objects in each language, supports shared schemas when you\nneed a contract, and preserves object features such as shared and circular\nreferences.\n\n- **Efficient Cross-Language Encoding**: Exchange payloads across supported\n  languages with compact binary encoding, metadata packing, schema evolution,\n  shared/circular references, and polymorphic runtime types.\n- **Domain Objects First**: Serialize Java classes, Python dataclasses, Go\n  structs, Rust/C++ structs, and generated or annotated model types directly.\n  Preserve shared and circular references when object identity matters.\n- **Reference-Aware Schema IDL**: Support shared and circular references\n  directly in the schema, alongside numbers, strings, lists, maps, arrays,\n  enums, structs, and unions. Define schemas once, then generate native domain\n  objects for each language without forcing wrapper types into user code.\n- **Row-Format Random Access**: Read fields, arrays, and nested values without\n  rebuilding full objects, with zero-copy access, partial reads, and Arrow\n  integration.\n- **Optimized Runtimes**: Java JIT serializers and generated/static serializers\n  in other runtimes keep hot paths fast and payloads compact.\n- **Language And Platform Support**: Java, Python, C++, Go, Rust,\n  JavaScript/TypeScript, C#, Swift, Dart, Scala, and Kotlin, including GraalVM\n  native image, Dart VM/Flutter/web, and Node.js/browser JavaScript.\n\n## Performance\n\nBenchmarks show Fory delivering higher throughput and smaller serialized\npayloads than common serialization frameworks on representative workloads. Java\nhas the broadest comparison set; the other charts show runtime-specific results\nacross supported languages.\n\n**Java** [Benchmarks](docs/benchmarks/java)\n\nIn Java serialization benchmarks, Fory reaches up to **170x** the throughput of\nJDK serialization on selected workloads.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/java/java_repo_serialization_throughput.png\" width=\"95%\" alt=\"Java serialization throughput\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/java/java_repo_deserialization_throughput.png\" width=\"95%\" alt=\"Java deserialization throughput\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/java/throughput.png\" width=\"95%\" alt=\"Java xlang throughput\"\u003e\n\u003c/p\u003e\n\n**Python** [Benchmarks](benchmarks/python)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/python/throughput.png\" width=\"95%\" alt=\"Python serialization throughput\"\u003e\n\u003c/p\u003e\n\n**Rust** [Benchmarks](benchmarks/rust)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/rust/throughput.png\" width=\"95%\" alt=\"Rust serialization throughput\"\u003e\n\u003c/p\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBenchmarks for \u003ca href=\"benchmarks/cpp\"\u003eC++\u003c/a\u003e, \u003ca href=\"benchmarks/go\"\u003eGo\u003c/a\u003e, \u003ca href=\"docs/benchmarks/javascript\"\u003eJavaScript/TypeScript\u003c/a\u003e, \u003ca href=\"docs/benchmarks/csharp\"\u003eC#\u003c/a\u003e, \u003ca href=\"docs/benchmarks/swift\"\u003eSwift\u003c/a\u003e, and \u003ca href=\"docs/benchmarks/dart\"\u003eDart\u003c/a\u003e\u003c/strong\u003e\u003c/summary\u003e\n\n**C++** [Benchmarks](benchmarks/cpp)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/cpp/throughput.png\" width=\"95%\" alt=\"C++ serialization throughput\"\u003e\n\u003c/p\u003e\n\n**Go** [Benchmarks](benchmarks/go)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/go/throughput.png\" width=\"95%\" alt=\"Go serialization throughput\"\u003e\n\u003c/p\u003e\n\n**JavaScript/TypeScript** [Benchmarks](docs/benchmarks/javascript)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/javascript/throughput.png\" width=\"95%\" alt=\"JavaScript serialization throughput\"\u003e\n\u003c/p\u003e\n\n**C#** [Benchmarks](docs/benchmarks/csharp)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/csharp/throughput.png\" width=\"95%\" alt=\"C# serialization throughput\"\u003e\n\u003c/p\u003e\n\n**Swift** [Benchmarks](docs/benchmarks/swift)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/swift/throughput.png\" width=\"95%\" alt=\"Swift serialization throughput\"\u003e\n\u003c/p\u003e\n\n**Dart** [Benchmarks](docs/benchmarks/dart)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/benchmarks/dart/throughput.png\" width=\"95%\" alt=\"Dart serialization throughput\"\u003e\n\u003c/p\u003e\n\n\u003c/details\u003e\n\n## Installation\n\nPick the runtime you use and run the package-manager command, or paste the\ndependency block into your build file.\n\n**Java**\n\nMaven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fory\u003c/groupId\u003e\n  \u003cartifactId\u003efory-core\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle:\n\n```gradle\nimplementation \"org.apache.fory:fory-core:1.0.0\"\n```\n\n**Scala**\n\nsbt:\n\n```scala\nlibraryDependencies += \"org.apache.fory\" %% \"fory-scala\" % \"1.0.0\"\n```\n\n**Kotlin**\n\nGradle:\n\n```kotlin\nimplementation(\"org.apache.fory:fory-kotlin:1.0.0\")\n```\n\nMaven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.apache.fory\u003c/groupId\u003e\n  \u003cartifactId\u003efory-kotlin\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**Python**\n\n```bash\npip install pyfory\n```\n\nFor row-format support:\n\n```bash\npip install \"pyfory[format]\"\n```\n\n**Rust**\n\n`Cargo.toml`:\n\n```toml\n[dependencies]\nfory = \"1.0.0\"\n```\n\n**C++**\n\nCMake:\n\n```cmake\ninclude(FetchContent)\nFetchContent_Declare(\n  fory\n  GIT_REPOSITORY https://github.com/apache/fory.git\n  GIT_TAG v1.0.0\n  SOURCE_SUBDIR cpp\n)\nFetchContent_MakeAvailable(fory)\ntarget_link_libraries(my_app PRIVATE fory::serialization)\n```\n\nBazel:\n\n```bazel\n# MODULE.bazel\nbazel_dep(name = \"fory\", version = \"1.0.0\")\ngit_override(module_name = \"fory\", remote = \"https://github.com/apache/fory.git\", commit = \"v1.0.0\")\n\n# BUILD\ndeps = [\"@fory//cpp/fory/serialization:fory_serialization\"]\n```\n\nWhen building C++ with MSVC, enable the conforming preprocessor option\n`/Zc:preprocessor`; see the C++ installation guide for setup details.\n\nSee the [C++ installation guide](https://fory.apache.org/docs/guide/cpp/#installation)\nfor complete CMake, Bazel, and source-build details.\n\n**Go**\n\n```bash\ngo get github.com/apache/fory/go/fory\n```\n\n**JavaScript/TypeScript**\n\n```bash\nnpm install @apache-fory/core\n```\n\nFor the Node.js string fast path:\n\n```bash\nnpm install @apache-fory/core @apache-fory/hps\n```\n\n**C#**\n\n```bash\ndotnet add package Apache.Fory --version 1.0.0\n```\n\n**Dart**\n\n```bash\ndart pub add fory:^1.0.0\ndart pub add dev:build_runner\n```\n\n**Swift**\n\nAdd Fory to `Package.swift`:\n\n```swift\ndependencies: [\n  .package(url: \"https://github.com/apache/fory.git\", exact: \"1.0.0\")\n],\ntargets: [\n  .target(\n    name: \"YourTarget\",\n    dependencies: [.product(name: \"Fory\", package: \"fory\")]\n  )\n]\n```\n\nSee the [Swift guide](https://fory.apache.org/docs/guide/swift/) for generated\nserializer setup.\n\n**Development From Source**\n\nSee [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).\n\nSnapshots for Java, Scala, and Kotlin are available from\n`https://repository.apache.org/snapshots/` with the matching `-SNAPSHOT` version.\n\n## Choose Serialization Mode\n\n| Mode        | Use it when                                                   | Start here                                               |\n| ----------- | ------------------------------------------------------------- | -------------------------------------------------------- |\n| Xlang mode  | Data crosses language boundaries                              | [Cross-language guide](docs/guide/xlang)                 |\n| Native mode | Producer and consumer are in the same language                | Language guide for your runtime                          |\n| Row format  | You need random field access or analytics-style partial reads | [Row format spec](docs/specification/row_format_spec.md) |\n\nFor Java, Scala, Kotlin, Python, C++, Go, and Rust, use native mode for\nsame-language traffic. It avoids xlang's cross-language type mapping and\nmetadata constraints, stays closer to each runtime's native type system, and\nsupports broader language-specific object graphs. Use it when both producer and\nconsumer are in the same runtime family and you want the native object model\nrather than a portable cross-language schema.\n\nFor Java/JVM-only systems, native mode is the replacement path for JDK\nserialization, Kryo, FST, Hessian, and Java-only Protocol Buffers payloads. For\nPython-only systems, native mode is the replacement path for pickle and\ncloudpickle.\n\nCompatible mode is Fory's schema-evolution mode. It writes the metadata readers\nand writers need to tolerate schema differences. Xlang mode enables compatible\nmode by default to better handle differences between language type systems.\nNative mode keeps it off by default for smaller payloads and higher throughput.\n\nUse compatible mode when services deploy independently or when fields may be\nadded or deleted over time. Use schema-consistent mode when writer and reader\nschemas deploy together and you want the smallest payloads.\n\nFor xlang, all peers must agree on type identity. Name-based registration is\neasier to read in examples. Numeric IDs are smaller and faster, but they require\ncoordination across every reader and writer.\n\n## Cross-Language Serialization\n\nXlang mode writes the cross-language Fory wire format. Bytes produced by one\nruntime can be read by another when the runtimes use the same type identity,\ncompatible mode setting, and field schema.\n\n**Java**\n\n```java\nimport org.apache.fory.Fory;\n\npublic class Example {\n  public static class Person {\n    public String name;\n    public int age;\n  }\n\n  public static void main(String[] args) {\n    Fory fory = Fory.builder().withXlang(true).build();\n    fory.register(Person.class, \"example.Person\");\n\n    Person person = new Person();\n    person.name = \"Alice\";\n    person.age = 30;\n\n    byte[] bytes = fory.serialize(person);\n    Person decoded = (Person) fory.deserialize(bytes);\n    System.out.println(decoded.name);\n  }\n}\n```\n\n**Python**\n\n```python\nfrom dataclasses import dataclass\n\nimport pyfory\n\n@dataclass\nclass Person:\n    name: str\n    age: pyfory.Int32\n\nfory = pyfory.Fory(xlang=True)\nfory.register_type(Person, typename=\"example.Person\")\n\ndata = fory.serialize(Person(\"Alice\", 30))\nperson = fory.deserialize(data)\nprint(person.name)\n```\n\n**Go**\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/apache/fory/go/fory\"\n)\n\ntype Person struct {\n    Name string\n    Age  int32\n}\n\nfunc main() {\n    f := fory.New(fory.WithXlang(true))\n    if err := f.RegisterStructByName(Person{}, \"example.Person\"); err != nil {\n        panic(err)\n    }\n\n    data, _ := f.Serialize(\u0026Person{Name: \"Alice\", Age: 30})\n    var person Person\n    if err := f.Deserialize(data, \u0026person); err != nil {\n        panic(err)\n    }\n    fmt.Println(person.Name)\n}\n```\n\n**Rust**\n\n```rust\nuse fory::{Error, Fory, ForyStruct};\n\n#[derive(ForyStruct, Debug, PartialEq)]\nstruct Person {\n    name: String,\n    age: i32,\n}\n\nfn main() -\u003e Result\u003c(), Error\u003e {\n    let mut fory = Fory::builder().xlang(true).build();\n    fory.register_by_name::\u003cPerson\u003e(\"example\", \"Person\")?;\n\n    let bytes = fory.serialize(\u0026Person {\n        name: \"Alice\".to_string(),\n        age: 30,\n    })?;\n    let person: Person = fory.deserialize(\u0026bytes)?;\n    println!(\"{}\", person.name);\n    Ok(())\n}\n```\n\n**C++**\n\n```cpp\n#include \"fory/serialization/fory.h\"\n#include \u003ccstdint\u003e\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n\nusing namespace fory::serialization;\n\nstruct Person {\n  std::string name;\n  int32_t age;\n};\nFORY_STRUCT(Person, name, age);\n\nint main() {\n  auto fory = Fory::builder().xlang(true).build();\n  fory.register_struct\u003cPerson\u003e(\"example\", \"Person\");\n\n  auto bytes = fory.serialize(Person{\"Alice\", 30}).value();\n  Person person = fory.deserialize\u003cPerson\u003e(bytes).value();\n  std::cout \u003c\u003c person.name \u003c\u003c std::endl;\n}\n```\n\n**JavaScript/TypeScript**\n\n```ts\nimport Fory, { Type } from \"@apache-fory/core\";\n\nconst personType = Type.struct(\n  { typeName: \"example.Person\" },\n  {\n    name: Type.string(),\n    age: Type.int32(),\n  },\n);\n\nconst fory = new Fory();\nconst { serialize, deserialize } = fory.register(personType);\n\nconst bytes = serialize({ name: \"Alice\", age: 30 });\nconst person = deserialize(bytes);\nconsole.log(person.name);\n```\n\n**C#**\n\n```csharp\nusing Apache.Fory;\n\n[ForyObject]\npublic sealed class Person\n{\n    public string Name { get; set; } = string.Empty;\n    public int Age { get; set; }\n}\n\nFory fory = Fory.Builder().Build();\nfory.Register\u003cPerson\u003e(\"example\", \"Person\");\n\nbyte[] bytes = fory.Serialize(new Person { Name = \"Alice\", Age = 30 });\nPerson person = fory.Deserialize\u003cPerson\u003e(bytes);\nConsole.WriteLine(person.Name);\n```\n\nC# always writes the xlang frame header, so there is no separate xlang builder\nflag.\n\n**Dart**\n\n```dart\nimport 'package:fory/fory.dart';\n\npart 'person.fory.dart';\n\n@ForyStruct()\nclass Person {\n  Person();\n\n  String name = '';\n\n  @ForyField(type: Int32Type())\n  int age = 0;\n}\n\nvoid main() {\n  final fory = Fory();\n  PersonFory.register(\n    fory,\n    Person,\n    namespace: 'example',\n    typeName: 'Person',\n  );\n\n  final bytes = fory.serialize(Person()\n    ..name = 'Alice'\n    ..age = 30);\n  final person = fory.deserialize\u003cPerson\u003e(bytes);\n  print(person.name);\n}\n```\n\nDart uses the xlang wire format directly. Generate the companion file before\nrunning:\n\n```bash\ndart run build_runner build --delete-conflicting-outputs\n```\n\n**Swift**\n\n```swift\nimport Fory\n\n@ForyStruct\nstruct Person {\n    var name: String = \"\"\n    var age: Int32 = 0\n}\n\nlet fory = Fory()\ntry fory.register(Person.self, namespace: \"example\", name: \"Person\")\n\nlet bytes = try fory.serialize(Person(name: \"Alice\", age: 30))\nlet person: Person = try fory.deserialize(bytes)\nprint(person.name)\n```\n\n**Scala**\n\n```scala\nimport org.apache.fory.scala.ForyScala\n\ncase class Person(name: String, age: Int)\n\nval fory = ForyScala.builder().withXlang(true).build()\nfory.register(classOf[Person], \"example.Person\")\n\nval bytes = fory.serialize(Person(\"Alice\", 30))\nval person = fory.deserialize(bytes).asInstanceOf[Person]\nprintln(person.name)\n```\n\n**Kotlin**\n\n```kotlin\nimport org.apache.fory.kotlin.ForyKotlin\n\ndata class Person(val name: String, val age: Int)\n\nfun main() {\n    val fory = ForyKotlin.builder().withXlang(true).build()\n    fory.register(Person::class.java, \"example.Person\")\n\n    val bytes = fory.serialize(Person(\"Alice\", 30))\n    val person = fory.deserialize(bytes) as Person\n    println(person.name)\n}\n```\n\nFor shared/circular references, polymorphism, numeric IDs versus names, and\ntype-mapping rules, see the [cross-language guide](docs/guide/xlang) and\n[type mapping specification](docs/specification/xlang_type_mapping.md).\n\n## Native Serialization\n\nUse native mode when the writer and reader are in the same language. It is\noptimized for each runtime's native type system and can cover language-specific\ntypes, object graphs, and framework-replacement cases that xlang mode keeps out\nof the portable wire format. The languages below expose an explicit\n`xlang=false` or native-mode setting; runtimes without that switch stay on their\ndocumented default path.\n\nChoose Java native mode for Java/JVM-only replacements of JDK serialization,\nKryo, FST, Hessian, or Java-only Protocol Buffers payloads. Choose Python native\nmode when replacing pickle or cloudpickle for Python-only payloads.\n\nKeep class/type registration enabled for untrusted input. See the language guides\nfor runtime-specific security and compatibility settings.\n\n**Java**\n\n```java\nFory fory = Fory.builder()\n    .withXlang(false)\n    .requireClassRegistration(true)\n    .build();\n// Register, serialize, and deserialize as in the xlang example above.\n```\n\n**Python**\n\n```python\nfory = pyfory.Fory(xlang=False, ref=True)\n# Register, serialize, and deserialize as in the xlang example above.\n```\n\n**Go**\n\n```go\nf := fory.New(fory.WithXlang(false))\n// Register, serialize, and deserialize as in the xlang example above.\n```\n\n**Rust**\n\n```rust\nlet mut fory = Fory::builder().xlang(false).build();\n// Register, serialize, and deserialize as in the xlang example above.\n```\n\n**C++**\n\n```cpp\nauto fory = Fory::builder().xlang(false).build();\n// Register, serialize, and deserialize as in the xlang example above.\n```\n\n**Scala**\n\n```scala\nimport org.apache.fory.scala.ForyScala\n\nval fory = ForyScala.builder()\n  .withXlang(false)\n  .requireClassRegistration(true)\n  .build()\n// Register, serialize, and deserialize as in the xlang example above.\n```\n\n**Kotlin**\n\n```kotlin\nimport org.apache.fory.kotlin.ForyKotlin\n\nval fory = ForyKotlin.builder()\n    .withXlang(false)\n    .requireClassRegistration(true)\n    .build()\n// Register, serialize, and deserialize as in the xlang example above.\n```\n\n## Schema IDL\n\nFory IDL is Fory's schema language for shared data models. It supports\nreferences, nullable fields, lists, maps, arrays, enums, messages, and unions,\nand generates native data structures for supported languages. Use it when\nmultiple languages need one shared contract.\n\n```protobuf\npackage tree;\n\nmessage TreeNode {\n    string id = 1;\n    string name = 2;\n\n    list\u003cref TreeNode\u003e children = 3;\n    ref(weak=true) TreeNode parent = 4; // back-pointer\n}\n```\n\nSee the [Fory IDL and compiler guide](https://fory.apache.org/docs/compiler).\n\n## Row Format\n\nRow format is for random access and partial reads. These examples encode an\nobject with an integer array field, then read one array element from the binary\nrow without rebuilding the object.\n\n**Python**\n\n```python\nfrom dataclasses import dataclass\nfrom typing import List\n\nimport pyfory\n\n@dataclass\nclass User:\n    id: pyfory.Int32\n    name: str\n    scores: List[pyfory.Int32]\n\nencoder = pyfory.encoder(User)\nbinary = encoder.to_row(User(1, \"Alice\", [98, 100, 95])).to_bytes()\n\nrow = pyfory.RowData(encoder.schema, binary)\nprint(row.name)\nprint(row.scores[1])\n```\n\n**Java**\n\n```java\npublic class User {\n  public int id;\n  public String name;\n  public int[] scores;\n}\n\nRowEncoder\u003cUser\u003e encoder = Encoders.bean(User.class);\n\nUser user = new User();\nuser.id = 1;\nuser.name = \"Alice\";\nuser.scores = new int[] {98, 100, 95};\n\nBinaryRow row = encoder.toRow(user);\n\nSchema schema = encoder.schema();\nSchema.StringField nameField = schema.stringField(\"name\");\nSchema.ArrayField scoresField = schema.arrayField(\"scores\");\n\nString name = nameField.get(row);\nArrayData scores = scoresField.get(row);\nint secondScore = scores.getInt32(1);\n```\n\nFor Java imports, nested structs, arrays/maps, Arrow integration, and partial\ndeserialization, see the\n[Java row-format guide](https://fory.apache.org/docs/guide/java/row_format), the\n[Python row-format guide](docs/guide/python/row-format.md), and the\n[row-format specification](docs/specification/row_format_spec.md).\n\n## Documentation\n\n**User Guides**\n\n| Guide                 | Source                                                                   | Website                                                         |\n| --------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------- |\n| Java                  | [docs/guide/java](docs/guide/java)                                       | [View](https://fory.apache.org/docs/guide/java/)                |\n| Python                | [docs/guide/python](docs/guide/python)                                   | [View](https://fory.apache.org/docs/guide/python/)              |\n| Rust                  | [docs/guide/rust](docs/guide/rust)                                       | [View](https://fory.apache.org/docs/guide/rust/)                |\n| C++                   | [docs/guide/cpp](docs/guide/cpp)                                         | [View](https://fory.apache.org/docs/guide/cpp/)                 |\n| Go                    | [docs/guide/go](docs/guide/go)                                           | [View](https://fory.apache.org/docs/guide/go/)                  |\n| JavaScript/TypeScript | [docs/guide/javascript](docs/guide/javascript)                           | [View](https://fory.apache.org/docs/guide/javascript/)          |\n| C#                    | [docs/guide/csharp](docs/guide/csharp)                                   | [View](https://fory.apache.org/docs/guide/csharp/)              |\n| Swift                 | [docs/guide/swift](docs/guide/swift)                                     | [View](https://fory.apache.org/docs/guide/swift/)               |\n| Dart                  | [docs/guide/dart](docs/guide/dart)                                       | [View](https://fory.apache.org/docs/guide/dart/)                |\n| Scala                 | [docs/guide/scala](docs/guide/scala)                                     | [View](https://fory.apache.org/docs/guide/scala/)               |\n| Kotlin                | [docs/guide/kotlin](docs/guide/kotlin)                                   | [View](https://fory.apache.org/docs/guide/kotlin/)              |\n| Cross-language xlang  | [docs/guide/xlang](docs/guide/xlang)                                     | [View](https://fory.apache.org/docs/guide/xlang/)               |\n| Schema IDL/compiler   | [docs/compiler](docs/compiler)                                           | [View](https://fory.apache.org/docs/compiler/)                  |\n| GraalVM native image  | [docs/guide/java/graalvm-support.md](docs/guide/java/graalvm-support.md) | [View](https://fory.apache.org/docs/guide/java/graalvm_support) |\n| Development           | [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)                               | [View](docs/DEVELOPMENT.md)                                     |\n\n**Specifications**\n\n| Specification          | Source                                                                        | Website                                                                     |\n| ---------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------- |\n| Xlang serialization    | [xlang_serialization_spec.md](docs/specification/xlang_serialization_spec.md) | [View](https://fory.apache.org/docs/specification/xlang_serialization_spec) |\n| Java serialization     | [java_serialization_spec.md](docs/specification/java_serialization_spec.md)   | [View](https://fory.apache.org/docs/specification/java_serialization_spec)  |\n| Row format             | [row_format_spec.md](docs/specification/row_format_spec.md)                   | [View](https://fory.apache.org/docs/specification/row_format_spec)          |\n| Cross-language mapping | [xlang_type_mapping.md](docs/specification/xlang_type_mapping.md)             | [View](https://fory.apache.org/docs/specification/xlang_type_mapping)       |\n\n## Community\n\n- [Slack workspace](https://join.slack.com/t/fory-project/shared_invite/zt-36g0qouzm-kcQSvV_dtfbtBKHRwT5gsw)\n- [@ApacheFory on X](https://x.com/ApacheFory)\n- [GitHub issues](https://github.com/apache/fory/issues)\n- Apache Fory mailing lists for development discussion\n\n## Contributing\n\nRead [CONTRIBUTING.md](CONTRIBUTING.md) and\n[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) before sending pull requests. Bug\nreports, docs fixes, tests, benchmarks, and runtime improvements are welcome.\n\n## License\n\nApache Fory™ is licensed under the [Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Ffory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Ffory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Ffory/lists"}