Top
Best
New

Posted by samrolken 3 days ago

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?"
433 points | 318 commentspage 7
MangoCoffee 3 days ago|
Here's why I don't get why people are badmouthing AI assist tools from Claude for Excel to Cursor to any new AI assist tool.

Why not try it out, and if it doesn't work for you or creates more work for you, then ditch it. All these AI assist tools are just tools.

tjr 3 days ago||
Anecdotally, I've seen people do just that. Say, "I've tried it, it either didn't help me at all, or it didn't help me enough to be worth messing with."

But pretty consistently, such claims are met with accusations of not having tried it correctly, or not having tried it with the best/newest AI model, or not having tried it for long enough.

Thus, it seems that if you don't agree with maximum usage of AI, you must be wrong and/or stupid. I can understand that fostering feeling the need to criticize AI rather than just opt out.

MangoCoffee 3 days ago|||
i get your point. i've mixed result with AI tool like Github copilot and Jetbrains Junie.
phyzome 3 days ago|||
Yeah, this is my precise experience. No matter what I say, some AI booster will show up to argue that I didn't experience what I experienced.

(And if I enjoyed being gaslighted, I'd just be using the LLMs in the first place.)

Konnstann 3 days ago||
The problem arises when there's outside pressure to use the tools, or now you're maintaining code written by someone else through the use of the tools, where it could have been good enough for them because they don't have to deal with downstream effects. At least that's been my negative experience with AI coding assistance. You could say "just get a new job" but unfortunately that's hard.
MangoCoffee 3 days ago||
>You're maintaining code written by someone else through the use of these tools, where it could have been good enough for them.

I believe everyone has to deal with that, AI or not. There are bad human coders.

I've done integration for several years. There are integrations done with tools like Dell Boomi (no-code/low-code) that work but are hard to maintain, like you said. But what can you do? Your employer uses that tool to get it running until it can't anymore, as most no-code/low-code tools can get you to your goal most of the time. But when there's no "connector" or third-party connector that costs an arm and a leg, or hiring a Dell Boomi specialist to code that last mile, which will also cost an arm or a leg, then you turn to your own IT team to come up with a solution.

It's all part of IT life. When you're not the decision-maker, that's what you have to deal with. I'm not going to blame Dell Boomi for making my work extra hard or whatnot. It's just a tool they picked.

I am just saying that a tool is a tool. You can see many real life examples where you'll be pressured into using a tool and maintaining something created by such a tool, and not just in IT but in every field.

amelius 3 days ago||
Why have an internet connection when your local LLM can just speak the HTTP protocol?
th3o6a1d 3 days ago||
Maybe next step is have the llm create persistent tools from the queries it uses most often.
samrolken 3 days ago||
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 3 days ago||
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.
syngrog66 2 days ago||
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
zmmmmm 3 days ago||
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.

giancarlostoro 3 days ago||
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.
bigstrat2003 3 days ago||
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 3 days ago|
The anti-AI movement feels increasingly cultish.
Toine 3 days ago||
Much less than the AI movement.
meowface 3 days ago||
I don't agree at all. (Minus the 4o cultist faction.)
utopiah 3 days ago||
It's all fun & games until the D part of CRUD hits.
ares623 3 days ago||
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 3 days ago||
> 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 3 days ago||
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 3 days ago|||
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 1 day ago||
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 3 days ago|||
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 3 days ago||
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 3 days ago|||
This time, the other way round!
conartist6 2 days ago||
Then AI came and made the internet slow, cumbersome and expensive again
drbojingle 3 days ago|
I think what your missing bud is that "writing the code" is caching for the LLM. Do you think caching is going away?
More comments...