Hacker Newsnew | past | comments | ask | show | jobs | submit | leoedin's commentslogin

It's a shame isn't it! The public must be protected from the backwards thoughts of history. In case they misuse it.

I guess what they're really saying is "we don't want you guys to cancel us".


i think it's fine, thank these people for coming up with the idea and people are going to start doing this in their basement then releasing it to huggingface

I think the parent's point is that when you have a react front-end, your back-end basically just deals in structs of data. There's no HTML or templating to think about. It's just JSON-serialisable structs. That makes the code on the back end much simpler, which makes it easier to run in a resource-constrained environment.

The only exposure the back-end has to HTML is streaming the static files to the browser. Which can be done in small chunks.

If your back-end is rendering HTML with every request, it has to do a lot more work. It has to load HTML templates into memory and insert strings into them.


Okay, so how do you actually show the stuff to the end user?

Just raw structs of data? Or do you turn that back into HTML?

Now you've got two sets of templates to cope with...

Why would I care about how much effort it is for the server to generate? It's already generating HTML from templates, and it's more-or-less infinitely capable of doing so.


> It has to load HTML templates into memory and insert strings into them.

In practice, I doubt this is much slower than serializing JSON. Keeping a couple kilobytes of HTML templates in memory is nothing. Conversely, running a whole vdom on the frontend (typically more resource-constrained than the server) is a much bigger performance issue.


Three levels down and people have entirely forgotten what my post was. My "server" is some anemic ARM core built into real physical hardware with 64M of read-only storage. I don't want it spending its time "hydrating" some DOM, I don't want to bring any of this frontend insanity on there at all. No code hosted on npm shall ever run on that processor or I can't go to sleep in peace.

So how do we still get a fancy SPA website? Build it all down to a simple zip bundle, the ARM can serve those static files just fine. The SPA talks to the ARM via a few JSON APIs. Very nice clean boundary.


Yes, if your server is a weak, limited processor, you want to keep the demands on it as low and lean as possible, and let the client do the heavy lifting. HTMX is not a good fit for this scenario, just like PostgreSQL is not a good database to embed on your devices.

This isn't a controversial idea and nobody would try to sell you on HTMX for your use case.


1. No, templating strings is actually quite cheap. I'm doubtful that you could benchmark any substantial difference between templating html and serializing json.

2. Who has a server with a weak, limited processor? HTML templates power Django, Rails, and PHP. This paradigm worked fine on the servers of 20 years ago, in the slowest languages we use. I could serve a Django app on my phone and see reasonable performance.


I agree that templating is very fast and efficient, probably faster than serializing to JSON.

Read the OP's posts - he is talking about a "server" being an embedded device with 64mb of read-only storage. My assumption is that the data output format is basically hard-coded in the device's OS and doesn't even rely on JSON serialization.


Oh wait, oh my god

> Three levels down and people have entirely forgotten what my post was.

I missed this reply entirely. Whoops.

That said, I do feel like you can do HTML templates on a tiny chip with 64 megs of memory. I've seen NASes with comparably tiny & terrible chips serve their web UIs this way: paper-thin html templates with <form>s for interactivity and <table>s for layout.


But that's the point of something like HTMX, though.

You draw a simple web page with very basic elements, tag them with an HTMX element, and let the client side javascript turn that into something that "does stuff".

