Skip to content

feat(xlang): unified xlang type system#3644

Merged
chaokunyang merged 15 commits into
apache:mainfrom
chaokunyang:refine_xlang_types_mapping2
May 4, 2026
Merged

feat(xlang): unified xlang type system#3644
chaokunyang merged 15 commits into
apache:mainfrom
chaokunyang:refine_xlang_types_mapping2

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented May 3, 2026

Why?

Fory's xlang 1.0 type system needs one canonical schema model for scalar integer encodings, half-precision floating-point types, and dense numeric arrays so IDL/compiler output, runtime annotations, and cross-language peers agree on the same type IDs and wire behavior.

What does this PR do?

  • Reworks the xlang type mapping and serialization docs so varint, fixed, and tagged are scalar encoding modifiers, while list<T> and dense array<T> are distinct schema kinds.
  • Extends the FDL/FBS compiler IR, parser, validator, emitter, and language generators to support array<T>, scalar encoding metadata, and float16/bfloat16 mappings across Java, Python, Go, Rust, C++, C#, JavaScript, Dart, and Swift.
  • Updates runtimes to handle canonical primitive-array type IDs and array/list semantics, including Java primitive array serializers and annotations, Python dense-array wrappers, Go primitive slice/list support, and related C++/C#/JavaScript/Rust/Swift resolver, skip, union, and field metadata paths.
  • Expands IDL roundtrip coverage across C++, C#, Dart, Go, Java, JavaScript, Python, Rust, and Swift, with additional compiler, primitive-array, annotation, field metadata, typedef, and serializer tests.
  • Refreshes specs, guides, README content, integration fixtures, and benchmark models for the new xlang 1.0 type names and array/encoding syntax.

Related issues

#1017

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

Yes. This updates public xlang/IDL type syntax and mappings, adds array-related annotations/carriers, and changes the documented xlang wire mapping for dense numeric arrays.

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

Not included. Benchmark fixtures were updated to use the new xlang type mapping.

@chaokunyang chaokunyang merged commit 3f7a0a5 into apache:main May 4, 2026
71 checks passed
chaokunyang added a commit that referenced this pull request May 4, 2026
## Why?



## What does this PR do?



## Related issues

#3644

## AI Contribution Checklist



- [ ] Substantial AI assistance was used in this PR: `yes` / `no`
- [ ] If `yes`, I included a completed [AI Contribution
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
in this PR description and the required `AI Usage Disclosure`.
- [ ] If `yes`, my PR description includes the required `ai_review`
summary and screenshot evidence of the final clean AI review results
from both fresh reviewers on the current PR diff or current HEAD after
the latest code changes.



## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants