Mangle by Google: A Datalog-Based Language to Tame Fragmented Data

Mangle is a new open-source programming language from Google that extends the logic-based Datalog for modern deductive database programming. Implemented as a Go library, Mangle is aimed at simplifying queries and reasoning over data that lives across many different sources and formats.

Tackling data fragmentation

Modern engineering and security workflows suffer from data fragmentation. Information about dependencies, vulnerabilities, configurations, and infrastructure is scattered across files, APIs, registries, and other stores. Mangle addresses this by letting developers treat these disparate sources as a single logical dataset. Instead of stitching data together imperatively, teams can declare facts and rules and use deductive queries to reason across the whole picture.

Extensions to Datalog for real-world use

Mangle builds on classic Datalog while adding practical features needed in real projects:

These extensions keep the declarative clarity of Datalog while making it applicable to complex, practical analysis tasks.

Practical applications

Mangle is particularly well suited for security, supply chain, and knowledge-graph problems:

Implementation and developer accessibility

Implementing Mangle as a Go library lets it be embedded into existing applications and analysis tools without the overhead of a separate database system. This design puts deductive querying capabilities directly in developers hands and aligns with common engineering stacks. The project documentation focuses on practicality, helping developers who are more familiar with imperative or object-oriented paradigms adopt logic-based reasoning.

Where to start

The project repository contains documentation, tutorials, and examples to help teams get started. Mangle offers a pragmatic path to consolidate fragmented data and perform sophisticated reasoning for security analysis, infrastructure management, and more.