[-] orangeboats@lemmy.world 38 points 2 months ago* (last edited 2 months ago)

They very rarely have memory and threading issues

It's always the "rarely" that gets you. A program that doesn't crash is awesome, a program that crashes consistently is easy to debug (and most likely would be caught during development anyway), but a program that crashes only once a week? Wooo boy.

People vastly underestimate the value Rust brings by ensuring the same class of bugs will never happen.

[-] orangeboats@lemmy.world 36 points 2 months ago* (last edited 2 months ago)

Servo was an experimental ground for Mozilla in some ways (like testing out a new CSS engine and porting it back to Gecko if it works). So it's quite normal for people to be unaware of it, it was not meant for the public.

But later on it was abandoned by Mozilla and stuck in a limbo, until it got picked up by the Linux Foundation. Now it's a standalone project and I wish them well. We really need a new FOSS web engine.

[-] orangeboats@lemmy.world 39 points 2 months ago

I recall reading somewhere the earlier compilers had a hard limit on the length of function names, due to memory constraints.

[-] orangeboats@lemmy.world 40 points 2 months ago

Agreed. HiDPI is the way to go and we should appreciate Framework for putting that in their laptops instead of continuing the use of shitty 1366x768 screens.

Xorg is the reason why OP is facing the scaling issues. OP, try to force the apps to run on native Wayland if they support it but don't default to it. The Wayland page on Arch wiki has instructions on that. Immensely improved my HiDPI experience.

[-] orangeboats@lemmy.world 47 points 3 months ago* (last edited 3 months ago)

The "quit having fun" meme is ironically becoming as cringey as the thing it is originally complaining about.

You will help the community more by telling non-Linux people why Linux gaming is better, and this meme is doing the exact opposite of it -- "oh Linux can't play some games, yada yada. But we are still better! Switch over!" -- like what's the logic of it?

What's the purpose of this meme other than circlejerking?

Disclamer: I am a Linux user myself, started with Debian and is now using Arch Linux.

I will share some advantages I experienced in Linux gaming:

  1. Alt-tabbing old fullscreened games won't mess with my monitor.

  2. The compatibility of Wine when it comes to some older games is wild. SimCity 4 actually crashed less when I played it on Linux.

  3. Better performance across the board. Granted it's just a mere 5% difference but I will take it, why not.

[-] orangeboats@lemmy.world 37 points 6 months ago

I still don't quite get why some people are defending manufacturers which remove the headphone jack on their phones...

3.5mm jacks don't cost much materially. Removing it doesn't bring any benefit at all, and you are forced to buy a bluetooth headphone or a Type-C-to-3.5mm dongle on top of that.

[-] orangeboats@lemmy.world 49 points 6 months ago

Entitled brat? What... Have you ever seen how GNOME developers respond to some bug reports and merge requests?

Since when has reporting bugs and contributing to the project become an entitlement?

[-] orangeboats@lemmy.world 38 points 6 months ago* (last edited 6 months ago)

I've noticed that many Reddit users with the username format Word_Word_Number (for example Absolute_Bot_1230) are almost guaranteed to either be a bot or extremely inflammatory -- it's like everything they post is meant to generate controversies.

[-] orangeboats@lemmy.world 84 points 6 months ago

Society in general encourages and rewards those who speak more, even if the things they speak have zero contribution or are absolute nonsense.

[-] orangeboats@lemmy.world 50 points 7 months ago* (last edited 7 months ago)

Not sure if it's still the case today, but back then cellular ISPs could tell you are tethering by looking at the TTL (time to live) value of your packets.

Basically, a packet starts with a TTL of 64 usually. After each hop (e.g. from your phone to the ISP's devices) the TTL is decremented, becoming 63, then 62, and so on. The main purpose of TTL is to prevent packets from lingering in the network forever, by dropping the packet if its TTL reaches zero. Most packets reach their destinations within 20 hops anyway, so a TTL of 64 is plenty enough.

Back to the topic. What happens when the ISP receives a packet with a TTL value less than expected, like 61 instead of 62? It realizes that your packet must have gone through an additional hop, for example when it hopped from your laptop onto your phone, hence the data must be tethered.

[-] orangeboats@lemmy.world 85 points 1 year ago

It's the fear of centralization, I believe (correct me if I'm wrong!).

Seeing that the whole point of federation is to decentralize the web, putting everything under the Cloudflare umbrella goes against this philosophy.

[-] orangeboats@lemmy.world 36 points 1 year ago

Awesome! I don't have a Discord account (well, I had) so this will be very useful.

1
submitted 1 year ago* (last edited 1 year ago) by orangeboats@lemmy.world to c/rust@programming.dev

For context: I am trying to write a Rust wrapper over a C library.

Like many C libraries, most of its functions return an int. Positive return values are meaningful (provides information) and negative values are error codes.

To give an example, think of something like int get_items_from_record(const struct record *rec, struct item *items). A positive value indicates how many items were returned. -1 could mean ErrorA, -2 ErrorB, and so on.

Since this is Rust, I want to represent this kind of integer as Result<T, E>, e.g.:

enum LibError {
    A = -1,
    B = -2,
    // ....
}

// LibResult is ideally just represented as an integer.
type LibResult = Result<NonNegativeInteger, LibError>;

// Then I can pass LibResult values back to the C code as i32 trivially.

Is there a way/crate to do this?

view more: next ›

orangeboats

joined 1 year ago