Top
Best
New

Posted by samrolken 11/1/2025

Show HN: Why write code if the LLM can just do the thing? (web app experiment)(github.com)
I spent a few hours last weekend testing whether AI can replace code by executing directly. Built a contact manager where every HTTP request goes to an LLM with three tools: database (SQLite), webResponse (HTML/JSON/JS), and updateMemory (feedback). No routes, no controllers, no business logic. The AI designs schemas on first request, generates UIs from paths alone, and evolves based on natural language feedback. It works—forms submit, data persists, APIs return JSON—but it's catastrophically slow (30-60s per request), absurdly expensive ($0.05/request), and has zero UI consistency between requests. The capability exists; performance is the problem. When inference gets 10x faster, maybe the question shifts from "how do we generate better code?" to "why generate code at all?"
436 points | 324 commentspage 7
th3o6a1d 11/1/2025|
Maybe next step is have the llm create persistent tools from the queries it uses most often.
samrolken 11/1/2025||
I thought about doing that, or having the LLM create and save HTML components, but for this particular experiment I wanted to keep it as pure and unfiltered as possible.
jadbox 11/1/2025||
I've gone down this line of thought, but after adding cache lines that are highly problematic, I just end up back to LLM generating regular code as normal development calls for.
amelius 11/1/2025||
Why have an internet connection when your local LLM can just speak the HTTP protocol?
ch_fr 11/2/2025||
Hopefully this proof of concept isn't deployed on any public-facing infrastructure, I feel like you could get massively screwed over by... ironically, llm scrapers.
zmmmmm 11/1/2025||
Yes, why not burn a forest to make a up of tea, if we can fully externalise the cost.

Even if LLMs do get 10x as fast, that's not even remotely enough. They are 1e9 times as compute intensive.

bigstrat2003 11/1/2025||
Because it can't, and may never be able to. The lack of progress on making LLMs actually useful is not encouraging for future prospects of advancement, but we shall see I guess.
meowface 11/1/2025|
The anti-AI movement feels increasingly cultish.
Toine 11/1/2025||
Much less than the AI movement.
meowface 11/1/2025||
I don't agree at all. (Minus the 4o cultist faction.)
giancarlostoro 11/1/2025||
From openapi restful spec to claude code spec files. I mesn GraphQL kind of was pushing us towards a better rest / web API that doesnt necessarily constrain traditional APIs.
utopiah 11/1/2025||
It's all fun & games until the D part of CRUD hits.
syngrog66 11/2/2025||
like how moving money atomically between 2 remote databases was a solved problem then some guy said, "Yes but let's reinvent that using blockchain!" and all the dystopic effects the world has seen since. indirectly leading to the overinvestment in massive amounts of GPU hardware which then got repurposed by the AI/LLM folks. funny that
ares623 11/1/2025||
Amazing. This is the Internet moment of AI.

The Internet took something that used to be slow, cumbersome, expensive and made it fast, efficient, cheap.

Now we are doing it again.

cheema33 11/1/2025||
> Amazing. This is the Internet moment of AI.

I am a big proponent of AI. To me, this experiment mostly shows how not to use AI.

sixdimensional 11/1/2025||
Have you tried the thought experiment though?

I agree this way seems "wrong", but try putting on your engineering hat and ask what would you change to make it right?

I think that is a very interesting thread to tug on.

netsharc 11/2/2025|||
Not grandfather, but this is "wrong" because it's like asking a junior coder to store/read some values in the database manually (each time writing an SQL query) and then writing HTML to output those values. Each time the junior coder has to do some thinking and looking up. And the AI is doing a similar thing (using the word "thinking" loosely here).

If the coder is smart, she'll write down the query and note where to put the values, she'll have a checklist of how to load the UI for the database, paste the query, hit run, and copy/paste the output to her HTML. She'll use a standard HTML template. Later she could glue these steps up with some code so that a program takes those values, put them in the SQL query, and then put them in the HTML and send that HTML to the browser... Oh look, she's made a program, a tool! And if she gets an assignment to read/write some values, she can do it in 1 minute instead of 5. Wow, custom made programs save time, who could've guessed?

sixdimensional 11/3/2025||
Thank you for your response!

I agree that spending time on inference or compute every time for the same LLM task is wasteful and the results would be less desirable.

But I don't think the thought experiment should end with that. We can continue to engineer and problem solve the shortcomings of the approach, IMHO.

You provided a good example of an optimization - tool creation.

Trying to keep my mind maximially open - one could think of a "design time" performance at runtime - where the user interacting with the system is describing what they want the first time, and the system is assembling the tool (much like we do now with AI assisted coding, but perhaps without even seeing the code).

Once that piece of the system is working it is persisted so no more inference is required, as essentially code - a tool, that saves time. I am thinking of this as essentially memoizing a function body- i.e. generating and persisting the code.

There could even be some process overseeing the generated code/tool to make sure the quality meets some standard and providing automated iteration, testing, etc if needed.

A big problem is if the LLM never converges to the "right" solution on it's on (e.g. the right tool to generate the HTML from the SQL query, without any hallucination). But, I am willing to momentarily punt on that problem as being more to do with the determinism problem and the quality of the result. The issue isn't per se the non-deterministic results of an LLM anyway, it's the quality of the result fit for purpose for the use case.

I think it's difficult but possible to go further with the thought experiment. A system that "builds itself" at runtime, but persists what it builds, based on user interaction and prompting when the result is satisfactory...

I remember one of the first computer science things I learned- the program that could print out it's own source code. Even then we were believing that systems could build themselves and grow themselves.

So my ask would be to look beyond the initial challenge of the first time costs of generating the tool/code and solve that by persisting a suitable result.

What challenge or problem comes next in this idea?

ares623 11/1/2025|||
Running inference for every interaction seems a bit wasteful IMO, especially with a chance for things to go wrong. I’m not smart enough to come up with a way on how to optimize a repetitive operation though.
sixdimensional 11/2/2025||
I totally agree. The reason I asked before offering any solution ideas was I was curious what you might think.

My brain went to the concept of memoization that we use to speed up function calls for common cases.

If you had a proxy that sat in front of the LLM and cached deterministic responses for inputs, with some way to maybe even give feedback when a response is satisfactory.. this could be a building block for a runtime design mode or something like that.

Tepix 11/1/2025|||
This time, the other way round!
conartist6 11/2/2025||
Then AI came and made the internet slow, cumbersome and expensive again
socketcluster 11/1/2025|
If anyone is interested in a CRUD serverless backend, I built https://saasufy.com/

I'm looking for users who want to be co-owners of the platform. It supports pretty much any feature you may need to build complex applications including views/filtering, indexing (incl. Support for compound keys), JWT auth, access control. Efficient real-time updates. It's been battle tested with apps with relatively advanced search requirements.

More comments...