Me: “uughh I wish Go had code generation macros, I need to do a whole pile of tedious implementations”
Also me: “Wait, I have an idea. Hold my beer!”
30 minutes later:
#!/bin/sh
#
# Me: Can we have code generation macros?
# Go: We have macros at home
# The code generation macros at home:
#
# Implements MarshalBinary on top of AppendBinary
marshal_binary_append() {
cat <<EOF
// MarshalBinary is equivalent to calling AppendText(nil)
func (v $1) MarshalBinary() ([]byte, error) {
return v.AppendBinary(nil)
}
EOF
}
# Implements (Append/Marshal/Unmarsha)lBinary for one byte structures
marshal_binary_byte() {
marshal_binary_append $1
cat <<EOF
// Appends the single-byte binary representation of $1 to buf
func (v $1) AppendBinary(buf []byte) ([]byte, error) {
return append(buf, byte(v)), nil
}
// Unmarshals $1 from a single-byte buffer
func (v *$1) UnmarshalBinary(buf []byte) error {
if len(buf) != 1 {
return errors.New("expected 1 byte input for UnmarshalBinary on $1")
}
*v = $1(buf[0])
return nil
}
EOF
}
exec >marhsal.gen.go
echo '// Generted by gen/marshal.sh. DO NOT EDIT.'
echo 'package foo'
echo ''
...
marshal_binary_append Foo
...
... Though I'm not sure of how wise it is to just pass AS2 through these days with how several protocol extensions assume it was crafted by the server, though
The nice thing about being one’s own ISP is that when someone else fucks up their network and congests one of their links so bad the roundtrip latency goes up by 200ms, you can just write your own fucked up BGP traffice engineering filter rules to route around the congestion
@lanodan@chjara by the 24th century Yorkshire has been annexed by France. Somehow everyone has French names now but still speaks with a Yorkshire drawl
@vyr@tobi You run the TypeScript compiler on the codebase and it throws a few thousand typing errors (but compiles anyway??)
The frontend in particular seems to be a tangled pile of soup.
And most of the forks are hard-forks of Misskey 12 so they can’t just pull things from upstream; everything has to be done from scratch, and the few developers with experience on the codebase are spread across four projects these days.
I'd kinda like a good 2in1/convertable laptop/tablet. 13"ish, lightweight, probably Intel (since the Linux driver situation with AMD laptops still seems to be quite variable), doesn't need to be massively high performance
Somewhat ambivalent between detachable and fold back keyboard
At most places I'll order something "sehr scharf" and it'll be less spicy than British mild :(((
(And then you finally find the rare place which does actual spice and order "sehr scharf" and your head gets blown off because you've lost your spice tolerance)
@izaya 2.5g is cheap and I imagine Realtek 2.5G MAC-PHY combinations are very cheap
And it's not DoA, it's new and gaining ground because it's the fastest you can run over Cat5E. In particular it's becoming common for feeding wireless access points without having to pull fiber
immigrant | they/them | software engineer in card paymentsliker of ISO 8583, the 8051, ASN.1 and EBCDIC.I wrote the ActivityPub initial draft, so this social network is in some way my fault.Formerly @erincandescent@queer.af Instance admin, queer.af (2018-07 - 2024-02, RIP)