All languages

DaeDaLus language

Galois's declarative parser specification language: a format description is a typed program whose later parses are steered by values already parsed, and it generates a C++ parser from that description.

Overview

DaeDaLus is Galois's domain-specific language for writing parsers as declarative format specifications, with data-dependent parsing: values produced early in a parse steer what is parsed later. It exists because real formats lack consensus specifications, so a precise description that generates the parser is the practical alternative.

Code

def GetByte    = UInt8          -- one arbitrary byte: a uint 8
def TheLetterA = $[ 'A' ]       -- one byte drawn from a byte set
def Magic      = Match "HELLO"  -- a byte sequence: result is [uint 8]
def Add =
  block                         -- values flow from parser to parser
    let x = UInt8
    $[ '+' ]
    let y = UInt8
    ^ x + y                     -- operators consume semantic values
Bytes and arithmetic; a format whose fields drive their own repetition count and whose version guard steers parsing; character classes, parameterized parsers and value functions as the definable units; then the flagship idiom — bitdata splits a byte into a tagged union and as? checks it mid-parse, backtracking on junk. Choice (First / Choose) is the mechanism no tab can show: it is what makes ambiguity explicit.

Distinctive traits

  • Data-dependent parsing: values parsed earlier choose what is parsed next, so a size field drives the loop that reads the payload.
  • Unbiased choice (P | Q) makes ambiguity explicit: both branches may succeed, and only composing with later parsers resolves the reading.
  • A description compiles to a C++ parser that deploys where the format is read; Galois describes the language and toolchain as memory-safe.
  • Widths live in the types: uint N and sint N carry their bit count; as is lossless and checked statically, as! may lose information, as? checks at run time and backtracks on failure.
  • Naming conventions split three declaration species — uppercase parsers, lowercase semantic values, $ character classes — with implicit lifting between the three contexts.
  • Declarations need no type annotations: the checker infers types from naming convention and use, and names an unknown type ?a when it cannot infer it.

Status

Version 1.0 shipped February 2026 under BSD-3-Clause. Built by Galois for DARPA's SafeDocs program; the interpreter is Haskell, and daedalus compile-c++ emits parsers in C++. A language server ships for VS Code.

History

DaeDaLus grew out of DARPA's SafeDocs program (contract HR0011-19-C-0073) and was open-sourced in August 2020. Its motivating case was PDF: Galois transcribed PDF's object syntax into it, and the PLDI 2024 paper reports the resulting safer-parsing work. In 2025 Mike Dodds wrote that the project's formal PDF specification ended up non-descriptive and non-normative — the format itself, he argues, has no coherent specification to match.

Sources & references