š Hello @burglar@txt.sour.is, welcome to txt.sour.is, a Yarn.social Pod! To get started you may want to check out the podās Discover feed to find users to follow and interact with. To follow new users, use the ⨠Follow button on their profile page or use the Follow form and enter a Twtxt URL. You may also find other feeds of interest via Feeds. Welcome! š¤
@prologic@twtxt.net correct type parameters. š
@mckinley@twtxt.net Haha, while composing I was wondering two or three times whether I should throw my thoughts in an HTML page instead. But out of utter laziness I discarded that idea. ĀÆ_(ć)_/ĀÆ
@prologic@twtxt.net Error handling especially in Go is very tricky I think. Even though the idea is simple, itās fairly hard to actually implement and use in a meaningful way in my opinion. All this error wrapping or the lack of it and checking whether some specific error occurred is a mess. errors.As(ā¦) just doesnāt feel natural. errors.Is(ā¦) only just. I mainly avoided it. Yesterday evening I actually researched a bit about that and found this article on errors with Go 1.13. It shed a little bit of light, but I still have a long way to go, I reckon.
We tried several things but havenāt found the holy grail. Currently, we have a mix of different styles, but nothing feels really right. And having plenty of different approaches also doesnāt help, thatās right. I agree, error messages often end up getting wrapped way too much with useless information. We havenāt found a solution yet. We just noticed that it kind of depends on the exact circumstances, sometimes the caller should add more information, sometimes itās better if the callee already includes what it was supposed to do.
To experiment and get a feel for yesterdayās research results I tried myself on the combined log parser and how to signal three different errors. Iām not happy with it. Any feedback is highly appreciated. The idea is to let the caller check (not implemented yet) whether a specific error occurred. That means I have to define some dedicated errors upfront (ErrInvalidFormat, ErrInvalidStatusCode, ErrInvalidSentBytes) that can be used in the err == ErrInvalidFormat or probably more correct errors.Is(err, ErrInvalidFormat) check at the caller.
All three errors define separate error categories and are created using errors.New(ā¦). But for the invalid status code and invalid sent bytes cases I want to include more detail, the actual invalid number that is. Since these errors are already predefined, I cannot add this dynamic information to them. So I would need to wrap them Ć la fmt.Errorf("invalid sent bytes '%s': %w", sentBytes, ErrInvalidSentBytes"). Yet, the ErrInvalidSentBytes is wrapped and can be asserted later on using errors.Is(err, ErrInvalidSentBytes), but the big problem is that the message is repeated. I donāt want that!
Having a Python and Java background, exception hierarchies are a well understood concept Iām trying to use here. While typing this long message it occurs to me that this is probably the issue here. Anyways, I thought, I just create a ParseError type, that can hold a custom message and some causing error (one of the three ErrInvalid* above). The custom message is then returned at Error() and the wrapped cause will be matched in Is(ā¦). I then just return a ParseError{fmt.Sprintf("invalid sent bytes '%s'", sentBytes), ErrInvalidSentBytes}, but that looks super weird.
I probably need to scrap the āparent errorā ParseError and make all three āsuberrorsā three dedicated error types implementing Error() string methods where I create a useful error messages. Then the caller probably could just errors.Is(err, InvalidSentBytesError{}). But creating an instance of the InvalidSentBytesError type only to check for such an error category just does feel wrong to me. However, it might be the way to do this. I donāt know. To be tried. Opinions, anyone? Implementing a whole new type is some effort, that I want to avoid.
Alternatively just one ParseError containing an error kind enumeration for InvalidFormat and friends could be used. Also seen that pattern before. But that would then require the much more verbose var parseError ParseError; if errors.As(err, &parseError) && parseError.Kind == InvalidSentBytes { ⦠} or something like that. Far from elegant in my eyes.
@prologic@twtxt.net can Yarn pods be consumers to other yarn pods?
@abucci@anthony.buc.ci I think so. IndieAuth is what Iām a big fan of. All Yarn pods are IndieAuth providers for example (if there are any concumsers out there, we have to work on a consumer ourselvesā¦)
Hi, I am playing with making an event sourcing database. Its super alpha but I thought I would share since others are talking about databases and such.
Itās super basic. Using tidwall/wal as the disk backing. The first use case I am playing with is an implementation of msgbus. I can post events to it and read them back in reverse order.

I plan to expand it to handle other event sourcing type things like aggregates and projections.
Find it here: sour-is/ev
@prologic@twtxt.net @movq@www.uninformativ.de @lyse@lyse.isobeef.org
Yarn #mtevilq Cut flowers in the room maybe, a proper bath not just shower and stationery in room @maya@maya.land
need to stay focussed @prologic@twtxt.net
Cringey to read over twtxts from me going back 2 years.
Hmm, @prologic@twtxt.net / @lyse@lyse.isobeef.org: Should we remove the section āTraditional Human-Readable Topicsā from the spec? Or mark is as deprecated? I havenāt seen this being used in the wild for years. š¤
@chronolink@chrono.tilde.cafe Replies are not part of the original twtxt format. They were added later as an extension by Yarn.social: https://dev.twtxt.net/doc/twtsubjectextension.html (only the section āMachine-Parsable Conversation Groupingā is used these days)
@prologic@twtxt.net Oh.. reading comprehension is strong today.. you went to US and now back.
@prologic@twtxt.net Hol-Up. You are state side now? Thatās a pretty big change!
@movq@www.uninformativ.de I usually only use eggs for baking or fry them for potatoes and spinach. @prologic@twtxt.net Why donāt you have them anymore? Did the fox get them all when the door didnāt close in time? ]:->
I will bid you goodnight twtxt
Goodnight twtxt - sleep well.
I am writing to you through the medium of twtxt.
Thursday morning, test to see if my twtxt works
@kubikpixel@thunix.net hellooo!!!! \o//
I realized my twtxt client isnāt validating what it pulls once it gets a valid response when a domain started returning js-heavy parking pages for every URL. Oops. Weekend project, I guess. š¤¦š»
So it happened - the twtxt.xyz domain finally expired
drops+ring #shaders #GLSL #shadertoy - https://www.shadertoy.com/view/NlsBD4
@novaburst@twt.nfld.uk Ah.. that is probably the XMPP verify code.. it doesnt really work that well. I aught to take it out.
@tkanos@twtxt.net Yep. https://twitter.com/jack/status/1510314535671922689
@mutefall@twtxt.net interesting.. were you working on one of the two universities that used it between 1989 and 1991?
#event Upcomming Meetup in Copennhagen: algolab(the_art_of_live_coding) @ StĆøberiet / Computer Klub 
hey @xuu@txt.sour.is iām trying to sort of get running your keyproofs thing on my hashbangās site root, but I get this:
Apr 01 02:55:25 de1 sour.is-keyproofs[9084]: 2:55AM ERR home/novaburst/keyproofs/main.go:73 > Application Failed error=": missing jid"
@prologic@twtxt.net yeah. For commercial use even. Just need to put an attribution note in the project README
started adding follows, decided to keep my list in the header here, hope it helps with discoverability and making new connections :)) #twtxt #community
maxlenght?, I found a workaround by writing from Goryon on mobile, on PC i can simply change the limit with the inspector but isn't it there for a reason?
@mckinley@twtxt.net Agreed! š
Can we all vote on the new default being 1024 then perhaps? š¤
+1 from me
@xuu@txt.sour.is So that means weāre allowed to use it right? š
@prologic@twtxt.net if we do adopt this one it is CC-BY from twitter. https://twemoji.twitter.com
@prologic@twtxt.net @ullarah@txt.quisquiliae.com I often see messages longer than what the textbox limit is, isnāt it limited by the maxlenght?, I found a workaround by writing from Goryon on mobile, on PC i can simply change the limit with the inspector but isnāt it there for a reason?
I too would like to express a bit more if possible, especially if i have to refer to users and link URLs and images for example, having a limit that isnāt too much of a limit is kind of pointless i think. š¤
@lyse@lyse.isobeef.org Excellent use of old denim, and also excellent use of long-form twt!
hello twtxt!!! tweeting with https://git.sr.ht/~noizhardware/twBao, still a work in progress :))
@adi@twtxt.net Also, I noticed you followed me on Twitter, but you might enjoy @anths if you want techie stuff instead of Oregon politics. š¤£
@novaburst@twt.nfld.uk I doubt there will ever be a 2.0 ⦠It may end up like java and they strip off the 1.
@ullarah@txt.quisquiliae.com works for me! A tricky bitmight be if it splits within a codeblock so markdown canāt parse
@ullarah@txt.quisquiliae.com Didnāt we talk about at some point a way to set the maximum height of te panels with some UX way to read the rest? š¤ Is that still on the cards or a bad ideas? š¤
#!/bin/sh
# Validate environment
if ! command -v msgbus > /dev/null; then
printf "missing msgbus command. Use: go install git.mills.io/prologic/msgbus/cmd/msgbus@latest"
exit 1
fi
if ! command -v salty > /dev/null; then
printf "missing salty command. Use: go install go.mills.io/salty/cmd/salty@latest"
exit 1
fi
if ! command -v salty-keygen > /dev/null; then
printf "missing salty-keygen command. Use: go install go.mills.io/salty/cmd/salty-keygen@latest"
exit 1
fi
if [ -z "$SALTY_IDENTITY" ]; then
export SALTY_IDENTITY="$HOME/.config/salty/$USER.key"
fi
get_user () {
user=$(grep user: "$SALTY_IDENTITY" | awk '{print $3}')
if [ -z "$user" ]; then
user="$USER"
fi
echo "$user"
}
stream () {
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
jq -r '.payload' | base64 -d | salty -i "$SALTY_IDENTITY" -d
}
lookup () {
if [ $# -lt 1 ]; then
printf "Usage: %s nick@domain\n" "$(basename "$0")"
exit 1
fi
user="$1"
nick="$(echo "$user" | awk -F@ '{ print $1 }')"
domain="$(echo "$user" | awk -F@ '{ print $2 }')"
curl -qsSL "https://$domain/.well-known/salty/${nick}.json"
}
readmsgs () {
topic="$1"
if [ -z "$topic" ]; then
topic=$(get_user)
fi
export SALTY_IDENTITY="$HOME/.config/salty/$topic.key"
if [ ! -f "$SALTY_IDENTITY" ]; then
echo "identity file missing for user $topic" >&2
exit 1
fi
msgbus sub "$topic" "$0"
}
sendmsg () {
if [ $# -lt 2 ]; then
printf "Usage: %s nick@domain.tld <message>\n" "$(basename "$0")"
exit 0
fi
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
user="$1"
message="$2"
salty_json="$(mktemp /tmp/salty.XXXXXX)"
lookup "$user" > "$salty_json"
endpoint="$(jq -r '.endpoint' < "$salty_json")"
topic="$(jq -r '.topic' < "$salty_json")"
key="$(jq -r '.key' < "$salty_json")"
rm "$salty_json"
message="[$(date +%FT%TZ)] <$(get_user)> $message"
echo "$message" \
| salty -i "$SALTY_IDENTITY" -r "$key" \
| msgbus -u "$endpoint" pub "$topic"
}
make_user () {
mkdir -p "$HOME/.config/salty"
if [ $# -lt 1 ]; then
user=$USER
else
user=$1
fi
identity_file="$HOME/.config/salty/$user.key"
if [ -f "$identity_file" ]; then
printf "user key exists!"
exit 1
fi
# Check for msgbus env.. probably can make it fallback to looking for a config file?
if [ -z "$MSGBUS_URI" ]; then
printf "missing MSGBUS_URI in environment"
exit 1
fi
salty-keygen -o "$identity_file"
echo "# user: $user" >> "$identity_file"
pubkey=$(grep key: "$identity_file" | awk '{print $4}')
cat <<- EOF
Create this file in your webserver well-known folder. https://hostname.tld/.well-known/salty/$user.json
{
"endpoint": "$MSGBUS_URI",
"topic": "$user",
"key": "$pubkey"
}
EOF
}
# check if streaming
if [ ! -t 1 ]; then
stream
exit 0
fi
# Show Help
if [ $# -lt 1 ]; then
printf "Commands: send read lookup"
exit 0
fi
CMD=$1
shift
case $CMD in
send)
sendmsg "$@"
;;
read)
readmsgs "$@"
;;
lookup)
lookup "$@"
;;
make-user)
make_user "$@"
;;
esac
ssh client, because that's me, no-matter where I am. The only exception to this rule is I usually create a separate key for any "work" / " company" I am a part of.
@prologic@twtxt.net I have seen single use keys that are signed by a central PKI .. Keybase has one that uses a chatbot to generate the keys on the fly.
It just comes down to your threat model :)
ssh client, because that's me, no-matter where I am. The only exception to this rule is I usually create a separate key for any "work" / " company" I am a part of.
@prologic@twtxt.net for shame! lol me too.
@prologic@twtxt.net yarn builds in 1.18!
@prologic@twtxt.net Re: Chat system, What if the base specification included a system for per-user arbitrary JSON storage on the server? Kind of like XEP-0049, but expanded upon. Two kinds of objects: public and private. Public objects can be queried by anyone, private objects cannot and must be encrypted with the userās private key. Public keys could be stored there, as well as anything else defined by extensions. Roster, user block list, avatar, etc.
@prologic@twtxt.net hmm so each individual feed on your pod subās my feed? Wouldnāt that flood your server for each post?
#makeartnotwar #GLSL #shaders code at https://www.shadertoy.com/view/fs2fRm if you want to use it
