Better HN
topnewbestaskshowjobs
Log inSign up

andersmurphy

1,011 karma · joined Feb 22, 2019 (7y ago) · 496 submissions

https://andersmurphy.com
Submissions

comment 1y ago · link · parent

A VPS, caddy, sqlite and livestream is really all you need in my experience. Help's if your language has decent support for real and green threads (java/go/clojure).

comment 1y ago · link · parent

Because most of vscode is not open source. See the python lsp, copitlot, plugin store, the fact that it's practically impossible to turn off telemetry/tracking. Gradually more and more of the actual value, is being moved into these proprietary systems and plugins to the point where vscode is really just an open source shim. In fact the vscode binary running on your machine does not have an MIT licence.

For now that's fine as it's mainly an on-ramp for Azure. But, if Windows is anything to go by, I imagine the enshitification of vscode is inevitable given enough time.

comment 1y ago · link · parent

I mean the reactions to posts on HN when a developer dares to make their OSS/MIT project sustainable by adding paid extensions is part of the problem. Almost to the point where I believe most developers are acting in the interest of the large corperations by bullying OSS developers into keeping their work free as in gratis.

The same people lose their minds if a project is GPL or copyleft.

comment 1y ago · link · parent

Yeah probably just haven't got round to it and don't use enough signals.

comment 1y ago · link · parent

If you're using vscode your going to experience one of the biggest rug pulls in history (even more so if you're using copilot). I mean wasn't copilot free until recently?

Developers are idiots (I include myself in that). The industry is myopic and completely driven by fashion.

comment 1y ago · link · parent

You don't need to pay for datastar. As I've said befor I don't use any of the pro plugins (plugins anyone can build themselves for that matter).

Sad to see developers getting ripped off by AI. Copilot is junk. The whole AI bubble is just a tax powered by fear of missing out. Save yourself 20$ a month, learn to touch type, use snippets and download a local copy of the docs.

comment 1y ago · link · parent

Yeah so that was how I used to think about these things. Now, I'm. less into the fine grain user updates too.

Partly, because the minute you have a shared widget across users 50%+ of your connected users are going to get an update when anything changes. So the overhead of tracking who should update when you are under high load is just that, overhead.

Being able to make those updates corse grain and homogeneous makes them easy to throttle so changes are effectively batched and you can easily set a max rate at which you push changes.

Same with diffing, the minute you need to update most of the page the work of diffing is pure overhead.

So in my mind a simpler corse grain system will actually perform better under heavy load in that worst case scenario somewhat counter intuitively. At least that's my current reasoning.

comment 1y ago · link · parent

The whole OSS support model people are suggested Datastar adopt is bad as it actively encourages you to write less good software so you can offer paid support.

comment 1y ago · link · parent

It's wild this comment is getting downvotes.

comment 1y ago · link · parent

Four. Pretty funny.

https://news.ycombinator.com/item?id=45536000 https://news.ycombinator.com/item?id=45536618 https://news.ycombinator.com/item?id=45537372

comment 1y ago · link · parent

As a Datastar user who uses the free version I don't want the Pro features to be made free as they would just add bloat to the bundle. It's already borderline massive at 10-11kb. Like preact is 3kb.

comment 1y ago · link · parent

I can't even imagine the drama if it was made free but GPL.

comment 1y ago · link · parent

Yeah Pro is a terrible name.

comment 1y ago · link · parent

Expensive queries on the server should be shared where they can be (eg: global leaderboard) or cached on the server (in the game of life demo each frame is rendered/calculated once, regardless of the number of users). Rendering the whole view gives you batching for free and you don't have to have all that overhead tracking what should be updated or changed. Fine grained updates are often a trap when it comes to building systems that can handle a lot of concurrent users. It's way simpler to update all connected users every Xms whenever something changes.

comment 1y ago · link · parent

So even though HTTP/2 multiplexes each request over a single TCP connection, each HTTP connection is still compressed separately. Same with keep alive.

