Introduction
An overview of Polyglot's purpose, goals, and key features
What is Polyglot?
Polyglot is a high-performance binary serialization framework designed for encoding and decoding arbitrary data structures across multiple programming languages. It currently supports Go, Rust, TypeScript, and C, making it an ideal choice for systems that need to exchange data efficiently between components written in different languages.
Core Goals
- Maximum Performance: Polyglot prioritizes performance above all else, utilizing zero-copy operations and minimal memory allocations wherever possible
- Cross-Language Compatibility: Seamless data exchange between Go, Rust, TypeScript, and C implementations
- Minimal Overhead: The binary format adds minimal overhead to the raw data being transmitted
- Memory Efficiency: Optimized memory usage through buffer reuse and careful allocation strategies
Key Features
- Simple, fixed binary format that requires no schema negotiation
- Support for fundamental data types across languages
- Zero-copy operations for optimal performance
- Buffer pooling capabilities for memory reuse
- Explicit memory management in C for complete control
- Collections support through arrays and maps
- Error handling built into the type system
When to Use Polyglot
Polyglot is ideal for:
- High-performance microservices needing to exchange data
- Systems with components written in different languages
- Applications requiring efficient binary serialization
- Scenarios where memory usage and allocation patterns are critical
- Cases where schema evolution is not a primary concern
Polyglot may not be the best choice when:
- Schema evolution and backward compatibility are required
- The data format needs to be human-readable
- Dynamic typing or runtime type discovery is needed
By focusing on performance and simplicity over features like schema evolution, Polyglot provides a streamlined solution for cross-language data serialization in performance-critical applications.
Edit on GitHub
Last updated on