@kat@yarn.girlonthemoon.xyz Ooh, I’ve got to bookmark that page. 😃
@aelaraji@aelaraji.com I wish I had the luxury of not reading that junk. 😅 But instead, I have a Mutt hotkey that pipes an HTML mail through elinks … Bah.
@prologic@twtxt.net I’m trying to call some libc functions (because the Rust stdlib does not have an equivalent for getpeername(), for example, so I don’t have a choice), so I have to do some FFI stuff and deal with raw pointers and all that, which is very gnarly in Rust – because you’re not supposed to do this. Things like that are trivial in C or even Assembler, but I have not yet understood what Rust does under the hood. How and when does it allocate or free memory … is the pointer that I get even still valid by the time I do the libc call? Stuff like that.
I hope that I eventually learn this over time … but I get slapped in the face at every step. It’s very frustrating and I’m always this 🤏 close to giving up (only to try again a year later).
Oh, yeah, yeah, I guess I could “just” use some 3rd party library for this. socket2 gets mentioned a lot in this context. But I don’t want to. I literally need one getpeername() call during the lifetime of my program, I don’t even do the socket(), bind(), listen(), accept() dance, I already have a fully functional file descriptor. Using a library for that is total overkill and I’d rather do it myself. (And look at the version number: 0.5.10. The library is 6 years old but they’re still saying: “Nah, we’re not 1.0 yet, we reserve the right to make breaking changes with every new release.” So many Rust libs are still unstable …)
… and I could go on and on and on … 🤣
On my blog: Developer Diary, Day of the African Child https://john.colagioia.net/blog/2025/06/16/african-child.html #programming #project #devjournal
On my blog: Go Nowhere Fast https://john.colagioia.net/blog/2025/06/15/go-nowhere-fast.html #harm #rant #politics #harm
fn sub(foo: &String) {
println!("We got this string: [{}]", foo);
}
fn main() {
// "Hello", 0x00, 0x00, "!"
let buf: [u8; 8] = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x00, 0x00, 0x21];
// Create a string from the byte array above, interpret as UTF-8, ignore decoding errors.
let lossy_unicode = String::from_utf8_lossy(&buf).to_string();
sub(&lossy_unicode);
}
Create a string from a byte array, but the result isn’t a string, it’s a cow 🐮, so you need another to_string() to convert your “string” into a string.
- https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy
- https://doc.rust-lang.org/std/borrow/enum.Cow.html
I still have a lot to learn.
(into_owned() instead of to_string() also works and makes more sense to me, it’s just that the compiler suggested to_string() first, which led to this funny example.)
So I was using this function in Rust:
https://doc.rust-lang.org/std/path/struct.Path.html#method.display
Note the little 1.0.0 in the top right corner, which means that this function has been “stable since Rust version 1.0.0”. We’re at 1.87 now, so we’re good.
Then I compiled my program on OpenBSD with Rust 1.86, i.e. just one version behind, but well ahead of 1.0.0.
The compiler said that I was using an unstable library feature.
Turns out, that function internally uses this:
https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.display
And that is only available since Rust 1.87.
How was I supposed to know this? 🤨
On my blog: Free Culture Book Club — Tag Team https://john.colagioia.net/blog/2025/06/14/tag-team.html #freeculture #bookclub
On my blog: Toots 🦣 from 06/09 to 06/13 https://john.colagioia.net/blog/2025/06/13/week.html #linkdump #socialmedia #quotes #week
On my blog: Real Life in Star Trek, Interface https://john.colagioia.net/blog/2025/06/12/interface.html #scifi #startrek #closereading
New oil and gas fields incompatible with Paris climate goals
Opening any new North Sea oil and gas fields is incompatible with achieving the Paris Climate Agreement goals of limiting warming to 1.5°C or holding warming to “well below 2°C” relative to preindustrial levels, finds a new report published by UCL academics. ⌘ Read more
Radeon Software For Linux Dropping AMD’s Proprietary OpenGL/Vulkan Drivers
Direct link to upstream release notes.
On my blog: Generative AI Wish List https://john.colagioia.net/blog/2025/06/08/ai-wish-list.html #artificialintelligence #harm #rant
Having some fun with SIRDS this morning.
What you should see: https://movq.de/v/dae785e733/disp.png
And the tutorial I used for my C program: https://www.ime.usp.br/~otuyama/stereogram/basic/index.html
Current toy project: an image feed generated by mk(1). Still some edges to clean up but it’s nice: http://a.9srv.net/img/_readme.html
On my blog: Free Culture Book Club — The Pink and Black Album https://john.colagioia.net/blog/2025/06/07/pink-black.html #freeculture #bookclub
On my blog: Toots 🦣 from 06/02 to 06/06 https://john.colagioia.net/blog/2025/06/06/week.html #linkdump #socialmedia #quotes #week
SuSE Linux 6.4 and Arachne on DOS also work (with Windows 2000 as a call target):
On my blog: Real Life in Star Trek, Liaisons https://john.colagioia.net/blog/2025/06/05/liaisons.html #scifi #startrek #closereading
Deep learning gets the glory, deep fact checking gets ignored
Article URL: https://rachel.fast.ai/posts/2025-06-04-enzyme-ml-fails/index.html
Comments URL: https://news.ycombinator.com/item?id=44174965
Points: 500
# Comments: 109 ⌘ Read more
Technical Guide To System Calls: Implementation And Signal Handling In Modern Operating systems
Comments ⌘ Read more
On my blog: Developer Diary, International Sex Workers’ Day https://john.colagioia.net/blog/2025/06/02/sex-workers.html #programming #project #devjournal
I had a lot of fun with my modems these past few days:
https://www.uninformativ.de/blog/postings/2025-05-31/0/POSTING-en.html
On my blog: One Fight https://john.colagioia.net/blog/2025/06/01/one-fight.html #harm #rant