Pure Effect
Reproduce production bugs on your laptop without a DB
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
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.
HN · launched Jun 21, 2026 · 58 upvotes (top 14%) · 0 views
Niche: software debugging tools · 80 launches, 5 in the last 7 days ▼ -50% · Explore this niche →
Category and tags
- Horizontal
- Dev tools
- Developer
- Not AI
- Commercial product
Visit website ↗ Source listing ↗
More like this: all 80 launches in software debugging tools →
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 : 132 launches clear the similarity bar, closest 8 shown.
Attention rank: #25 of 133 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 232 days after the earliest competitor.
- CodeDrift · hn · 2026-03-05 · 5 upvotes · similarity 0.50
- mutant-cafe · github · 2026-11-03 · 64 upvotes · similarity 0.46
- I wrote a book · hn · 2025-12-08 · 53 upvotes · similarity 0.44
- effect-email · github · 2026-10-22 · 30 upvotes · similarity 0.44
- Suites · hn · 2025-11-04 · 19 upvotes · similarity 0.43
- Nectar, a Rust-like React that compiles to WebAssembly · hn · 2026-07-06 · 29 upvotes · similarity 0.42
- Breken · ph · 2026-11-12 · 2 upvotes · similarity 0.40
- GEDB · hn · 2026-02-16 · 9 upvotes · similarity 0.40
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.