Binary Format Definition Language
2022-09-30
Meta-language to generate binary format parsers and serializers
Table of Contents
endian little;
root PascalString;
struct PascalString {
length: u16,
contents: [length]u8,
zero_terminator: u8 = 0,
};
The BFDL is a language that allows describing binary formats in a declarative manner, mixed with imperative control flow. The primary design is meant for people implementing cross-language or cross-architecture communication protocols or serialization formats.
Prior Art
Yet another solution in the problem space
At the point of creating BFDL I already had another tool called livedecode which solves a similar problem space and was really convenient to use. I also used the BFDL syntax already to document data structures I used and defined.
So at that point I decided it might be useful for the world to create something that solves that problem for everyone, not only me and make it a formal specification that can be implemented and extended by others.
Project Status
Right now, the project is in a state where a good amount of semantic analysis is implemented, but no parser generator yet is done.