52 karma · joined May 29, 2014
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.
`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.
- https://github.com/cablehead/http-nu or for POSIX - https://github.com/cablehead/http-sh
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.
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.
You can serve a folder of static assets like this:
http-nu :3021 '{|req| .static "www" $req.path}'
When I'm working on a remote machine, it's nice to be able to easily pass things back and forth between it and my local laptop. I start a stream on the remote server and use `dumbpipe` to make the stream available on my local laptop.
```
# remote
xs serve ./store --expose :3001 ; dumbpipe listen-tcp --host 127.0.0.1:3001
# local
dumbpipe connect-tcp --addr 127.0.0.1:3001 <ticket>
$env.XS_ADDR ":3001" ; .cat
```
I can then do things like:
```
# local
cat local.file | .append local.file
# remote
.head local.file | .cas
```
Or register a local handler for the topic "pasteboard" that puts the contents on my local clipboard. Then, from the remote machine, I can run: `"foo" | .append pasteboard`
It's become my go-to tool for handling fiddly refactors. Here’s an example session from a Rust project where I used it to break a single file into a module directory.
https://gist.github.com/cablehead/f235d61d3b646f2ec1794f656e...
Notice how it can run tests, see the compile error, and then iterate until the task is done? Really impressive.
For reference, this task used ~100 credits
This excellent essay overlooked a '*':
* unless you are using bash + jq for your backend, in which case, JSON-formatted form bodies are quite reasonable.
Even when I don't think I'm attempting particular weird instructions!
https://github.com/hyperium/hyper-util/blob/v0.1.0/src/serve...
* The command line is amazing for fluidly exploring a data set or an automation task but an adhoc session can quickly spiral to the point it's no longer discernible or reusable. Is there a way you can keep that fluidity and instant feedback but introduce some structure to make things reusable? Also, to be able to return to an adhoc session and pick up where you left off?
* 'Use small tools' gets a lot of lip service, but systems are almost exclusively composed in monolithic ecosystems (for example, Golang, Python, Node). What would it look like to actually build a system using small tools? In my experiments it quickly gets unruly. Does it look better if we have a better way to compose shell scripts?
* Have you ever produced an interesting result in a shell session and thought, 'I just want this to run forever now' Is there a way to seamlessly take these adhoc sessions and then run them redundantly and robustly?
Tesla have sold people that the hardware they buy now will be capable of this in the future, but not now.