Pure Effect
Reproduce production bugs on your laptop without a DB
Details
- External ID
- 48620848
- Source
- HN
- Company
- —
- Product
- Pure Effect
- Website domain
- pure-effect.org
- Launched
- June 21, 2026
- Cohort
- —
- Upvotes
- 58
- Upvotes percentile
- 0.860655737704918
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
Hi HN,I think it's safe to say that the majority of developers don't give a second thought to writing code with I/O tangled in business logic. It's all too common to see code like: const user = findUser(email); if (!user) await saveUser(user);Now, you may ask: what's the big deal? When we write code like this, two things happen:1. It gets harder to debug production bugs. Unless you have the exact same database and remote API services to connect to, you may fail to reproduce the bug.2. You have to use mocks and fakes in your tests, or use test containers, which only help somewhat, and they are slow!To solve these issues, I built Pure Effect, a tiny TypeScript/JavaScript effect library. The core idea is simple: if a function performs I/O, it isn't pure. But if it returns a description of the I/O it wants to perform, it is. So instead of await findUser(email), you return a Command object that says, "I would like to call this function, and when it finishes, here's what to do next." Your business logic becomes a pure function. Same input, same output, every time. The database never gets touched until the interpreter (runEffect) runs.When I first started the library, I didn't expect just how far that one idea would stretch. Once your pipelines are just data, a lot of wonderful things become possible:- No need for mocking libraries. You walk the tree in tests and assert on its structure: assert.equal(flow.cmd.name, 'cmdFindUser'). Nothing is executed.- Wrap any effect with Retry(effect, { attempts: 3, delay: 200, backoff: 2 }). The configuration is plain data, so you can assert on it in tests.- Every command's input and output flows through the interpreter, so you get a full execution trace for free. You can write a simple timeTravel() function that replays it locally without touching any I/O. Perfect for debugging complex production bugs.- An onBeforeCommand hook sits between your business logic and the interpreter. Since it sees every intended side effect before it fires, it can be used to enforce runtime guardrails. You can quarantine destructive calls before they happen for example.- You can review AI-generated code before it runs. Since Pure Effect pipelines are plain data, you can inspect what the generated code intends to do before it touches anything.There are just six primitives: Success, Failure, Command, Ask, Retry, and Parallel, plus effectPipe and runEffect. Zero dependencies. Under 1 KB minified and gzipped.How it compares to Effect-TSEffect-TS is the full-featured option in this space and has a large ecosystem. Pure Effect offers a different tradeoff. It covers the 80% case: testable pipelines, dependency injection, retry, and OpenTelemetry hooks, all in under 1 KB with zero dependencies and no new vocabulary to learn. Effect-TS is a framework you build around. Pure Effect, on the other hand, is a pattern you drop into existing code.I've been using Pure Effect in production since December. It's at v0.8.0, not 1.0 yet, but stable enough that I wanted to put it out there and hear what people think.GitHub: https://github.com/aycangulez/pure-effectI wrote five posts that document how Pure Effect evolved. They are tagged at https://lackofimagination.org/tags/effect/ if you want the longer story.
Enrichment
- Theme
- browser automation and scraping for AI
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Commercial product
- Normalized one-liner
- reproduce production bugs locally without database
- Manually corrected
- False
Could you build this?
Partial A web dashboard and basic I/O mock recorder are simple, but true time-travel debugging and deterministic replay across arbitrary asynchronous JavaScript/TypeScript runtimes is a notoriously hard systems problem.
What it would actually take: A production engine requires runtime AST instrumentation (Babel/SWC), Monkey-patching or Proxy virtualization of Node/V8 APIs (fs, net, crypto, timers, async hooks), and snapshotting mechanisms to capture and replay non-deterministic side effects deterministically. This demands deep expertise in JavaScript runtime internals, compiler plugins, and execution sandbox isolation.
Discussion
14 comments analyzed.
Competitors mentioned: Effect.ts, Crux, Elm, Flawless
Concerns raised: Language itself allows shortcuts, preventing mainstream adoption, Difficult to roll out to peers and kills team velocity, PII security nightmare with production event replay, Requires strict SDLC with linters, CI, reviews to work, Implementation hits walls: language limitations, wiring burden, spaghetti code
Feature requests: Better communication of core concepts and value proposition
Competitors
Other products that read as similar to this one — 65 launches clear the similarity bar, closest 8 shown.
Attention rank: #10 of 66 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 230 days after the earliest competitor.
- CodeDrift · hn · 2026-03-05 · 5 upvotes · similarity 0.48
- I wrote a book · hn · 2025-12-08 · 53 upvotes · similarity 0.42
- Suites · hn · 2025-11-04 · 19 upvotes · similarity 0.42
- Nectar, a Rust-like React that compiles to WebAssembly · hn · 2026-07-06 · 29 upvotes · similarity 0.40
- GEDB · hn · 2026-02-16 · 9 upvotes · similarity 0.39
- Make every bug perfectly reproducible · hn · 2026-06-20 · 13 upvotes · similarity 0.37
- 1Baton · hn · 2026-09-13 · 5 upvotes · similarity 0.37
- Afterburner · hn · 2026-06-14 · 6 upvotes · similarity 0.37
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.