Case 003

Cold / hot functions

@cold pure logic becomes cacheable (@functools.cache, auto-imported); @hot is a marker only. Function definitions and @cold round-trip. @hot has one documented cosmetic exception.

ok: false — **expected, but narrower than it looks**. Function definitions and class ARE fully bidirectional (added later); the ONLY reason this specific example doesn't round-trip is @hot, which has no Python equivalent and is rendered forward as a marker comment (# @hot: dynamic state — not cached) for human readability.updated 2026-07-19

EML

eml
# cold = pure, cacheable logic
@cold
def square_sum(N):
    Σ(i^2, i in [1:N]) => r
    return r

# hot = dynamic state / I/O
@hot
def greet(name):
    name^0
    return name

square_sum(100) => total
total^0
greet(total)

Python (deterministic transpilation)

python
import functools

@functools.cache
def square_sum(N):
    r = sum(i**2 for i in range(1, N+1))
    return r

# @hot: dynamic state — not cached
def greet(name):
    print(name)
    return name

total = square_sum(100)
print(total)
greet(total)

stdout (executed)

text
338350
338350

Trace event types

eml:run:starteml:def (cold)eml:def (hot)eml:calleml:sumeml:assigneml:cache:misseml:returneml:assigneml:outputeml:calleml:outputeml:returneml:run:done