Mapping to Java
The GlueGun IDL is mapped to Java as follows:
- Primitive types:
i8,u8to Javabytei16,u16to Javashorti32,u32to Javaintu64,u64to Javalongf32to Javafloatf64to Javadoublecharto Javaint(a Javacharis not a 32-bit unicode code point, and new Java functions operating on Unicode characters useint)
- Collection types map to Java collections:
- A Rust
Vec<T>to a JavaArrayList<T> - ...
- A Rust
- Tuples and public structs map to Java classes with public fields
- Enums with associated data map to an abstract Java base class and public-struct-like subclasses for each variant
- Enums map without associated data map to Java enums
- Instances of the class pattern map to Java classes with methods