frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Functional programming accelerates agentic feature development

https://cyrusradfar.com/thoughts/functional-programming-is-the-only-way-to-scale-with-ai
45•cyrusradfar•3d ago

Comments

midnight_eclair•3d ago
even if i would generally agree with the principles, no amount of markdown prompting is going to increase my confidence in agent's output and so i keep asking this question:

> what do you use for normative language to describe component boundary, function and cross-component interactions?

something i can feed into a deterministic system that will run a generative suite of tests (quickcheck/hypothesis/clojure.spec) that will either give me the confidence or give the agent the feedback.

cyrusradfar•3d ago
OP / Author here, I started closer to where you are but ended up realizing I've led a few eng teams and was never satisfied with code quality. What I COULD be satisfied by was moving our metrics in the right direction. Testing coverage, use cases covered by E2E / integration tests, P99/backend efficiency metrics, cost of infrastructure and obviously user growth along with positive feedback from Users.

That said, I don't "vibe" because it creates great code I love reading, but I can monitor and move the same metrics I would if I was managing a team.

I also use code tours a bit, and one of my first tools I needed and built (intraview.ai) was to support this need to get deep in the code the Agents were claiming was ready to ship.

pmarreck•7h ago
so does insisting on TDD.

I've known these things from the beginning.

Any extra restriction that still produces functional code ends up being great for LLMs to curb them deterministically.

lispisok•6h ago
This article is just describing Clojure. The SUPER principals are describing the native natural way of writing Clojure, no category theory needed.
cyrusradfar•6h ago
OP here: thanks for chiming in.

I've explored Clojure after talking to Metabase about how it had benefited them. That said, it was years ago so I can't claim it influenced this work.

The framework was designed to be a language agnostic way of sharing best practices to bias agent behavior towards a more scalable end. I initially used it when I was working with a team to do some massive refactoring/clean up across the codebase. We didn't come to an acronym but similar principles and it was "testable" and easy to push back on PRs that weren't aligned with the principles.

That said, it may be interesting to see if I could replace all that context and just say -- "code it like you would with Clojure"

Have you tried that?

laitopezz•5h ago
My impression too. Most of what is in this post I've discovered almost entirely through clojure and I'm not even a clojure dev, just try to explore it in my free time. I did cmd + f in browser and searched for clojure pretty soon in to reading this.
4b11b4•6h ago
close
Tadeuvich•5h ago
Functional programming also helped get ride of bugs before, and still people used other paradigms. Why would we change now? How to know that functional programming is indeed better for vibe coding?
nextos•5h ago
It should be better for the reasons explained in the article. Pure functions require no context to understand. If they are typed, it's even simpler. LLMs perform badly on code that has lots of state and complex semantics. Those are hard to track.

In fact, synthesis of pure Haskell powered by SAT/SMT (e.g. Hoogle, Djinn, and MagicHaskeller) was already of some utility prior to the advent of LLMs. Furthermore, pure functions are also easy to test given that type signatures can be used for property-based test generation.

I think once all these components (LLMs, SAT/SMT, and lightweight formal methods) get combined, some interesting ways to build new software with a human-in-the-loop might emerge, yielding higher quality artifacts and/or enhancing productivity.

td2•5h ago
Wouldnt a fair counter argument be, that llms have been trained on way less fu ctional code though?

Like they are trained on a LOT of js code -> good at js Way less functional code -> worse performance?

nextos•5h ago
That's a very fair point. There are some publications showing lower performance for languages with less training data. I imagine it also applies to different paradigms. Most training code will be imperative and of lower quality.
mvellandi•4h ago
You can write functional-style code in many languages, as I have in JS and occasionally Python to great benefit.
cyrusradfar•4h ago
OP Here:

it’s not discussed in this post but in another right after I discuss the modeling I was doing on tech debt and finding the game to improve agent outcomes was reducing context.

functional programming accomplishes that. I can’t claim it’s the only way, but it’s one that’s well understood in the community

majormajor•4h ago
What makes is special about "agentic development" vs reducing context requirements, reducing cognitive burden, etc for human development too? "A human developer builds a mental model of a codebase over months"—yeah, that makes onboarding to a codebase very time consuming, expensive, and error-prone.

So why is "better for agents" distinct from "better for humans"?

bitexploder•4h ago
Agents can simply be told to write code in a functional style. They won’t complain. Think of it like a constraint system or proofs system. The agent can better reason about the code and side effects. Etc. Agents are very good at following and validating constraints and hill climbing. This makes sense to me. Humans benefit too, but it is hard to get a bunch of humans to follow the style and maintain it over time.
wavemode•5h ago
The article presents a function making use of global variables, declares it bad, and then proposes that the solution is functional programming.

There's nothing wrong with promoting functional programming, but the implication that all non-FP code is hard to test and/or uses global state is naive.

hurril•2h ago
It really isn't. Having worked for several decades on "both sides", this really is my experience. The functional side is better typed and has fewer side effects of this kind. It is more normal, as in more common, to have code work correctly as soon as it compiles. This is my lived experience having worked with Java, Scala, F# and Rust since 1999.
ZitchDog•5h ago
I've been having good luck with fairly autonomous LLM coding with the following rules:

  * TypeScript everywhere with extreme enforcement of the type system.

  * No "as" casts, no "any" declarations, all code must understand the shape of its data

  * All boundaries validated using a typed validation library. Many use zod, I prefer tjs. I also have strictly typed pg and express wrappers.

  * No files longer than 300 lines

  * All of these rules are enforced by an eslint configuration that runs in a pre commit hook.

