My latest Unix tooling abuse/creation.
I’m defining a alias command for Jujutsu:
parent-add = ["util", "exec", "--", "bash", "-c", '''
set -euo pipefail
source <(
nix run nixpkgs#argc -- --argc-eval /dev/stdin "$@" << EOF
# @option -r=@ Commit to modify
# @option -d Parent to add
# @arg parent Parent to add (positional version)
EOF
)
commit=${argc_r}
new_parent=${argc_d:-${argc_parent:-}}
if [ -z ${commit:-} ]; then
>&2 echo "Must provide a commit to rebase"
exit 1
fi
if [ -z ${new_parent:-} ]; then
>&2 echo "Must provide a new parent"
exit 1
fi
jj rebase -s "${commit}" -d "${commit}-" -d "${new_parent}"
''', ""]
which is like an shell script wrapped in a toml config file. Since the alias is executed as bash -c <...> it does not have an usable $0. So I’m using a heredoc passed via /dev/stdin 🤷 .
This works:
> jj parent-remove -h
USAGE: stdin [OPTIONS] [PARENT]
ARGS:
[PARENT] Parent to remove (positional version)
OPTIONS:
-r <R> Commit to modify [default: @]
-d <D> Parent to remove
-h, -help Print help
-V, -version Print version
Software design is like origami. You start with an empty and unconstrained state, and every move (fold) gives you more features which makes new moves possible and some other impossible. So the game is to find a long sequence of folds that gives you the most desirable shape somewhere in the exponential and infinite space of all possible combination of moves. And that’s very hard and often requires going back and taking an alternative route, while the real world pressure swould prefer you to always keep folding whatever you have further…
What if we had:
io fn foo() {
}
in Rust, just like async fn. This would mean the function can block. Compiler could warn when it is called from async code. Initially it would be a lint, but down the line it could be switched to enforce that only io functions can call other io functions.
dpc, one question about searching for a node or id on Iroh/rostra:
So my id here is rsut5j319xfrsr8ud3rgua8nmxm6kegcjjggijc6te5ein4tyjw8my
I understand its some ed25xx public key, which is some 64 bit number.
Using just this id, anyone can find this ‘user’ on the Iroh network, if I understand this correctly.
Then, my question is, lets say I only had the first 32 bits of this id, would I be able to find this user or endpoint on the Iroh/rostra network?
You should just check my best Rustlang memes. I’m very proud of them. 😀
I’m just going to live this one pointing at r/rustjerk.
Ehhh… I need to implement video handling so it can be shared over Rostra directly: