Mangle – a language for deductive database programming

https://news.ycombinator.com/rss Hits: 11
Summary

Mangle Mangle is a programming language for deductive database programming. It is an extension of Datalog, with various extensions like aggregation, function calls and optional type-checking. Deductive database programming is useful for bringing data from multiple data sources together since it enables us to represent and query that data in a uniform way. It can also be used to model domain knowledge, similar to machine-readable ontology but without being restricted to binary predicates. Datalog is an expressive declarative language similar to relational calculus (think SQL and relational views). Unlike relational calculus, it also supports recursive rules and program structuring in a straightforward way. Mangle contains Datalog as a fragment and adds extensions that make its use more practical. Some of the good properties like guaranteed termination are lost when such extensions are used. The goal of Mangle as an open source project is to convey the concepts in a way that is accessible to developers and lends itself to easy experimentation. This repository contains an implementation of Mangle as a go library that can be easily embedded into applications. Check out the docs and the GitHub discussions for more information. There is also a Q&A section. For an example how to use Mangle library in a database-like grpc service, see the separate Mangle demo service repo. This is not an officially supported Google product. Table of Contents Examples Simple Queries Imagine you were asked to spot software affected by the log4j vulnerability discovered in late 2021. We want to look for projects that contain a Java archive (jar file) of log4j that is not updated to the patched version. projects_with_vulnerable_log4j ( P ) :- projects( P ), contains_jar( P , "log4j" , Version ), Version ! = "2.17.1" , Version ! = "2.12.4" , Version ! = "2.3.2" . This is a Mangle rule: conceptually, the implementation retrieve all possible values for variables P and Version that make all the sub...

First seen: 2025-08-18 03:39

Last seen: 2025-08-18 13:41