Global state and classes could also be removed via eslint rules, that would be interesting, though I haven't found it to be an issue in practice once the types are strictly enforced.
brap•4h ago
How do you enforce the use of validation library with eslint?
yangshi07•4h ago
So glad to see someone working on making fucking coding better — making LLMs write good code, not just vibe and wow, and not just pretend the code is magic.
brap•4h ago
I really like the “functional core, imperative shell” approach, I try to use it whenever I can. I wish more non-FP languages had a way to mark a function as pure (and have this statically enforced).

Show HN: A game where you build a GPU

https://jaso1024.com/mvidia/
733•Jaso1024•16h ago•157 comments

Introduction to Computer Music (2009) [pdf]

https://composerprogrammer.com/introductiontocomputermusic.pdf
150•luu•7h ago•49 comments

OpenScreen is an open-source alternative to Screen Studio

https://github.com/siddharthvaddem/openscreen
280•jskopek•4d ago•49 comments

Lisette a little language inspired by Rust that compiles to Go

https://lisette.run/
33•jspdown•2h ago•18 comments

German implementation of eIDAS will require an Apple/Google account to function

https://bmi.usercontent.opencode.de/eudi-wallet/wallet-development-documentation-public/latest/ar...
242•DyslexicAtheist•10h ago•168 comments

LLM Wiki – example of an "idea file"

https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
185•tamnd•16h ago•53 comments

Rubysyn: Clarifying Ruby's Syntax and Semantics

https://github.com/squadette/rubysyn/blob/master/README.md
40•petalmind•3d ago•2 comments

Zml-smi: universal monitoring tool for GPUs, TPUs and NPUs

https://zml.ai/posts/zml-smi/
42•steeve•4d ago•6 comments

How many products does Microsoft have named 'Copilot'?

https://teybannerman.com/strategy/2026/03/31/how-many-microsoft-copilot-are-there.html
634•gpi•13h ago•302 comments

AWS engineer reports PostgreSQL perf halved by Linux 7.0, fix may not be easy

https://www.phoronix.com/news/Linux-7.0-AWS-PostgreSQL-Drop
281•crcastle•9h ago•82 comments

Show HN: I built a small app for FSI German Course

https://detawk.com/
29•syedmsawaid•2d ago•10 comments

Scientists Figured Out How Eels Reproduce (2022)

https://www.intelligentliving.co/scientists-finally-figured-out-how-eels-reproduce/
18•thunderbong•3d ago•0 comments

Nvim-treesitter (13K+ Stars) is Archived

https://github.com/nvim-treesitter/nvim-treesitter/discussions/8627
121•RohanAdwankar•9h ago•38 comments

Aegis – open-source FPGA silicon

https://github.com/MidstallSoftware/aegis
18•rosscomputerguy•3h ago•1 comments

Show HN: Contrapunk – Real-time counterpoint harmony from guitar input, in Rust

https://contrapunk.com/
64•waveywaves•8h ago•26 comments

Modern Generic SVGA driver for Windows 3.1

https://github.com/PluMGMK/vbesvga.drv
36•userbinator•4h ago•5 comments

Elizabeth I's Manuscript of Pierre Boaistuau's Histoires Prodigieuses (1559)

https://publicdomainreview.org/collection/histoires-prodigieuses/
3•benbreen•3d ago•0 comments

Show HN: I made open source, zero power PCB hackathon badges

https://github.com/KaiPereira/Overglade-Badges
98•kaipereira•19h ago•10 comments

Show HN: sllm – Split a GPU node with other developers, unlimited tokens

https://sllm.cloud
158•jrandolf•18h ago•78 comments

Components of a Coding Agent

https://magazine.sebastianraschka.com/p/components-of-a-coding-agent
232•MindGods•20h ago•73 comments

The Indie Internet Index – submit your favorite sites

https://iii.social
143•freshman_dev•19h ago•28 comments

Ruckus: Racket for iOS

https://ruckus.defn.io/
126•nsm•2d ago•11 comments

Electrical transformer manufacturing is throttling the electrified future

https://www.bloomberg.com/features/2025-bottlenecks-transformers/
86•toomuchtodo•3d ago•75 comments

Show HN: M. C. Escher spiral in WebGL inspired by 3Blue1Brown

https://static.laszlokorte.de/escher/
78•laszlokorte•13h ago•12 comments

Advice to young people, the lies I tell myself (2024)

https://jxnl.co/writing/2024/06/01/advice-to-young-people/
103•mooreds•10h ago•29 comments

Apple approves driver that lets Nvidia eGPUs work with Arm Macs

https://www.theverge.com/tech/907003/apple-approves-driver-that-lets-nvidia-egpus-work-with-arm-macs
427•naves•17h ago•189 comments

Demonstrating Real Time AV2 Decoding on Consumer Laptops

http://aomedia.org/blog%20posts/Demonstrating-Real-Time-AV2-Decoding-on-Consumer-Laptops/
19•breve•7h ago•1 comments

Show HN: TurboQuant-WASM – Google's vector quantization in the browser

https://github.com/teamchong/turboquant-wasm
154•teamchong•18h ago•6 comments

Embarrassingly simple self-distillation improves code generation

https://arxiv.org/abs/2604.01193
591•Anon84•23h ago•178 comments

The CMS is dead, long live the CMS

https://next.jazzsequence.com/posts/the-cms-is-dead-long-live-the-cms
142•taubek•22h ago•88 comments