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
def RGB = {
red = UInt8; green = UInt8; blue = UInt8; -- named results: a structure
}
def PPM = {
Match "P";
version = UInt8;
version == 3 is true; -- a guard reads that value
width = UInt8;
height = UInt8;
pixels = Many height (Many width RGB); -- a field drives the count
}
def $digit = '0' .. '9' -- a character class
def Digit = $[ $digit ] - '0' -- consumed for its semantic value
def Token P =
block -- a parameterized parser
$$ = P -- the result comes from P
Many (1..) $[ ' ' ] -- then trailing whitespace
def addDigit val d = 10 * val + (d as uint 64) -- a value-level function
bitdata ChooseOption where -- bits, not bytes: a tagged union
opt1 = 0x0 : uint 4
opt2 = 0x1
bitdata OptionData where
OptionData = { opt : ChooseOption, val : uint 4 }
def Options = block
let odat = UInt8 as? OptionData -- checked coercion, may backtrack
case odat of
OptionData x ->
case x.opt of
opt1 -> ^ x.val
_ -> Fail "Wrong option"
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 Nandsint Ncarry their bit count;asis 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
?awhen 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
- Official sitegaloisinc.github.io
- DaeDaLus repository (GaloisInc/daedalus)github.com
- Daedalus: Safer Document Parsing (PLDI 2024)dl.acm.org
- Galois — DaeDaLus project pagegalois.com
- Building DaeDaLus and ICARUS (Bill Harris, August 2020)galois.com
- Specifications Don't Exist (Mike Dodds, June 2025)galois.com