This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git


The following commit(s) were added to refs/heads/main by this push:
     new b8fd17824 🔄 synced local 'docs/specification/' with remote 
'docs/specification/'
b8fd17824 is described below

commit b8fd1782483e80c65fb30c897befc6abfb5d8076
Author: chaokunyang <[email protected]>
AuthorDate: Tue Dec 9 13:35:36 2025 +0000

    🔄 synced local 'docs/specification/' with remote 'docs/specification/'
---
 docs/specification/xlang_serialization_spec.md |  8 ++-
 docs/specification/xlang_type_mapping.md       | 80 +++++++++++++-------------
 2 files changed, 46 insertions(+), 42 deletions(-)

diff --git a/docs/specification/xlang_serialization_spec.md 
b/docs/specification/xlang_serialization_spec.md
index 3f25b7197..0715c9c4f 100644
--- a/docs/specification/xlang_serialization_spec.md
+++ b/docs/specification/xlang_serialization_spec.md
@@ -60,7 +60,7 @@ This specification defines the Fory xlang binary format. The 
format is dynamic r
 - named_ext: an `ext` type whose type mapping will be encoded as a name.
 - list: a sequence of objects.
 - set: an unordered set of unique elements.
-- map: a map of key-value pairs. Mutable types such as 
`list/map/set/array/tensor` are not allowed as key of map.
+- map: a map of key-value pairs. Mutable types such as `list/map/set/array` 
are not allowed as key of map.
 - duration: an absolute length of time, independent of any calendar/timezone, 
as a count of nanoseconds.
 - timestamp: a point in time, independent of any calendar/timezone, as a count 
of nanoseconds. The count is relative
   to an epoch at UTC midnight on January 1, 1970.
@@ -77,7 +77,8 @@ This specification defines the Fory xlang binary format. The 
format is dynamic r
   - float16_array: one dimensional half_float_16 array.
   - float32_array: one dimensional float32 array.
   - float64_array: one dimensional float64 array.
-- tensor: multidimensional array which every sub-array have same size and type.
+- union: a tagged union type that can hold one of several alternative types. 
The active alternative is identified by an index.
+- none: represents an empty/unit value with no data (e.g., for empty union 
alternatives).
 
 Note:
 
@@ -186,7 +187,8 @@ custom types (struct/ext/enum). User type IDs are in a 
separate namespace and co
 | 35      | FLOAT16_ARRAY           | 1D float16 array                         
           |
 | 36      | FLOAT32_ARRAY           | 1D float32 array                         
           |
 | 37      | FLOAT64_ARRAY           | 1D float64 array                         
           |
-| 38      | TENSOR                  | Multi-dimensional array                  
           |
+| 38      | UNION                   | Tagged union type (one of several 
alternatives)     |
+| 39      | NONE                    | Empty/unit type (no data)                
           |
 
 #### Type ID Encoding for User Types
 
diff --git a/docs/specification/xlang_type_mapping.md 
b/docs/specification/xlang_type_mapping.md
index a3b8a70ab..1661d0b77 100644
--- a/docs/specification/xlang_type_mapping.md
+++ b/docs/specification/xlang_type_mapping.md
@@ -27,45 +27,47 @@ Note:
 
 ## Type Mapping
 
-| Fory Type               | Fory Type ID | Java            | Python            
                | Javascript      | C++                            | Golang     
      | Rust             |
-| ----------------------- | ------------ | --------------- | 
--------------------------------- | --------------- | 
------------------------------ | ---------------- | ---------------- |
-| bool                    | 1            | bool/Boolean    | bool              
                | Boolean         | bool                           | bool       
      | bool             |
-| int8                    | 2            | byte/Byte       | int/pyfory.Int8   
                | Type.int8()     | int8_t                         | int8       
      | i8               |
-| int16                   | 3            | short/Short     | int/pyfory.Int16  
                | Type.int16()    | int16_t                        | int16      
      | i6               |
-| int32                   | 4            | int/Integer     | int/pyfory.Int32  
                | Type.int32()    | int32_t                        | int32      
      | i32              |
-| var_int32               | 5            | int/Integer     | 
int/pyfory.VarInt32               | Type.varint32() | fory::varint32_t          
     | fory.varint32    | fory::varint32   |
-| int64                   | 6            | long/Long       | int/pyfory.Int64  
                | Type.int64()    | int64_t                        | int64      
      | i64              |
-| var_int64               | 7            | long/Long       | 
int/pyfory.VarInt64               | Type.varint64() | fory::varint64_t          
     | fory.varint64    | fory::varint64   |
-| sli_int64               | 8            | long/Long       | 
int/pyfory.SliInt64               | Type.sliint64() | fory::sliint64_t          
     | fory.sliint64    | fory::sliint64   |
