TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: I reinvented PHP in TypeScript (demo)

24 pointsby vseplet4 days ago
I built Morph, an experimental fullstack HTML-first library for Deno, Node, and Bun.<p>Everything returns HTML, not JSON. No React, no Vite — just plain HTML with server-side rendering.<p>No build steps, no preprocessors, no complex configs — everything runs from a single file.<p>Perfect for Telegram Web Apps, internal tools, simple admin panels, dashboards, or anywhere a full-blown SPA feels like overkill.<p>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.

12 comments

PetahNZabout 18 hours ago
I think this misses one of the main selling points of PHP, the shared nothing, single thread, fire and forget methodology that I can throw behind a load balancer and spin up 100 servers.
评论 #44029034 未加载
评论 #44029331 未加载
askonommabout 19 hours ago
So this is supposed to be following the practices that were common in PHP ten years ago? Modern PHP is not written in such a way where business logic is mixed with templating. For good reason.
评论 #44028548 未加载
评论 #44033205 未加载
oaieyabout 18 hours ago
My naive question: so if I have node, express, and JS tagged template literals. Is not that what PHP does. Route some url to a html interpolated with code.<p>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).<p>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.<p>Not a node &amp; browser dev, but I have my past in PHP and currently some Blazor.
评论 #44028874 未加载
buttocksabout 13 hours ago
This project is cool but the author seems to have never actually touched PHP that he compares it to.
bdcravensabout 18 hours ago
You should call it NodeFusion
gbraadabout 12 hours ago
The selling point of PHP is the case of deployment on shared gisteren, who either use the pho module with Apache or fpm, or other CGI method. But, as a user, you do not care about this.<p>Just unpack, set MySQL credentials, and done.
nuslabout 14 hours ago
The title originally threw me off but reading the link made me quite like the idea. Keep existing skills and use them in other contexts better suited for the application.
hu3about 14 hours ago
Interesting pattern. This is specially nice to me:<p>&quot;No build steps, no preprocessors, no complex configs&quot;.<p>I worked on a project recently that followed this and Devs loved it. The DX was amazing.
评论 #44029811 未加载
fennecbuttabout 10 hours ago
Oh my god I have to share this with my php friend ahahaha.
lylejantzi3rdabout 13 hours ago
A lot of people here are comparing it to PHP, but it looks more like python to me.
andrewmcwattersabout 11 hours ago
Not really. That implies that you’re running each HTTPS call as a lifetime process that starts and ends with that request, and the entire body of the JavaScript file, beginning to end is HTML with subtrees of the document including optionally some JavaScript that is synchronously run.<p>Respectfully, this doesn’t look anything like that at all.
DonHopkinsabout 18 hours ago
PHP is a templating languages designed to be so inadequate that you have to implement other templating languages in it.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32961202">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32961202</a><p>&gt;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 &quot;simpler&quot; than PHP, so they came up with Smarty.<p>&gt;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.
评论 #44028128 未加载
评论 #44029586 未加载