Show HN: I reinvented PHP in TypeScript (demo)
25 points| vseplet | 9 months ago |github.com
Everything returns HTML, not JSON. No React, no Vite — just plain HTML with server-side rendering.
No build steps, no preprocessors, no complex configs — everything runs from a single file.
Perfect for Telegram Web Apps, internal tools, simple admin panels, dashboards, or anywhere a full-blown SPA feels like overkill.
Important: I built this entirely for myself — to solve my own problems. I hate complex frontend. I hate writing it. And I don’t want to waste time on it. But maybe it’ll help you too.
PetahNZ|9 months ago
ChocolateGod|9 months ago
But, I wouldn't be surprised if its slower than PHP due to the overhead of starting up NodeJS for each request, as PHP has been optimised to have fast start times.
ZYbCRq22HbJ2y7|9 months ago
askonomm|9 months ago
bovermyer|9 months ago
For trivial scripts, though, that practice is still pretty common. You don't necessarily need Twig or whatever if you just need a script to spit out the rows from a single database query.
al_borland|9 months ago
So many people talk about missing the old Internet and the virtues of the small web, and breaking free from platforms… then at the same time speak out against the tools that allow a person to start small and dip their toe into the water of web development, without needing to spend several months in a boot camp for a few lines of server side code.
oaiey|9 months ago
What is the add-on from this library? The only thing I read out of it, is some css and other templating benefits. Which is not the essence of PHP. The essence of PHP is that you mix html and code (which many JS tagged templates support).
This goes more in the direction of component oriented development (e.g. what Blazor does... even Angular). So my rant is about comparing it with PHP.
Not a node & browser dev, but I have my past in PHP and currently some Blazor.
Oxodao|9 months ago
buttocks|9 months ago
vseplet|9 months ago
bdcravens|9 months ago
hu3|9 months ago
"No build steps, no preprocessors, no complex configs".
I worked on a project recently that followed this and Devs loved it. The DX was amazing.
vseplet|9 months ago
Well, I am sure that we need to develop the part with api. It already exists and works great, but lacks middlware functions and caching
unknown|9 months ago
[deleted]
lylejantzi3rd|9 months ago
gbraad|9 months ago
Just unpack, set MySQL credentials, and done.
nusl|9 months ago
fpauser|9 months ago
fennecbutt|9 months ago
andrewmcwatters|9 months ago
Respectfully, this doesn’t look anything like that at all.
unknown|9 months ago
[deleted]
DonHopkins|9 months ago
https://news.ycombinator.com/item?id=32961202
>PHP was already a templating language, but somebody got it in their head that there should be an iron-clad separation between designers and programmers, and that PHP gave designers too much power and confused them, and that their incompetent untrustworthy designers who refused to learn anything about programming deserved something even "simpler" than PHP, so they came up with Smarty.
>Then over time the realized that their designers were powerless, so their programmers would have to learn TWO languages so they could wade into the Smarty templates to make them actually work with all the extra code they had to write because Smarty was so crippled, so they nickle-and-dimed more and more incoherent programming language elements into Smarty, making it EVEN HARDER to use and more complicated and less consistent than PHP, yet nowhere near as powerful.
askonomm|9 months ago
Now if you see that as a bad thing, separating business logic and presentation, and sandboxing presentation so it has no larger access to the system, then I'm afraid you're just not a good programmer.
cess11|9 months ago
Separating out templates was already something one used to do back when Laravel added Blade back in 2010-2011 sometime, in one of the first iterations of the framework. It's not like they experienced pushback because of Blade.