-| float16                 | 9            | float/Float     | 
float/pyfory.Float16              | Type.float16()  | fory::float16_t           
     | fory.float16     | fory::f16        |
-| float32                 | 10           | float/Float     | 
float/pyfory.Float32              | Type.float32()  | float                     
     | float32          | f32              |
-| float64                 | 11           | double/Double   | 
float/pyfory.Float64              | Type.float64()  | double                    
     | float64          | f64              |
-| string                  | 12           | String          | str               
                | String          | string                         | string     
      | String/str       |
-| enum                    | 13           | Enum subclasses | enum subclasses   
                | /               | enum                           | /          
      | enum             |
-| named_enum              | 14           | Enum subclasses | enum subclasses   
                | /               | enum                           | /          
      | enum             |
-| struct                  | 15           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct           |
-| compatible_struct       | 16           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct           |
-| named_struct            | 17           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct           |
-| named_compatible_struct | 18           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct           |
-| ext                     | 19           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct           |
-| named_ext               | 20           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct           |
-| list                    | 21           | List/Collection | list/tuple        
                | array           | vector                         | slice      
      | Vec              |
-| set                     | 22           | Set             | set               
                | /               | set                            | fory.Set   
      | Set              |
-| map                     | 23           | Map             | dict              
                | Map             | unordered_map                  | map        
      | HashMap          |
-| duration                | 24           | Duration        | timedelta         
                | Number          | duration                       | Duration   
      | Duration         |
-| timestamp               | 25           | Instant         | datetime          
                | Number          | std::chrono::nanoseconds       | Time       
      | DateTime         |
-| local_date              | 26           | Date            | datetime          
                | Number          | std::chrono::nanoseconds       | Time       
      | DateTime         |
-| decimal                 | 27           | BigDecimal      | Decimal           
                | bigint          | /                              | /          
      | /                |
-| binary                  | 28           | byte[]          | bytes             
                | /               | `uint8_t[n]/vector<T>`         | 
`[n]uint8/[]T`   | `Vec<uint8_t>`   |
-| array                   | 29           | array           | np.ndarray        
                | /               | /                              | 
array/slice      | Vec              |
-| bool_array              | 30           | bool[]          | 
ndarray(np.bool\_)                | /               | `bool[n]`                 
     | `[n]bool/[]T`    | `Vec<bool>`      |
-| int8_array              | 31           | byte[]          | ndarray(int8)     
                | /               | `int8_t[n]/vector<T>`          | 
`[n]int8/[]T`    | `Vec<i18>`       |
-| int16_array             | 32           | short[]         | ndarray(int16)    
                | /               | `int16_t[n]/vector<T>`         | 
`[n]int16/[]T`   | `Vec<i16>`       |
-| int32_array             | 33           | int[]           | ndarray(int32)    
                | /               | `int32_t[n]/vector<T>`         | 
`[n]int32/[]T`   | `Vec<i32>`       |
-| int64_array             | 34           | long[]          | ndarray(int64)    
                | /               | `int64_t[n]/vector<T>`         | 
`[n]int64/[]T`   | `Vec<i64>`       |
-| float16_array           | 35           | float[]         | ndarray(float16)  
                | /               | `fory::float16_t[n]/vector<T>` | 
`[n]float16/[]T` | `Vec<fory::f16>` |
-| float32_array           | 36           | float[]         | ndarray(float32)  
                | /               | `float[n]/vector<T>`           | 
`[n]float32/[]T` | `Vec<f32>`       |
-| float64_array           | 37           | double[]        | ndarray(float64)  
                | /               | `double[n]/vector<T>`          | 
`[n]float64/[]T` | `Vec<f64>`       |
+| Fory Type               | Fory Type ID | Java            | Python            
                | Javascript      | C++                            | Golang     
      | Rust              |
+| ----------------------- | ------------ | --------------- | 
--------------------------------- | --------------- | 
------------------------------ | ---------------- | ----------------- |
+| bool                    | 1            | bool/Boolean    | bool              
                | Boolean         | bool                           | bool       
      | bool              |
+| int8                    | 2            | byte/Byte       | int/pyfory.Int8   
                | Type.int8()     | int8_t                         | int8       
      | i8                |
+| int16                   | 3            | short/Short     | int/pyfory.Int16  
                | Type.int16()    | int16_t                        | int16      
      | i6                |
+| int32                   | 4            | int/Integer     | int/pyfory.Int32  
                | Type.int32()    | int32_t                        | int32      
      | i32               |
