@prologic@twtxt.net This person isn’t particularly happy with this study:
https://mastodon.social/@grimalkina/114717549619229029
I don’t know enough about these things to form an opinion. 🫤 I sure wish it was true, though. 😅
I did a “lecture”/“workshop” about this at work today. 16-bit DOS, real mode. 💾 Pretty cool and the audience (devs and sysadmins) seemed quite interested. 🥳
- People used the Intel docs to figure out the instruction encodings.
- Then they wrote a little DOS program that exits with a return code and they used uhex in DOSBox to do that. Yes, we wrote a COM file manually, no Assembler involved. (Many of them had never used DOS before.)
- DEBUG from FreeDOS was used to single-step through the program, showing what it does.
- This gets tedious rather quickly, so we switched to SVED from SvarDOS for writing the rest of the program in Assembly language. nasm worked great for us.
- At the end, we switched to BIOS calls instead of DOS syscalls to demonstrate that the same binary COM file works on another OS. Also a good opportunity to talk about bootloaders a little bit.
- (I think they even understood the basics of segmentation in the end.)
The 8086 / 16-bit real-mode DOS is a great platform to explain a lot of the fundamentals without having to deal with OS semantics or executable file formats.
Now that was a lot of fun. 🥳 It’s very rare that we do something like this, sadly. I love doing this kind of low-level stuff.
pledge()
and unveil()
syscalls:
@lyse@lyse.isobeef.org Multi-Threading. Is. Hard. 🤯 And yes, that blog is great. 👌
pledge()
and unveil()
syscalls:
On today’s research journey on pledge(…)
/unveil(…)
/landlock/capabilities I came across the great EWONTFIX blog, in particular this article here: https://ewontfix.com/17/ Super interesting.
@aelaraji@aelaraji.com awww :(((
think i’m gonna use this license on my git repos going forward. it kicks ass https://anticapitalist.software/
@lyse@lyse.isobeef.org Not intended as a vampire thing, at least not this time. 😅 His canine teeth are usually one pixel long, when visible, but on this one, he’s making a face, that makes them more exposed.
Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
@lyse@lyse.isobeef.org lol – I explicitly kept them in there so that the code is easier to understand for non-Rust people 🤪😂
@prologic@twtxt.net Bon voyage! I hope you’ll find some well-needed rest.
Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
@movq@www.uninformativ.de All the return
s tell me that you’re not a real Rust programmer. :-D Personally, I would never omit them either. They make code 100 times more readable.
@movq@www.uninformativ.de Yeah, not too bad. I completely agree with you on completeness. Also, I hate complexity without having to learn that during on-calls. :-)
Finally, the two drawers are mounted on the workbench. Some kind of a lid board on top to keep the dust out is still missing. I also gotta build the drawer inserts for the saws.
I upcycled decades old table football aluminium pipes to become my handles. The spacers are made from the inner tube. Two minutes of handsanding with 400 grit sandpaper polished it up nicely.
Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
@movq@www.uninformativ.de Yeah pretry much 🤣
Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
@prologic@twtxt.net I’d say: Yes, because in Go it’s easier to ignore errors.
We’re talking about this pattern, right?
f, err := os.Open("filename.ext")
if err != nil {
log.Fatal(err)
}
Nothing stops you from leaving out the if
, right? 🤔
@movq@www.uninformativ.de I’m feeling SO dumb right now 😅 I used to think !!
was a sudo
argument and never used it out of that context! Thanks for the $(!!)
tip 🤘
@kat@yarn.girlonthemoon.xyz Always do 🤣
Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
@movq@www.uninformativ.de Is this much different to Go’s error handling as values though really? 🧐🤣😈
@movq@www.uninformativ.de Agree! Good list 👌
Saw this on Mastodon:
https://racingbunny.com/@mookie/114718466149264471
18 rules of Software Engineering
- You will regret complexity when on-call
- Stop falling in love with your own code
- Everything is a trade-off. There’s no “best” 3. Every line of code you write is a liability 4. Document your decisions and designs
- Everyone hates code they didn’t write
- Don’t use unnecessary dependencies
- Coding standards prevent arguments
- Write meaningful commit messages
- Don’t ever stop learning new things
- Code reviews spread knowledge
- Always build for maintainability
- Ask for help when you’re stuck
- Fix root causes, not symptoms
- Software is never completed
- Estimates are not promises
- Ship early, iterate often
- Keep. It. Simple.
Solid list, even though 14 is up for debate in my opinion: Software can be completed. You have a use case / problem, you solve that problem, done. Your software is completed now. There might still be bugs and they should be fixed – but this doesn’t “add” to the program. Don’t use “software is never done” as an excuse to keep adding and adding stuff to your code.
Okay, here’s a thing I like about Rust: Returning things as Option
and error handling. (Or the more complex Result
, but it’s easier to explain with Option
.)
fn mydiv(num: f64, denom: f64) -> Option<f64> {
// (Let’s ignore precision issues for a second.)
if denom == 0.0 {
return None;
} else {
return Some(num / denom);
}
}
fn main() {
// Explicit, verbose version:
let num: f64 = 123.0;
let denom: f64 = 456.0;
let wrapped_res = mydiv(num, denom);
if wrapped_res.is_some() {
println!("Unwrapped result: {}", wrapped_res.unwrap());
}
// Shorter version using "if let":
if let Some(res) = mydiv(123.0, 456.0) {
println!("Here’s a result: {}", res);
}
if let Some(res) = mydiv(123.0, 0.0) {
println!("Huh, we divided by zero? This never happens. {}", res);
}
}
You can’t divide by zero, so the function returns an “error” in that case. (Option
isn’t really used for errors, IIUC, but the basic idea is the same for Result
.)
Option
is an enum. It can have the value Some
or None
. In the case of Some
, you can attach additional data to the enum. In this case, we are attaching a floating point value.
The caller then has to decide: Is the value None
or Some
? Did the function succeed or not? If it is Some
, the caller can do .unwrap()
on this enum to get the inner value (the floating point value). If you do .unwrap()
on a None
value, the program will panic and die.
The if let
version using destructuring is much shorter and, once you got used to it, actually quite nice.
Now the trick is that you must somehow handle these two cases. You must either call something like .unwrap()
or do destructuring or something, otherwise you can’t access the attached value at all. As I understand it, it is impossible to just completely ignore error cases. And the compiler enforces it.
(In case of Result
, the compiler would warn you if you ignore the return value entirely. So something like doing write()
and then ignoring the return value would be caught as well.)
@movq@www.uninformativ.de Ewww 😈
We really are bouncing back and forth between flat UIs and beveled UIs. I mean, this is what old X11 programs looked like:
https://www.uninformativ.de/desktop/2025%2D06%2D21%2D%2Dkatriawm%2Dold%2Dxorg%2Dapps.png
Good luck figuring out which of these UI elements are click-able – unless you examine every pixel on the screen.
@prologic@twtxt.net have fun!
@prologic@twtxt.net Enjoy your road trip! Have fun!! 🤘
@bender@twtxt.net Ahh I see hmmm I don’t know this either 🤣
@kat@yarn.girlonthemoon.xyz I might give it a shot. 😃
Skimming through the manual: I had no idea that keeping the “up” cursor pressed actually slows you down at some point. 🤦
@aelaraji@aelaraji.com I use Alt+.
all the time, it’s great. 👌
FWIW, another thing I often use is !!
to recall the entire previous command line:
$ find -iname '*foo*'
./This is a foo file.txt
$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.
Yep!
Or:
$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied
$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root 60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root 0 Jun 20 19:39 nothing-to-see
@thecanine@twtxt.net With the teeth this looks like a vampire dog. :-D And I don’t get the reference either.
@aelaraji@aelaraji.com Oh, that’s great! I haven’t heard about any of them before either. There’s also a caveat though, that I ran right into the very first time I tried this in zsh:
$ ls > /dev/null
$ echo $_
--color=tty
Yeah, exactly what you think:
$ which ls
ls: aliased to ls --color=tty
Alt+.
is going to be my favorite one! In the above, it would also give me /dev/null
, which might be probably more what I would expect.
@prologic@twtxt.net no, good man. Follow the link, follow eet! :-)
@movq@www.uninformativ.de omg yeah! this one looks cute too (i’m weak to anything tux related!) but the commercial release has so much unpolished charm i love it! btw it’s on [internet archive(https://archive.org/details/TuxRacerCD) if you wanna download & play it :]
@kat@yarn.girlonthemoon.xyz I like the animations in your version much better than the ones from ExtremeTuxRacer. 😊 And there’s no little dance at the end of a race!
@aelaraji@aelaraji.com You mean Control R?
katseye does telenovela: the MV https://www.youtube.com/watch?v=CjnB56tSCQI
@bender@twtxt.net I SANG ALONG IN MY HEAD LMAOOO
@kat@yarn.girlonthemoon.xyz I guess that qualifies as an “Arch moment”, albeit the first one I encountered. I’m running this since 2008 and it’s usually very smooth sailing. 😅
@lyse@lyse.isobeef.org Yeah, YMMV. Some games work(ed) great in Wine, others not at all. I just use it because it’s easier than firing up my WinXP box. (I don’t use Wine for regular applications, just games.)
@bender@twtxt.net Now I AM curious! What rabbit-hole? what am I missing here? 😆
Just discovered how easy it is to recall my last arg in shell and my brain went 🤯 How come I’ve never learned about this before!? I wonder how many other QOL shortcuts I’m missing on 🥲
@kat@yarn.girlonthemoon.xyz 🎵 Grafana ana bo bana fifo bo bana gra fana!🎶 Don’t mind me, I am nuts.
@kat@yarn.girlonthemoon.xyz I recommend you to remain curious without crossing the threshold. Unless, of course, you truly want to follow a never-ending rabbit hole. 😂
@aelaraji@aelaraji.com i’ve been curious about searxng!!!
@lyse@lyse.isobeef.org as long as i get to see silly little tux sliding around in a silly game older than me it’s ok even if i committed windows/wine crimes to see it <33
@movq@www.uninformativ.de Must be a decode ago that I last used Wine. I wanted to play GTA2, but that didn’t go as planned.
@movq@www.uninformativ.de And there the air raid siren goes off.
is my desktop cute yes or yes
@kat@yarn.girlonthemoon.xyz Oh no, how unpenguinly! But at least it runs, even races. :-)
pledge()
and unveil()
syscalls:
@movq@www.uninformativ.de That sounds great! (Well, they actually must have recorded the audio with a potato or so.) You talked about pledge(…)
and unveil(…)
before, right? I somewhere ran across them once before. Never tried them out, but these syscalls seem to be really useful. They also have the potential to make one really rethink about software architecture. I should probably give this a try and see how I can improve my own programs.
@movq@www.uninformativ.de arch moment
Speaking of Wine, Arch Linux completely fucked up Wine for me with the latest update.
- 16-bit support is gone.
- Performance of 3D games is horrible and unplayable.
Arch is shipping a WoW64 build now, which is not yet ready for prime time.
And then I realized that there’s actually only one stable Wine release per year but Arch has been shipping development releases all the time. That’s quite unusual. I’m used to Arch only shipping stable packages … huh.
Hopefully things will improve again. I’m not eager to build Wine from source. I’d rather ditch it and resort to my real Windows XP box for the little (retro)gaming that I do … 🫤
@movq@www.uninformativ.de i’m grateful that this works at least!