Hacker News new | ask | show | jobs
by jasongi 1 day ago
> lot of old PHP are only ever going to risk the smallest upgrade they can, to avoid deprecation issues in extremely old codebases.

This is becoming a rapidly dangerous mindset. The cost and risk of forking and fixing an abandoned piece of code is trending to zero and the risk of being pwned when leaving an EOL library publically exposed to the internet is trending to 100%.

Even the cost and risk of completely removing an unmaintained library is also trending to zero.

LLMs have a lot more patience for enumerating test-cases, automating tests and creating staging environments and magnitudes more than sysadmins have ever had.

The case for "don't touch it don't break it" is getting increasingly indefensible.

2 comments

I don't disagree with any of this. But it is the case.

And you have to remember that a lot of this code is just not in reproducible environments. So there's a fair chunk of setup effort involved in even getting an LLM to be able to safely work on it.

Like I say, the "left behind" tax is a serious problem with this stuff.

Most PHP/Python/Nodejs framework sites are auto-generated throw-away projects, that might run for 2 to 3 years at most.

Most people expect community-code PHP sites to fall apart eventually, as the people that deployed the host are usually already at another company years later.

Usually the fix is to spider a site into static html content, and nuke the dynamic rotting framework part from orbit. =3

> Most PHP/Python/Nodejs framework sites are auto-generated throw-away projects, that might run for 2 to 3 years at most.

Nothing that has survived into this problem space is throw-away, or it would have been thrown away.

There's a lot of solid, boring, just-works PHP that nobody has touched because it works, that now won't run on enforced newer environments because of deprecations. And as the pace of PHP improvement sped up around 8.x, so did the pressure to leave that working code on older PHP versions.

It's easier than ever to upgrade old code.
It may be. But with old code it’s also likely that the people who wrote it either aren’t around or won’t be paid to fix it.
The cost is not zero, especially if the code hasn't been touched in a while.
Upgrading code is organizational. You could tell some companies it will take 1 hour and they will say no.
Or migrate the database and recreate the old app in another language
Yeah — it's very clear to me that PHP itself is now an unacceptable developer burden in terms of maintenance and security for internet-facing applications.

But then I believe this of all interpreted languages now.

Except for OTP compatible languages like Elixir/Erlang, as they remain functional even when partially broken or fair-scheduling in deadlock.

The idea of building flawless code in complex patterns is naive, as at scale the improbable becomes a certitude. The Erlang interpreters have live internal state debugging as part of the API, and is compatible with constraint programming paradigms (list comprehension feature is somewhat functionally similar.)

Some other projects that I've found surprisingly reliable over the years. =3

https://www.rabbitmq.com/

https://www.phoenixframework.org/

> Except for OTP compatible languages like Elixir/Erlang, as they remain functional even when partially broken or fair-scheduling in deadlock.

Yes, though it's not the brokenness that concerns me about interpreted languages, but the interpreter attack surface (and the fact that without care, a supply chain attack can put code on your server that you never run and would only be useful to an attacker). Also that your job each time there's a security issue is to update all these packages and the interpreter, not just your app.

For example, the PHP2shell stuff was absolutely nothing to do with anyone's code; that is what made it so exhausting. No amount of good practice in a code context can save you when the interpreter's interface to the webserver is the target of the attacks.

It's not the only reason I am giving up on clever interpreted languages; smaller open weights LLM performance is another. But it is one.

My modestly-sized deskbound clanker sidekick and I are having fun writing a Swift app at the moment, and it seems highly capable of it. But it likes Golang a lot more. It's more metallic and beepy-boopy, I think. Elixir does seem to be a potential candidate too. Been a while since I looked, but I liked it as a human.

Not saying this is necessarily the case here, but you vastly underestimate just how enormously untested and fragile these legacy systems can be. Even an LLM can need a very skilled operator to succeed in such an environment.

These kinds of systems often not only rely on every possible bug, they can rely on every possible side channel as well. And they often don't have any sort of testing or staging environment where screwups are recoverable.

The problem is more the stuff that isn't fragile, has run well for a decade, and not been updated, perhaps because other things hold that back.

I have one of these apps. Good code, modular structure (but very bespoke, and much of it quite an old design pattern), has a dev environment (but that environment is also old), makes use of a few now quite old dependencies. Works really well, and as a freelancer I simply don't get the billable time to fix what "ain't broke", so it gets improvements as it gets new feature requests.

The problem is that it ain't broke, in fact. Nevertheless I fully know the IIABDFI days are gone.

I am recovering from severe burnout and untangling its dependencies, restructuring it into more modern architecture that will be more amenable to LLM management, but as with any serious legacy code there's a lot to deal with from several directions at once.

Even figuring out how to describe its architecture concisely to an LLM is a multi-phase project! It will be easier to semi-manually modernise some things so that there is less explaining to do.

As it happens, getting it to literally just run on more recent PHP will be a much easier problem.

> Even figuring out how to describe its architecture concisely to an LLM is a multi-phase project! It will be easier to semi-manually modernise some things so that there is less explaining to do.

You don't need to do this anymore. Ask the LLM* to describe its architecture to you.

*edit - a good, frontier LLM - like Astra/Sol/Opus

No, you really do. There are often many things about old established codebases that are simply unavailable to the LLM from inspecting the code. Things about the intent of design choices, transient interactions with other systems, the human processes have evolved around the behaviour, things about unused code pathways.

It’s true even in this project of mine.

I am finding more ways to use LLMs to resolve these issues but I need to be maintaining this project for the longer term and I understand its purpose; I will not bet its future on an LLM’s understanding of its architecture when I am capable of eliminating them.

Lucky you!
I don't underestimate it, but if you still have this problem - it is more of a people/process problem than a technical one.

No staging or testing environment? Get the LLM to create one... Can't create one because of external dependencies/APIs? Get the LLM to reverse engineer you a very convincing mock of that dependency/API - each time there is an observed difference between the real and staging environment, just throw the LLM at fixing it.

The main barriers to achieving any of this is not technical. I'm sure there's places out there where none of the above is possible because those responsible for the systems don't have access to them.

The skilled operator used to be the one dude who knew how the system worked - who didn't have the time to do anything but fight fires. Now days, the skill is understanding how to get the LLM cranking in a good loop and letting it cook. You don't need 20 years of working on a system to know how it works anymore. The most important architectural decision you need to have is to have version-controlled code, infra and monitoring so that the LLM can reason about the system. I suspect many of these legacy systems do not even have source control, but the good thing is that once again, a like-for-like migration such as capturing all the details of a current system and representing it as code is another good example of a self-verifying task that LLMs are also great at.