+| var_int32               | 5            | int/Integer     | 
int/pyfory.VarInt32               | Type.varint32() | fory::varint32_t          
     | fory.varint32    | fory::varint32    |
+| int64                   | 6            | long/Long       | int/pyfory.Int64  
                | Type.int64()    | int64_t                        | int64      
      | i64               |
+| var_int64               | 7            | long/Long       | 
int/pyfory.VarInt64               | Type.varint64() | fory::varint64_t          
     | fory.varint64    | fory::varint64    |
+| sli_int64               | 8            | long/Long       | 
int/pyfory.SliInt64               | Type.sliint64() | fory::sliint64_t          
     | fory.sliint64    | fory::sliint64    |
+| float16                 | 9            | float/Float     | 
float/pyfory.Float16              | Type.float16()  | fory::float16_t           
     | fory.float16     | fory::f16         |
+| float32                 | 10           | float/Float     | 
float/pyfory.Float32              | Type.float32()  | float                     
     | float32          | f32               |
+| float64                 | 11           | double/Double   | 
float/pyfory.Float64              | Type.float64()  | double                    
     | float64          | f64               |
+| string                  | 12           | String          | str               
                | String          | string                         | string     
      | String/str        |
+| enum                    | 13           | Enum subclasses | enum subclasses   
                | /               | enum                           | /          
      | enum              |
+| named_enum              | 14           | Enum subclasses | enum subclasses   
                | /               | enum                           | /          
      | enum              |
+| struct                  | 15           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct            |
+| compatible_struct       | 16           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct            |
+| named_struct            | 17           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct            |
+| named_compatible_struct | 18           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct            |
+| ext                     | 19           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct            |
+| named_ext               | 20           | pojo/record     | data class / type 
with type hints | object          | struct/class                   | struct     
      | struct            |
+| list                    | 21           | List/Collection | list/tuple        
                | array           | vector                         | slice      
      | Vec               |
+| set                     | 22           | Set             | set               
                | /               | set                            | fory.Set   
      | Set               |
+| map                     | 23           | Map             | dict              
                | Map             | unordered_map                  | map        
      | HashMap           |
+| duration                | 24           | Duration        | timedelta         
                | Number          | duration                       | Duration   
      | Duration          |
+| timestamp               | 25           | Instant         | datetime          
                | Number          | std::chrono::nanoseconds       | Time       
      | DateTime          |
+| local_date              | 26           | Date            | datetime          
                | Number          | std::chrono::nanoseconds       | Time       
      | DateTime          |
+| decimal                 | 27           | BigDecimal      | Decimal           
                | bigint          | /                              | /          
      | /                 |
+| binary                  | 28           | byte[]          | bytes             
                | /               | `uint8_t[n]/vector<T>`         | 
`[n]uint8/[]T`   | `Vec<uint8_t>`    |
+| array                   | 29           | array           | np.ndarray        
                | /               | /                              | 
array/slice      | Vec               |
+| bool_array              | 30           | bool[]          | 
ndarray(np.bool\_)                | /               | `bool[n]`                 
     | `[n]bool/[]T`    | `Vec<bool>`       |
+| int8_array              | 31           | byte[]          | ndarray(int8)     
                | /               | `int8_t[n]/vector<T>`          | 
`[n]int8/[]T`    | `Vec<i18>`        |
+| int16_array             | 32           | short[]         | ndarray(int16)    
                | /               | `int16_t[n]/vector<T>`         | 
`[n]int16/[]T`   | `Vec<i16>`        |
+| int32_array             | 33           | int[]           | ndarray(int32)    
                | /               | `int32_t[n]/vector<T>`         | 
`[n]int32/[]T`   | `Vec<i32>`        |
+| int64_array             | 34           | long[]          | ndarray(int64)    
                | /               | `int64_t[n]/vector<T>`         | 
`[n]int64/[]T`   | `Vec<i64>`        |
+| float16_array           | 35           | float[]         | ndarray(float16)  
                | /               | `fory::float16_t[n]/vector<T>` | 
`[n]float16/[]T` | `Vec<fory::f16>`  |
+| float32_array           | 36           | float[]         | ndarray(float32)  
                | /               | `float[n]/vector<T>`           | 
`[n]float32/[]T` | `Vec<f32>`        |
+| float64_array           | 37           | double[]        | ndarray(float64)  
                | /               | `double[n]/vector<T>`          | 
`[n]float64/[]T` | `Vec<f64>`        |
+| union                   | 38           | /               | /                 
                | /               | `std::variant<Ts...>`          | /          
      | tagged union enum |
+| none                    | 39           | null            | None              
                | null            | `std::monostate`               | nil        
      | `()`              |
 
 ## Type info(not implemented currently)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to