Crates.io | pdl-compiler |
lib.rs | pdl-compiler |
version | 0.3.2 |
source | src |
created_at | 2023-05-11 17:09:33.116555 |
updated_at | 2024-11-18 21:51:18.471055 |
description | Parser and serializer generator for protocol binary packets |
homepage | |
repository | https://github.com/google/pdl/ |
max_upload_size | |
id | 862297 |
size | 1,936,395 |
PDL is a domain specific language for writing the definition of binary protocol packets. Parsing and validating packets from raw bytes is tedious and error prone in any language. PDL generates memory safe and tailored backends for multiple target languages:
- Rust
- C++
- Python
Historically PDL was developed as part of the Android Bluetooth stack (bluetooth_packetgen) as a way to generate the parser and serializer for Bluetooth packets, and reduce the number of memory safety issues that come with manipulating and validating raw data.
cargo run my-protocol.pdl --output-format rust > my-protocol.rs
Language specific instructions are provided for all supported backends: