Binary Format Definition Language

2022-09-30

Meta-language to generate binary format parsers and serializers

software (29) zig (14) programming-language (7) formats (3)

Table of Contents
  1. Prior Art
  2. Yet another solution in the problem space
  3. Project Status
  4. Links
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.

Select anchorPrior Art

Select anchorYet 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.

Select anchorProject 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.

Select anchorLinks