[-] kornel@programming.dev 19 points 1 week ago* (last edited 1 week ago)

Rust tries to move language functionality to libraries where possible. Instead of adding high-level magic to the language, Rust prefers to add a low-level feature that can be used to build higher-level features. For example, instead of built-in nullable types, it has enums with data, which were used to make Option. This way hopefully you can do more things with fewer language features. Functionality of higher-level features can be explained by lower-level ones (knowing how things are implemented is important for systems programming), and you can reimplement them if you need (e.g. Rust in the Linux kernel uses its own smart pointers instead of those from the standard library).

Rust tries to keep the standard library small, and move unnecessary code into crates-io crates. The problem with stdlib is that there is only a single version shared by all programs, so it has to stay backwards-compatible forever. Long term stdlib accumulates outdated functionality and deprecated APIs, which can't be fixed. Crates.io crates support versioning, so they can evolve and iterate without breaking anyone.

Another reason is that Rust supports low-level programming, including embedded. This means that the language itself can't depend on any fat runtime, and doesn't even perform heap allocations.

[-] kornel@programming.dev 14 points 2 years ago

This is how security works in the C programming language.

[-] kornel@programming.dev 26 points 2 years ago

CS1 never fully integrated expansion packs, so there were three different ways to zone the industry, and a long disorganized list of ad-hoc zoning policies. CS2 had a chance to start with more of this more coherently designed.

Plus CS2 made road editing much more precise and flexible. You can add and remove lanes instead of having separate road types for 150 different lane configurations.

[-] kornel@programming.dev 15 points 2 years ago

It’s more likely that they’ve hit a driver bug, or accidentally pushed a build with some debug junk. They wouldn’t intentionally release game that runs 15fps on 4090.

22
Famous ADHDers part 1 (www.sciencedaily.com)
submitted 2 years ago by kornel@programming.dev to c/adhd@lemmy.world
[-] kornel@programming.dev 6 points 2 years ago

This has always been the case. When Windows XP came out people hated it needed 64MB (not GB) of RAM, because that was more than the entire disk installation of Windows 95, which was also bloated compared to older Macs and Amigas.

[-] kornel@programming.dev 21 points 2 years ago

I’ve got an ARM Mac. I’ve got ARM VPSes from Hetzner, and I’m compiling native code for the server.

It’s definitely easier to develop, build, and test on the same architecture, than to deal with cross-compilation and emulation.

So I think Linus is right.

[-] kornel@programming.dev 10 points 2 years ago

Filomena is brilliant

[-] kornel@programming.dev 32 points 2 years ago* (last edited 2 years ago)
[-] kornel@programming.dev 31 points 2 years ago

Use the system webview, you cowards!

Developers bundle all of Chromium, because they're afraid the OS webview will have a different browser engine. Testing is too hard…

This is such a terrible excuse — usually the same app runs in browsers too, so it already has to deal with even wider variety of browser engines.

[-] kornel@programming.dev 18 points 2 years ago* (last edited 2 years ago)

The annoying popups are an act of malicious compliance from data harvesting companies. The tracking industry wants people to associate the right to privacy with stupid annoyance, so that people will stop demanding privacy.

The legislation does not say anything about cookies. It's about rights and responsibilities in data collection (no matter how it's done technically). The "consent" part of it exists as a compromise, because there has been heavy lobbying against the legislation.

This is not a technical problem — we've had many technologies for it, and the industry has sabotaged all of them. There was the P3P spec in 2002! It has been implemented in IE that had 90%+ market share back then. And Google has been actively exploiting a loophole in IE's implementation to bypass it and have unlimited tracking. Google has paid fines for actively subverting Safari's early anti-tracking measures. Then browsers tried DNT spec as the simplest possible opt-out, and even that has been totally rejected by the data harvesting industry. There are easy technical solutions, but there are also literally trillions of dollars at stake, and ad companies will viciously sabotage all of it.

[-] kornel@programming.dev 14 points 2 years ago

Generally yes.

GIF's ancient LZW compression is remarkably ill-suited for modern CPUs, and more expensive than modern algorithms. Combined with significantly larger file sizes, it costs much more to decode, on top of increased costs of transfer and caching.

GIF might have an edge if the animation is very small (<16px, few frames).

It also gets messy if you need to play hundreds of animations. GIF will be terribly inefficient, but also browsers aren't designed to have hundreds of video elements, so both will eat memory in their own way, and it will vary which is worse.

[-] kornel@programming.dev 6 points 2 years ago* (last edited 2 years ago)

I don't know about C++, but in Rust the push is inline, and still doesn't always optimize checks away due to an annoying edge case: integer overflow. Reserving (old_len + new_len) could give you a smaller buffer than new_len. The optimizer sees it and is pedantic about it.

view more: next ›

kornel

joined 2 years ago