A temporal ML pipeline DSL with first-class branching
Project description
FusionFlow
A polyglot, provenance-aware pipeline language with first-class temporal branching
FusionFlow is an experimental domain-specific language (DSL) for data transformation and machine learning pipelines. It combines:
- Temporal Branching — First-class language primitives for checkpoints, timelines, and what-if experiments
- Unified Execution Graph (UPEG) — Canonical intermediate representation with capability-aware backend planning
- Provenance Tracking — Column-level lineage for reproducible experiments
- Polyglot Integration — Seamless execution across Python (Pandas, scikit-learn) with future support for Spark/JVM and GPU backends
✨ Features
- Python-like syntax with domain-specific constructs for data pipelines
- Checkpoint/Timeline semantics for reproducible what-if experiments
- Automatic ML model training with built-in metrics
- Copy-on-write state management for efficient branching
- VS Code syntax highlighting (extension coming soon)
🚀 Installation
Python Users
pip install fusionflow
Windows Users (.exe - No Python Needed)
Download the latest .exe from GitHub Releases
VS Code Users
Install the extension from VS Code Marketplace:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search "FusionFlow"
- Click Install
From Source
cd fusionflow
pip install -e .
📖 Quick Start
Create a file example.ff:
dataset customers from "data/customers.csv"
pipeline churn_features:
from customers
where active == 1
derive spend_per_day = amount / days
features [spend_per_day, age]
target churned
split 80% train, 20% test
end
experiment churn_exp:
model random_forest
using churn_features
metrics [accuracy, f1]
end
print metrics of churn_exp
Run it:
fusionflow example.ff
🌟 Language Features
Dataset Declaration
dataset customers from "customers.csv"
dataset events from "events.parquet" versioned true
Pipeline Definition
pipeline my_pipeline:
from customers
join events on customers.id == events.user_id
where age > 18
derive total_spend = price * quantity
features [age, total_spend, category]
target purchased
split 80% train, 20% test
end
Experiments
experiment my_experiment:
model random_forest # or: logistic_regression
using my_pipeline
metrics [accuracy, f1, precision, recall, auc]
end
print metrics of my_experiment
Temporal Branching
# Save checkpoint
checkpoint "baseline"
experiment baseline_exp:
model random_forest
using features_v1
metrics [accuracy]
end
# Create isolated timeline
timeline "experiment_v2" {
# Modify pipeline in this timeline
pipeline features_v2:
from customers
derive new_feature = col_a * col_b
features [new_feature, age]
target outcome
end
experiment v2_exp:
model random_forest
using features_v2
metrics [accuracy]
end
}
# Merge best timeline back
merge "experiment_v2" into "main"
# Or restore checkpoint
undo "baseline"
📋 Command-Line Usage
# Run a script
fusionflow script.ff
# Print AST (for debugging)
fusionflow --print-ast script.ff
# Show runtime state after execution
fusionflow --print-state script.ff
# Debug mode
fusionflow --debug script.ff
📖 Documentation
New to FusionFlow? Start here:
- How to Use FusionFlow ← Complete 8-step guide for beginners
- Quick Reference ← One-page cheat sheet (bookmark this!)
Technical Documentation:
- Architecture - System design and components
- Implementation Summary - Code walkthrough
- Why FusionFlow is Unique - Differentiation & positioning
For Maintainers:
🛠️ Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
# Format code
black fusionflow/
# Type check
mypy fusionflow/
📐 Architecture
FusionFlow consists of:
- Lexer (
lexer.py) — Tokenizes source code - Parser (
parser.py) — Builds Abstract Syntax Tree (AST) - AST Nodes (
ast_nodes.py) — Structured representation - Runtime (
runtime.py) — State management with temporal branching - Interpreter (
interpreter.py) — Executes AST using Pandas/scikit-learn - CLI (
__main__.py) — Command-line interface
Future: UPEG Backend Planner
The Unified Polyglot Execution Graph (UPEG) will enable:
- Capability-aware backend selection (Pandas → Spark → GPU)
- Cross-backend marshalling with provenance preservation
- Runtime cost-based optimization
- Polyglot code execution (Python/Java/JVM)
🎯 Use Cases
- Rapid ML prototyping with clean, declarative syntax
- Reproducible experiments with checkpoint/timeline branching
- Data pipeline development with built-in lineage tracking
- What-if analysis through isolated timeline execution
📄 License
MIT License - see LICENSE file
🤝 Contributing
Contributions welcome! This is an experimental language designed for:
- Research in programming language design
- Temporal semantics in data pipelines
- Provenance-aware optimization
- Multi-backend execution planning
🔗 Related Work
- dbt — SQL-based data transformation
- Kedro — Python data pipeline framework
- Apache Beam — Unified batch/streaming model
- Kubeflow Pipelines — ML workflow orchestration
Status: Alpha / Proof of Concept
Built with ❤️ for exploring novel programming language concepts in data engineering and ML.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fusionflow-0.3.0.tar.gz.
File metadata
- Download URL: fusionflow-0.3.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cceaf51b96c6eb5baaff917f91d71c2423dee0ea717b09a5973ecd17c701608
|
|
| MD5 |
a91ddb96bb0056eff70a6af26a671a1d
|
|
| BLAKE2b-256 |
285de19082b1d21690e55292bd2ca6b9b30073317dcc30f5b33c2f84c5618f87
|
File details
Details for the file fusionflow-0.3.0-py3-none-any.whl.
File metadata
- Download URL: fusionflow-0.3.0-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac4845d3fe9a4ca1c2f5af775dca3eb02eeca24f4918ab545665fe704ecc15f8
|
|
| MD5 |
d3afbc8cac8c6f133affb334cc84657f
|
|
| BLAKE2b-256 |
399a45ad309d2fbc712b602baf724ac9dc8d493256c7386d6670c807d3024fb7
|