frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Pure Effect – Reproduce production bugs on your laptop without a DB

https://pure-effect.org
1•tie-in•1h ago
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-TS

Effect-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-effect

I wrote five posts that document how Pure Effect evolved. They are tagged at https://lackofimagination.org/tags/effect/ if you want the longer story.

Ask HN: Anyone notice World Cup video feeds look like AI?

1•TZubiri•44s ago•0 comments

Be Realistic. Demand the Impossible

https://syndekit.substack.com/p/be-realistic-demand-the-impossible
1•Tomte•1m ago•0 comments

Show HN: MdFried, the Ultimate Markdown Viewer

https://github.com/benjajaja/mdfried
1•the_gipsy•4m ago•0 comments

Someone Build a OS for Claude Code

https://github.com/mateolafalce/claudios/blob/main/README.md
1•lafalce•5m ago•0 comments

Cross-LIB – WORA for vintage devices

https://www.igdb.com/game_engines/cross-lib
1•goldenxp•6m ago•0 comments

Show HN: A 'boggle-like' daily word game

https://www.categori.app
1•lumpycustard•6m ago•0 comments

Portfolio Covariance Optimization and Market Impact Capacity Engine

https://github.com/dy9gzbph7m-cpu/quant-frontier-capacity-solver
2•cjb6s•9m ago•0 comments

JSON-LD Explained for Personal Websites

https://hawksley.dev/blog/json-ld-explained-for-personal-websites/
3•ethanhawksley•12m ago•0 comments

Peakload Benchmarks for Operating Systems

https://linuxcommunity.io/t/peakload-benchmarks-for-operating-systems/9459
2•ashitlerferad•16m ago•0 comments

Show HN: Gaming is YouTube bigges category and the least criticised we scored it

https://ctrl-watch.xyz/
2•deimos459•21m ago•0 comments

A cheaper and safer agentic AI workflow

https://danuker.go.ro/a-cheaper-and-safer-agentic-ai-workflow.html
2•danuker•25m ago•0 comments

I make good money. Why do I still feel like this?

https://yourbrainonmoney.substack.com/p/i-make-good-money-why-do-i-still
2•momentmaker•25m ago•0 comments

Oasis Ambient – Wi-Fi LED Light Teardown

https://www.ifixit.com/Teardown/Oasis+Ambient+Teardown/221776
2•z3ugma•27m ago•0 comments

Tech pundit Cringely cofounds startup '2Brains Inc' to solve LLM hallucinations

https://slashdot.org/story/26/06/20/0556251/tech-pundit-cringely-co-founds-startup-2brains-inc-to...
2•MilnerRoute•29m ago•0 comments

List of Unusual Deaths

https://www.orangecrumbs.com/l/unusual-deaths
2•octopus143•30m ago•1 comments

Open-source Vulkan driver NVK gains experimental DLSS support

https://www.tomshardware.com/pc-components/gpu-drivers/open-source-nvidia-vulkan-driver-nvk-gains...
2•rndsignals•31m ago•0 comments

How Old Are You in Space?

https://ethanwillingham.com/space-age.html
3•Willingham•32m ago•0 comments

Flic Mic for AI – The Wireless Voice Button

https://mic.flic.io/
3•jamie4224•33m ago•0 comments

The GLP-1 boom is the biggest climate story no one is pricing in

https://fortune.com/2026/06/21/glp1-drugs-climate-food-system-emissions-investment/
4•jtbayly•40m ago•1 comments

Tech Company Finder

https://tech.bingo/
2•thisismytest•41m ago•0 comments

MicroVM sandbox solves one problem well, but not the agent security problem

https://decodebytes.substack.com/p/why-your-microvm-sandbox-solves-a
2•decodebytes•43m ago•1 comments

Netflix, A24 and Focus Pass on Luca Guadagnino's Movie 'Artificial'

https://variety.com/2026/film/global/luca-guadagnino-artificial-sam-altman-netflix-a24-mubi-12367...
4•theanonymousone•43m ago•0 comments

Chatting with an AI Won't Make You a Top Programmer

https://lemire.me/blog/2026/06/21/chatting-with-ai-wont-make-you-a-top-programmer/
5•jjgreen•44m ago•2 comments

MMTk – Memory Management Toolkit

https://www.mmtk.io/
2•smartmic•47m ago•0 comments

Mark Zuckerberg wants to replace your phone with (10 years of work)

https://thenewassociationwebmasters.blogspot.com/2026/06/mark-zuckerberg-wants-to-replace-your.html
2•laurentlof•48m ago•1 comments

Why everyone is talking about real-time analytics

https://clickhouse.com/blog/why-everyone-is-talking-about-real-analytics-yellow-company
4•saisrirampur•51m ago•0 comments

Polymarket reportedly paid people to post fake videos of themselves placing bets

https://www.theverge.com/tech/953285/polymarket-fake-viral-video-bets
4•thm•53m ago•0 comments

Horus – Zero-dependency C++ CLI for malware IOC analysis and enrichment

https://github.com/mobinert/horus
2•fergalina•54m ago•0 comments

Introducing ZSoftly Cloud Platform, a Canadian public cloud

https://zcp.zsoftly.ca/blog/introducing-zsoftly-cloud-platform/
2•dckzs•54m ago•0 comments

The Case Against Travel (2023)

https://www.newyorker.com/culture/the-weekend-essay/the-case-against-travel
3•thm•57m ago•0 comments