The magic is brotli/zstd are very good at streaming compression thanks to forward/backward references. What this effectively means is the client and the server share a compression window for the duration of the HTTP connection. So rather than each message being compressed separately with a new context, each message is compressed with the context of all the messages sent before it. What this means in practice is if you are sending 140kb of divs on each frame, but only one div changed between frames, then the next frame will only be 13bytes because the compression algorithm basically says to the client "you know that message I sent you 100ms ago, well this one is almost identical apart from this one change". It's like a really performant byte level diffing algorithm, except you as the programmer don't have to think about it. You just re-render the whole frame and let compression do the rest.

In these demos I push a frame to every connected client when something changes at most every 100ms. What that means, it effectively all the changes that happen in that time are batched into a single frame. Also means the server can stay in charge and control the flow of data (including back pressure, if it's under to much load, or the client is struggling to render frames).

comment 1y ago · link · parent

Yeah the server only sends what the user is currently looking + plus a buffer around their view. There's no actual checkbox state on the client. When the user clicks a checkbox a depress animation is started and a request is made (which the server responds to with no data and a 204). The user then gets the html for the next view down a long lived SSE connection that started when they first loaded the page. Because, there's a long lived connection, it has really good compression. Same thing happens when the user scrolls. If they scroll far enough a new view is rendered.

The billion items themselves are just in a server on the backend, stored in a sqlite database.

comment 1y ago · link · parent

Yup for initial load. But the subsequent interactions which each require a network hop and send down the whole page are lightening fast.

Because once that connection is primed you are off to the races.

comment 1y ago · link · parent

If your data model is open and not closed you only need to change the location you are changing. This is how the internet works. Types that don't support this model actively hinder refactoring.

comment 1y ago · link · parent

Yeah it assumes your building a full stack app driven by the backend. So the client and backend are tightly coupled and built for each other.

comment 1y ago · link · parent

Yeah. That's the real rug pull all my code is in Clojure. Which is rough if you're not familiar with reading lisp.

There's a few examples in typescript and go floating around.

Here's one:

https://github.com/Mortalife/datastar-chat-example-ts

comment 1y ago · link · parent

If the datastar team was capable of such a coordinated marketing effort I doubt they'd be in the business of running a non profit, or building a niche HTML streaming framework. Or having a one off purchase model for pro.

I mean unless you consider me linking my dumb demos everytime someone accuses hypermedia of not being suitable for realtime/collaborative apps. That I'm 100% guilty of.

comment 1y ago · link · parent

How much do you pay big tech for your LLM subscriptions monthly? I'm really curious.

299$ lifetime which includes future features seems like a steal. I bought it and don't use it, but I'm excited to see what comes next.

comment 1y ago · link · parent

Same people who complain about GPL and other copy left licenses I imagine.

comment 1y ago · link · parent

Because turbo stimulus doesn't let you build a multiplayer spreadsheet performantly and realtime in a few hundred lines of code.

comment 1y ago · link · parent

100% so many projects have died because they didn't have a longterm plan to keep the lights on other than hoping for donations and or offering support that no one needed (the better the project the less likely you need support).

comment 1y ago · link · parent

Yeah it's a weird one people complain about open source projects having extra features you can pay for. But, then they also complain when you make open source GPL.

I'm sure it would be the same group complaining if it was GPL too.

comment 1y ago · link · parent

Yeah support model for a lit of projects like this doesn't work. Even companies like the one behind NATS struggle. It's almost contingent on you building a bad product that needs support.

comment 1y ago · link · parent

Those prices are for one off lifetime purchase too! That's crazy. I don't know why they bother. They'll never make back the money for the time they put in developing it.

Such a bad move. I told them they should charge more and actually have useful features in pro.

comment 1y ago · link · parent

Try my demo [1] on 3G slow. It works fine.

Turns out brotli compression does wonders.

[1] https://checkboxes.andersmurphy.com

1
111213
17