pyFlow · the Python lane of flowg

Python, priced
in joules.

pyFlow lowers the Python you already write into the flowg graph, runs it on the substrate, and meters every operation in picojoules. Same source, same answers, with the energy made visible.

Scroll
I · The idea

Keep your Python.
Add a meter.

Python is how the world writes down ideas. pyFlow does not ask you to change it. Your functions, classes, loops, and comprehensions stay exactly as they are.

What changes is what runs them. pyFlow parses your source, lowers it to one typed dataflow graph, and executes that graph on the substrate. Because it is a graph, every operation carries a cost in picojoules, and the runtime can route each one to the hardware that spends the least energy.

II · The receipt

Every run
comes with a bill.

Run a file and pyFlow returns the answer and an itemized energy breakdown: which operations ran, and what each one cost. A multiply is not the same price as an add, and now you can see it.

Today the number is an analytical prior, computed from the graph. The flowg backend compiles the same graph to native code with an exact per-instruction picojoule count, turning the estimate into a measurement.

poly.py
# pyflow run poly.py --receipt
py     : def poly(a, b): return (a + b) * (a - b)
call   : poly(5, 3)
result : 16
energy : 16 pJ

   Add                   1 pJ
   Sub                   1 pJ
   Mul                  14 pJ
III · It runs real Python

Not a toy subset.
The Python you actually write.

accounts.py
class Account:
    def __init__(self, name, balance=0):
        self.name = name
        self.balance = balance
    def report(self):
        return f"{self.name}: {self.balance}"

accounts = [Account("Ada", 100), Account("Bob", 250)]
total = sum([a.balance for a in accounts])
print(f"total = {total}")   # total = 350
Classes
objects, methods, self
Comprehensions
list, dict, set
Recursion
and mutual recursion
Control flow
break, continue, return
Data types
lists, dicts, sets, tuples
Functions
default and keyword args
f-strings
with format specs
Numbers
ints, floats, Python % and //

Sieves, sorts, histograms, recursive fib, and full object-oriented programs run today, each priced in joules. The engine is validated against its own test suite and adversarial program runs.

IV · One graph, many surfaces

Python is one face of
a single, shared graph.

pyFlow is the Python surface of flowg. The web surface is Lux. The systems surface is Joule. They are not three languages that agree by convention. They are three projections of the same energy-metered graph.

Write Python.
Spend fewer joules.

The goal is not a faster benchmark. It is the same programs, the same answers, running on the silicon that costs the least energy, with the receipt to prove it.