I wrote a phone directory with find-as-you-type using Django (because it's what I had lying around) and HTMX (because I read somewhere that it was cool and fun and I should try it, and I bow easily to peer pressure), and then min.css to make it not look shit.

All totally vendored, just download the appropriate .js and .css file and check them into your source control.

When you type it hits an endpoint that returns a bit of HTML that contains a table, and swaps it into a div. The querying part and the drawing part is client-side and there's nothing stopping you passing a query string to the endpoint and getting just a bare table out.

Indeed there's nothing stopping you detecting if it's an HTMX request and only returning the fragment, or if it's "bare" returning a full valid page. You know what? I should do that, I'll log a feature request on my project for it.

I've gotten a little away from the original point.

You use HTMX on the client side, to turn a plain HTML page with no interactivity into something that will pull data from a backend and swap it into the DOM. If you want to return JSON and render that with yet another library you can, but you're probably already filling in the blanks in an HTML template as it is.


My understanding is that HTML templating is often cheaper server-side than JSON serialization.

What's npm got to do with it?

Why can't your code fill in the blanks in some HTML template instead of filling in the blanks in some JSON?


What's the difference between rendering HTML and rendering JSON?

Why are you then offloading rendering HTML from JSON to a painfully slow scripting language on the client?


This is plain false.

Yeah, I’ve been working mainly in rust for the last few years. The compile time checks are so effective that run time bugs are rare. Like you can refactor half the codebase and not run the app for a week, and when you do it just works. I’ve never had that experience in other languages.

> It's the Western companies that actually come up with the original idea, whatever good that does them.

I think that's a dangerous assumption to make. Certainly it's true that for most major technologies so far, western countries were first - but that's probably mainly because China's been busy playing catch up. But now the Chinese have huge numbers of factories, suppliers big and small, machine shops, PCB fabs and experienced engineers. You really think they're not coming up with original ideas?

Any engineer will tell you a new product is a little bit of idea and a lot of execution. The Chinese are able to execute in a way that the west isn't any more.


His other hobby is anaesthesia?

Maybe a young child that naps in the day? That doesn’t really give a whole free afternoon though. 2 hours at best.


Or family is the cat.


I don’t think I’ve met anyone in the UK who routinely checked tripadvisor for anything!

I just checked a few local restaurants to me in London that opened in the last few years, and the ratio of reviews is about 16:1 for google maps. It looks like stuff that’s been around longer has a much better ratio towards trip advisor though.

Almost certainly Instagram/tiktok are though. I know a few places which have been ruined by becoming TikTok tourist hotspots.


Not in the UK, but from Romania, I last checked Tripadvisor back in 2012, and that was for a holiday stay in the Greek islands. Google Maps has eaten the lunch of almost all of the entrants in this space, and I say that having worked for a local/Romanian "Google places"-type of company, back in 2010-2012 (after which Google Places came in, ~~stole~~ scrapped some of our data and some of our direct competitor's data and put us both out of that business).


I'd be curious to read that whole story of Google putting the conpany out of business. Would you consider writing about it in a post?

'I don’t think I’ve met anyone in the UK who routinely checked tripadvisor for anything!'

Counterpoint: I have met people in the UK who's lives revolve around doing nothing but.


I see a lot of Google adverts for AI that seems to be “look, you can translate your photo into a sci-fi world”.

Which is cool, I guess. But it doesn’t feel like a very valuable thing to an end user. That kind of thing is mostly valuable because it’s hard. If anyone can do it, nobody cares any more.

I am really excited about AI in some use cases. Using the latest models for agentic software development is truly magic. But “make a funny video of yourself as Mickey Mouse” just seems kind of naff.


Gas turbine power generation is already a thing. For example 20% of UK grid power right now comes from "combined cycle gas turbines" - which are a very efficient way to turn natural gas into electricity. They've solved the noise issue for those plants.


Um, noise mitigation is still an issue at existing gas plants (e.g., [0-3]) and often only partially dealt with by local regulations, and this group are claiming their engine is substantially different, supersonic vs subsonic, and crossing that threshold usually involves large noise generation effects.

[0] https://aercoustics.com/blog/noise-vibration-gas-turbine-cog...

[1] https://www.powermag.com/major-noise-sources-and-mitigation-...

[2] https://www.turbomachinerymag.com/view/noise-levels-at-energ...

[3] https://turbinelogic.com/enc/cog-gt-units/regulatory-safety-...


They’ve been a Scottish thing for at least 15 years! Source: I ate one in Edinburgh 15 years ago.

Scotland is the home of deep frying things that have no right to be deep fried. My English friends are alarmed when I tell them of the “half pizza and chips” we used to have for lunch. Half a deep fried pizza, that is.


My dilemma as a student in Glasgow (a long time) at the start of term when I had some money, Fish supper or deep fried Pizza & chips. With the mandatory bottle of Irn Bru.

Delicious but excessive consumption would certainly reduce your life expectancy.


Deep-fried pizza is originally an Italian thing ("pizza fritta") and would have entered Scottish cuisine through the Italian community (https://en.wikipedia.org/wiki/Italian_Scots). It's become its own thing now - a pizza crunch doesn't really resemble a pizza fritta - but it's originally Italian


You paid $2-3k for an x200? Was that a long time ago? Is that the same laptop that's sold by computer recyclers for $100?


No, for an X2100. The chassic with the new parts already fitted.

E.g.

https://www.xyte.ch/shop/x2100-pricing/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: