Readit News logoReadit News
ndyg commented on Releasing Fjall 3.0   fjall-rs.github.io/post/f... · Posted by u/emschwartz
ndyg · 2 months ago
I'm using fjall v2 in the Rust event streaming store, cross.stream (`xs`) https://github.com/cablehead/xs

`xs` is for personal scale so fjall is fairly overkill performance-wise. marvin_j97's benchmark work and deep dives into different database systems is incredible though. Looking forward to updating to v3.

ndyg commented on Garage – An S3 object store so reliable you can run it outside datacenters   garagehq.deuxfleurs.fr/... · Posted by u/ibobev
lxpz · 3 months ago
If you know of an embedded key-value store that supports transactions, is fast, has good Rust bindings, and does checksumming/integrity verification by default such that it almost never corrupts upon power loss (or at least, is always able to recover to a valid state), please tell me, and we will integrate it into Garage immediately.
ndyg commented on Mock – An API creation and testing utility: Examples   dhuan.github.io/mock/late... · Posted by u/dhuan_
ndyg · 4 months ago
If you like lo-fi ways to attach cli commands to http end-points, you may also like:

- https://github.com/cablehead/http-nu or for POSIX - https://github.com/cablehead/http-sh

ndyg commented on Blinksy   play.putyourlightson.com/... · Posted by u/andersmurphy
sudodevnull · 5 months ago
Is this ANOTHER datastar mention at the top of hacker news? Who the fuck are these people? Seems like a cult
ndyg · 5 months ago
astroturf campaign?
ndyg commented on I switched from Htmx to Datastar   everydaysuperpowers.dev/a... · Posted by u/ksec
yxhuvud · 5 months ago
> if I had to go back to something lighter, I'd just go back to all in SSR with Rails

FWIW, default config of Rails include Turbo nowadays, which seems quite similar to Datastar in concept.

ndyg · 5 months ago
My understanding is Turbo is more aligned with htmx. Common practice in Turbo are generally patterns of last resort in Datastar.

e.g. Datastar prescribes a single long lived SSE endpoint that owns the state for the currently connected user's view of the world / app, while common practice in Turbo is to have many small endpoints that return a fragment of html when requested by the client.

ndyg commented on I switched from Htmx to Datastar   everydaysuperpowers.dev/a... · Posted by u/ksec
adlpz · 5 months ago
I may be just completely out of my depth here, but I look at the cool example on their website, the Open the pod bay doors, HAL bit, and I don't like it, at all.

And reading comments one would think this is some amazing piece of technology. Am I just old and cranky or something?

This feels... very hard to reason about. Disjoint.

You have a front-end with some hard-coded IDs on e.g. <div>s. A trigger on a <button> that black-box calls some endpoint. And then, on the backend, you use the SDK for your choice language to execute some methods like `patchElements()` on e.g. an SSE "framework" which translates your commands to some custom "event" headers and metadata in the open HTTP stream and then some "engine" on the front-end patches, on the fly, the DOM with whatever you sent through the pipe.

This feels to me like something that will very quickly become very hard to reason about globally.

Presentation logic scattered in small functions all over the backend. Plus whatever on-render logic through a classic template you may have, because of course you may want to have an on-load state.

I'm doing React 100% nowadays. I'm happy, I'm end-to-end type safe, I can create the fanciest shiny UIs I can imagine, I don't need an alternative. But if I needed it, if I had to go back to something lighter, I'd just go back to all in SSR with Rails or Laravel and just sprinkle some AlpineJS for the few dynamic widgets.

Anyway, I'm sure people will say that you can definitely make this work and organize your code well enough and surely there are tons of successful projects using Datastar but I just fail to understand why would I bother.

ndyg · 5 months ago
The preferred pattern addresses your concern about scattered logic: a single long-lived SSE endpoint that "owns" the user's view of the app. That endpoint updates their field of view as appropriate - very much inspired by game dev's immediate mode rendering.

I've a tutorial that demonstrates this with Nushell as the backend: https://datastar-todomvc.cross.stream

An interesting characteristic of Datastar: it's very opinionated about the shape of your backend but extremely unopinionated about how you implement that shape.

ndyg commented on Show HN: ut – Rust based CLI utilities for devs and IT   github.com/ksdme/ut... · Posted by u/ksdme9
pepa65 · 5 months ago
I was looking to try something like this (without the nushell...), but I find that I always have caddy installed anyway, and for the really local cases I use php -S.
ndyg · 5 months ago
I'm curious, what do you think is missing from Caddy that has you looking for something new?
ndyg commented on Show HN: ut – Rust based CLI utilities for devs and IT   github.com/ksdme/ut... · Posted by u/ksdme9
xpe · 5 months ago
I can understand why people would find `ut` convenient. That said, I would caution against trying to include too much functionality. What is too much? I don't have a clear idea on this yet.

But I would probably argue that including HTTP functionality is going too far. Why? Because there are already amazing tools dedicated to this already. On the client side, see `xh` [1]. On the server side, see `miniserve` [2]. Both have approximately 7K stars on GitHub.

It seems wiser to let specialized projects focus on a particular functional area; this is better for users and less work for maintainers.

[1]: https://github.com/ducaale/xh

[2]: https://github.com/svenstaro/miniserve

ndyg · 5 months ago
I maintain a Rust-based CLI HTTP server that embeds Nushell. It’s a handy little Swiss-army knife that’s replaced Nginx and Caddy for my personal projects.

You can serve a folder of static assets like this:

http-nu :3021 '{|req| .static "www" $req.path}'

https://github.com/cablehead/http-nu

ndyg commented on Dumb Pipe   dumbpipe.dev/... · Posted by u/udev4096
remram · 7 months ago
You can do this with ssh (and socat or mkfifo):

  # receiver
  socat UNIX-RECV:/tmp/foobar - | my-command

  # sender
  my-command | ssh host socat - UNIX-SENDTO:/tmp/foobar
You can relay through any other SSH server if your target is behind a firewall or subject to NAT (for example the public service ssh-j.com). This is end-to-end encrypted (SSH inside SSH):

  # receiver
  ssh top-secret@ssh-j.com -N -R ssh:22:localhost:22
  socat UNIX-RECV:/tmp/foobar - | my command

  # sender
  my-command | ssh -J top-secret@ssh-j.com ssh socat - UNIX-SENDTO:/tmp/foobar
(originally posted on the thread for "beam": https://news.ycombinator.com/item?id=42593135)

ndyg · 7 months ago
The approach you describe requires host to have an open ssh port you can access. quic + nat hole punching works around this.

u/ndyg

KarmaCake day52May 29, 2014
About
Hi, I'm @ndyg. I love tinkering and cobbling together Small Tools.

I make: https://stacks.cross.stream

I'd like to garden: https://ndyg.co

Tinkering: https://github.com/cablehead

Fascinated by cosy communities and good faith communication as tools, aiming to explore life's intricacies and uplift everyone's journey.

View Original