UnifyWeaver
A Prolog transpiler that turns logic programs into LINQ-style data pipelines.
One codebase → Bash streams, C# queries, Go binaries, SQL views, and more.
Quick Links
📦 Project Documentation (code)
📚 Educational Materials (13-Book Series)
Core Sequence
Portable Targets
Integration & Advanced
View All Books →
Key Features
- ✅ 9 Target Languages - Bash, C#, Go, Rust, Python, SQL, AWK, Prolog, PowerShell
- ✅ Multiple Compilation Approaches - Stream-based, fixed-point, generator, declarative
- ✅ Advanced Recursion - Linear, tail, tree, mutual recursion with automatic optimization
- ✅ Data Source Plugins - CSV, JSON, XML, HTTP, AWK, Python integration
- ✅ Cross-Target Glue - Compose predicates across languages in unified pipelines
- ✅ Parallel Execution - Automatic partitioning and parallel processing
- ✅ Security & Firewall - Production-ready policy enforcement
Example: CSV to JSON Pipeline
Input (Prolog):
% Define data source
csv_source(users/4, [
file('users.csv'),
has_header(true)
]).
% Define transformation
process_user(Name, Age, City, Output) :-
Age >= 18,
format(string(Output),
'{"name":"~w","age":~w,"city":"~w"}',
[Name, Age, City]).
% Compile to bash
?- compile_to_bash(process_user/4, BashScript).
Output (Bash):
#!/bin/bash
# Streaming CSV processor with age filter
tail -n +2 users.csv | while IFS=',' read name age city _; do
if (( age >= 18 )); then
printf '{"name":"%s","age":%d,"city":"%s"}\n' \
"$name" "$age" "$city"
fi
done
Use Cases
- ETL Pipelines - Transform data between formats efficiently
- System Administration - Generate complex bash scripts declaratively
- Data Analysis - Process large datasets with streaming algorithms
- Cross-Platform Tools - Write once, compile to multiple platforms
- Educational - Learn declarative programming and code generation
Getting Started
- Installation
git clone https://github.com/s243a/UnifyWeaver.git
cd UnifyWeaver
swipl examples/load_demo.pl
- Learn the Basics
- Explore Examples
- See examples/ in the repository
- Run demos:
swipl examples/data_sources_demo.pl
Recent Updates
December 2025
- ✅ Reorganized 13-book educational series with learning paths
- ✅ Cross-target glue Phase 7 (cloud & enterprise deployment)
- ✅ New README with target comparison tables
November 2025
- ✅ C# query runtime with semi-naive fixpoint evaluation
- ✅ SQL target with recursive CTEs and window functions
- ✅ Go/Rust native binary targets
Documentation
For Users
For Learners
For Developers
License
- Code: MIT OR Apache-2.0
- Documentation: CC-BY-4.0