Remix.run Logo
Tadeuvich 2 days 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 2 days ago | parent | next [-]

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 2 days ago | parent [-]

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?

mvellandi 2 days ago | parent | next [-]

You can write functional-style code in many languages, as I have in JS and occasionally Python to great benefit.

DeathArrow a day ago | parent [-]

For sure. I write functional style code in C# but it is not the same thing as writing OCaml or F#.

nextos 2 days ago | parent | prev [-]

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.

cyrusradfar 2 days ago | parent | prev | next [-]

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 2 days ago | parent | next [-]

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 2 days ago | parent [-]

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.

cyanydeez a day ago | parent [-]

Agents are useful because they don't inherit context from their parent context. They're basically "compaction" at a small scale. They succeed because context pollution create greater indeterminancy. The fact that you can spin up many of them is not primary benefit of them.

bitexploder a day ago | parent [-]

Hmm? How does this relate to functional programming helping agents code better?

cyanydeez a day ago | parent [-]

> The agent can better reason about the code and side effects. Etc. Agents are very good at following and validating constraints and hill climbing

You're treating an agent like its something other than an LLM with limited context. I'm just trying to surface a incorrect assumption.

You're just talking about LLMs. Whether they're a child of a primary LLM is irrelevent to your conception.

It'd be interesting if you posited that LLMs doing functional style could handle more context without service degradation.

DeathArrow a day ago | parent | prev [-]

>finding the game to improve agent outcomes was reducing context

I think modularization will further reduce context. I am planning to play with your SUPER and SPIRALS idea and use modularization on top via Vertical Slice Architecture or modular monolith where each module is isolated and has a contract.

DeathArrow a day ago | parent | prev [-]

>Why would we change now?

Because previously people had to write code themselves and they had personal preferences. Because the bugs were less when written by a human.

Now personal preferences doesn't matter as much since people won't change the code themselves too much. And because LLM can introduce lots of bugs and make a mess in the code unless you can restrict them somehow.