Language
Examples Tour
A guided reading order through every program in
cookbook/. Each entry gives a one-line summary and
a link to the file (and to the in-depth doc where one exists).
Reading order
If you are new to Eta, work through the Beginner and Symbolic &
Logic sections first. The AAD & Finance and Causal & Portfolio
sections build on each other and culminate in
portfolio.eta.
Beginner
| Example | Topic |
|---|---|
hello.eta | First program: module, import, defun, recursion |
basics.eta | Values, bindings, cond, records, quoting |
functions.eta | defun, lambda, closures, variadics, letrec |
higher-order.eta | map*, filter, foldl, zip, range |
composition.eta | compose, flip, negate, manual currying |
recursion.eta | Fibonacci, deep flatten, Ackermann, Hanoi |
exceptions.eta | catch / raise, dynamic-wind, structured payloads |
Symbolic & Logic
| Example | Topic |
|---|---|
boolean-simplifier.eta | Tree rewriting, De Morgan, fixed-point |
symbolic-diff.eta | Computer algebra: differentiation + simplification |
unification.eta | Raw logic-var, ==, findall |
logic.eta | Relations: parento, grandparento, membero |
send-more-money.eta | Classic CLP(FD) cryptarithm |
nqueens.eta | N-Queens via CLP |
AAD & Finance
| Example | Topic | Walkthrough |
|---|---|---|
aad.eta | Reverse-mode AD primer, grad | AAD |
european.eta | Black–Scholes Greeks (1st & 2nd order) | European options |
sabr.eta | SABR vol surface, Hagan approximation | SABR |
xva.eta | CVA / FVA sensitivities via AAD | XVA |
xva-wwr/ | Wrong-Way Risk via do-interventions | XVA with WWR |
Statistics & ML
| Example | Topic |
|---|---|
stats.eta | Descriptive stats, OLS |
torch.eta | libtorch tensor / autograd basics |
tests/torch/ | Layer / optimiser smoke tests |
Concurrency
| Example | Pattern |
|---|---|
message-passing.eta | Parent / child via PAIR |
inproc.eta | spawn-thread with closure capture |
worker-pool.eta | Parallel fan-out |
parallel-map.eta | Map over a list, one worker per item |
parallel-fib.eta | Recursive parallel Fibonacci |
monte-carlo.eta | Embarrassingly parallel π estimation |
scatter-gather.eta | SURVEYOR / RESPONDENT |
pub-sub.eta | Topic-filtered PUB / SUB |
echo-server.eta, echo-client.eta | REQ / REP |
distributed-compute.eta | Cross-machine TCP messaging |
Reference: Message Passing, Networking, Network Message Passing, Supervisor.
Causal & Portfolio
| Example | Role | Walkthrough |
|---|---|---|
causal_demo.eta | Primer: symbolic + causal + CLP + libtorch | Causal |
do-calculus/ | Worked do-calculus identification problems | Causal |
fact-table.eta | Columnar fact tables for analytics | Fact Table |
portfolio-lp.eta | LP construction via std.clpr | — |
portfolio.eta | End-to-end causal portfolio engine | Portfolio |
Packaging
| Example | Topic | Walkthrough |
|---|---|---|
packaging/end-to-end/ | End-to-end package flow: local library + app path dependency | First App |
Notebooks
| Notebook | Topic |
|---|---|
notebooks/ | Jupyter examples (xeus-eta kernel) |
See Jupyter for kernel installation.