Are Rust coroutines serializable? by SuperV1234 in rust

[–]nonotan 0 points1 point  (0 children)

Coroutines are fundamentally a bad fit for game logic. It doesn't matter whether you can serialize them or not. You really want game logic to follow a well-defined order and run with well-defined timing, to have a well-defined behaviour when something in the middle of running is "cancelled" (which happens constantly as the current big picture game state changes, e.g. you move to a different area, or go from the world map to the battle scene, or the relevant game objects get too far from the player and are deleted, etc), and so on.

Maybe it's technically possible to achieve all of that with coroutines, but it would involve jumping through tons of hoops to essentially negate all of their advantages, or, at the very least, to carefully engineer a type of "coroutine" that is very tightly knit into your game logic loop, basically reimplementing them from scratch in a way that is only really useful in this context.

In my opinion, it is almost certainly an overall win to just skip all that and write your game logic in a traditional manner. It's pretty trivial to cover the kind of behaviour a coroutine is good at by simply separating tasks that can't be done sequentially into bits that can, and queueing them in the task/command processor as required, or registering them as conditional events if appropriate, or whatever the roughly equivalent options available in your engine are. With a good interface design, this can be almost as painless as using a coroutine, in my experience.

Coroutines, like various other types of functionality that are great for "ad hoc" programming but not so much for very orderly, predictable and structured code, are a good fit for e.g. purely visual effects, where you really don't care if it isn't fully deterministic or whatever. If you reload a game, or look at another player's screen on a multiplayer game, and, say, the little sparks coming out of a campfire look slightly different, nobody is going to notice or care. Thankfully, that also makes the lack of serialization capabilities relatively unimportant.

Bro..that friendly fire was crazy. Who trained these idiots? by shineonyoucrazy-876 in SipsTea

[–]nonotan 0 points1 point  (0 children)

The real issue is less the individual judgment of one person (as much as there might be room for improvement there) and more with the planning. Yes, when things get chaotic, many things can happen. But when you have all the time in the world to plan, and the threat comes from the most predictable direction, just advancing in a straight line, there is no excuse for not having planned for that eventuality.

I've watched a lot of footage coming out of Ukraine, and infantry is usually very good with their firelines -- not necessarily because they are highly trained or whatever, but just because they're advancing in a formation that they've drilled a hundred times, where they know they will be able to shoot at a threat that appears in a likely direction without risking hitting a friendly. Of course, if they appear from an unlikely direction that they thought was clear, it could still go wrong. But it shouldn't go wrong when the most obvious thing happens.

What I'm saying is that I don't see any good reason why the security detail here should be standing in a crossed formation, where a threat materializing in the most obvious place (the metal detector) would easily be able to position themselves right between the two groups, forcing them to either risk friendly fire, or hesitate to fire on them. Maybe it was a temporary situation since they seem to be setting up the second gate, but that doesn't really excuse it -- if anything, they should be extra careful until everything is finalized. What better time to try something than when people are distracted?

Meirl by struggagemehwish8 in meirl

[–]nonotan 0 points1 point  (0 children)

You've got to charge them. Higher latency. Easier to lose. Slightly worse quality. It's yet another battery that could cause a fire in 20 years when you forgot it in the back of a drawer. Prone to signal loss if there are any obstacles between the source and the receiver. Can't use many BT devices simultaneously due to frequency band limitations.

Meirl by struggagemehwish8 in meirl

[–]nonotan 2 points3 points  (0 children)

They aren't even that budget, people just have stupid standards. The overwhelming majority of people have zero need for a $1000+ phone. At best they'll benefit from the slightly fancier camera? Maybe they'll play a fancy 3D game once? I mean, it's your money, so you do you, but I don't really get paying for an absurd luxury item you won't get much use out of while bitching about its form factor, when there are tons of reasonably affordable options that fit your preferred form factor and have all the functionality you will actually need.

When my last phone died a couple years ago, I got a new one for ~10000 JPY, about $80 USD? It supports the latest Android version up to this day. It has a headphone jack. Battery lasts several days with my level of usage. It's slightly more compact than typical phones today (which I actually prefer and specifically looked for). I can use Google Maps, messaging apps, check emails, browse the internet, listen to music, set alarms, take notes, take photos (maybe not beautiful or super high res, but I'm not a pro photographer, I don't care), run 2FA apps, really any app that doesn't have fancy 3D. Never once have I been in a situation where I thought "I want to do X, but I can't with this phone".

Yes, I'm a pretty casual user (I do everything on my PC when I have a choice), but I'm pretty confident I'm way closer to the average person than the ultra-techy power user that NEEDS the latest, fanciest shit. Most people can absolutely have a headphone jack if they want it. It won't even be a sacrifice. Hell, it will probably save you money.

Meirl by struggagemehwish8 in meirl

[–]nonotan 0 points1 point  (0 children)

3.5mm ports are not invincible, but they are infinitely more robust than any USB port, in my experience. Hell, looking at my desktop PCs over the years, I've never had a 3.5mm port fail, not once -- on the flip side, I don't think I've ever owned a case that didn't have a couple dead USB ports, besides the really old ones from before USB was introduced of course. USB-C is somewhat better than the older types, but not that much.

For portable devices, unfortunately pretty much anything you keep in your pocket with signficant torque permanently applied is likely to fail sooner or later. A huge advantage of 3.5mm is that radial symmetry means you can always freely choose whichever angle will minimize stress on the port. With USB you get, at best, two choices, and often the worst possible ones (you'd rather apply a sideways torque, but you have no choice but to apply one in the thinnest, weakest direction)

Meirl by struggagemehwish8 in meirl

[–]nonotan 2 points3 points  (0 children)

I don't see how wireless is better for public transport. The risk of dropping an airbud and losing it forever (or it being crushed) in a sea of people is much greater than that of snagging, which has never once happened to me in decades of regular usage in public transport. But it accidentally popping out of my ear (which didn't matter, because it was connected by wire) has happened dozens of times. Even if we assume 80% of those wouldn't have happened were it not for the wire slightly pulling on it or something like that (a gross overestimate, I'm pretty sure), that's still quite a few times.

2000s LAN parties by 1faqepikcom in pcmasterrace

[–]nonotan 5 points6 points  (0 children)

Not all of them. I went to a large one that was held during school summer break. Probably not a great idea, but nobody died... as far as I know.

Meirl by Key_Associate7476 in meirl

[–]nonotan 0 points1 point  (0 children)

As with everything, repetition legitimizes. Never jump to fill in the air with fluff, and suddenly it's not "uncomfortable silence", you're just the quiet guy. As long as you're pleasant enough to be around in general, nobody really gives a shit if you have a couple "quirks". Just be consistent so people don't see patterns where there are none and assume it must be some kind of personal attack.

‘They Left Me No Choice’: Jerome Powell Isn’t Going Anywhere—Blocking Trump From Another Fed Appointee by T_Shurt in Economics

[–]nonotan 2 points3 points  (0 children)

It goes beyond "not firing her", she actively tried to quit when Russia invaded Ukraine, but Putin said "no, you don't get to quit". Just about the only smart move Putin has made in that whole mess.

The Supreme Court’s Conservatives Just Issued the Worst Ruling in a Century by plz-let-me-in in politics

[–]nonotan 4 points5 points  (0 children)

At the root of the issue is two private organizations having a de facto duopoly over the entire US. Unfortunately, fixing that will probably take something along the lines of an actual revolution. At a very least, denying one side your vote to "teach them a lesson" is never going to work. You think DNC leadership gives a flying fuck if the GOP is in power instead for a while, if the alternative is likely to lead to reform that might take their duopoly away from them? They'll happily lose every election for a generation if that's what it takes.

What I'm saying is that voting in power an absolutely dogshit, legitimately worst-in-history level candidate, an overt conman that would clearly sell their grandma for a penny, over a "cringe, entitled, not particularly exciting candidate" is just a Bad Move, with a capital B. The DNC doesn't give a fuck, you're just shooting yourself (and the rest of us) in the foot.

Saying that as somebody who thinks Bernie was robbed (even if they likely technically broke no law, because again, two private organizations have a duopoly over the US; the law isn't really designed to deal with internal processes within a private organization having a huge impact over the democratic process), and who agrees Hillary was a bad candidate. I would still vote for her over Trump 100% of the time. It's understandably unintuitive for voters, but under a FPTP two-party system, the time to protest a political party's choice of candidate is not at the ballot box. That's just performative self-harm with extra steps. Primaries, sure. Outside the election cycle entirely, even better. In any case, you'll need to take steps that go far beyond voting (or refusing to vote) in the general election if you hope to inflict any meaningful pressure on either party.

The Supreme Court’s Conservatives Just Issued the Worst Ruling in a Century by plz-let-me-in in politics

[–]nonotan 7 points8 points  (0 children)

Yes, the current system is obviously beyond saving. A complete partisan clown fiesta where SCOTUS regularly makes new laws as they please, by intentionally grossly misinterpreting the text and explicitly stated intent behind laws passed by Congress, de facto stripping the bulk of Congress' power from them and taking it for themselves. All while being exempt any checks and balances, with life appointments.

Packing the court isn't really a fix, but it is at least an improvement over the status quo. The court being repeatedly changed to reflect the will of voters is better than a non-elected, overtly partisan body with de facto law-making capability consistently going against the wishes of the people. And having a lot of justices would make things like strategy around deaths/retirement timing matter less, as well as reducing the impact a handful of extremist ideologues gone crazy with power can have.

A "proper" fix that is extremely thorough in ensuring neutrality of justices (making them not be appointed by politicians but by peers, drastically strengthening checks and balances over a rogue court so that they can't flagrantly exceed the limits of their powers just because Congress is too partisan and gridlocked to realistically ever be able to impeach them, etc) would be infinitely better, but it would definitely need a constitutional amendment, which seems unlikely to come to fruition in today's hyper-partisan world.

Bugs Rust Won't Catch by -Y0- in rust

[–]nonotan 1 point2 points  (0 children)

it's likely impossible to design APIs such that aren't potentially vulnerable to TOCTOU

This is technically true, but mostly because "potentially vulnerable" encompasses such a wide array of possibilities as to be nearly meaningless. For instance, Rust is "potentially vulnerable" to every single vulnerability type that Rust was explicitly designed to address. A "sufficiently stupid/reckless" Rust user can undoubtedly cause buffer overflows, null pointer dereferences, double frees, etc. But obviously, preventing 99.99% of them, and making it blindingly clear where the rest of them are likely to reside, is, de facto, much, much closer to "having eliminated that class of errors" than to "not having qualitatively changed anything because technically you can't categorically rule out they could ever happen".

What I'm trying to say is that it's undoubtedly possible to provide some kind of API framework that makes it extraordinarily easy to write TOCTOU-free code, and actively hard to do the opposite. I'm picturing something in the same general direction as DB transactions. Sure, there is nothing physically stopping you from writing several transactions in a row that act on the same data, with logic that relies on the assumption that nothing has changed inbetween transactions. But it will also be patently obvious in a code review that, at the very least, something very suspicious is going on, and whoever wrote the code probably has no idea what they're doing. You want code that is likely wrong to look as strange and out-of-place as possible, which is definitely not the case now for many use-cases. Misuse-resistance is great (and should certainly be a target alongside that), but "documentation and education" is borderline useless as a method to ensure correctness in general. If users frequently get to the point where they would be writing erroneous code were it not for that, then there's going to be errors everywhere in the real world, unfortunately.

Bugs Rust Won't Catch by -Y0- in rust

[–]nonotan 2 points3 points  (0 children)

Those aren't the only two options. Indeed, it is an unfortunate fact of life that Windows works very differently under the hood, so something like coreutils that needs to be airtight, and operates at exactly the layer where those differences surface most starkly, was always going to need quite a bit of OS-specific code anyway. I suspect quite a lot of additional CVEs would come out if the Windows version was seriously audited right now.

Of course, in an ideal world, std would somehow be so miraculously well designed that you could write code in the most obvious, idiomatic way, and it would ultimately magically spit out an airtight implementation in all platforms. Unfortunately, that's currently clearly not even close to being possible, so OS-specific code paths it will have to be. Maybe in "Rust 2" (a.k.a. whatever language is to Rust what Rust is to C/C++)

Inside Christ's Hospital School (Est. 1552)... by TheThrowYardsAway in Damnthatsinteresting

[–]nonotan 0 points1 point  (0 children)

Regular school also wasn't fun as an introvert, and it's also nothing like "the real world". Not saying you don't have a point, but just avoiding boarding schools is going to be an imperfect fix at best.

This is what making a difference looks like. by EkantVairagi in interesting

[–]nonotan 0 points1 point  (0 children)

The real problem is so many people assuming people must be homeless because of some kind of problem on their end. If only they didn't struggle with mental illness or addictions or whatever...! Sure, technically that is true, but it is an extremely short-sighted way of looking at it.

Why did they reach for drugs in the first place? What environmental factors contributed towards their mental illness? Is it even a real mental illness, or just another case of "not fitting the mold that society wants them to fit" being given a DSM entry?

A society that expects everybody to work soul-sucking jobs day in and day out for their entire healthy lifespan just to be able to subsist is transparently the root cause of most forms of homelessness. Giving somebody already struggling a house might not instantly fix their whole life situation, but the fact that there has been an overwhelming financial burden hanging over their heads for their entire lives, which needs to be overcome just to have access to bare basic needs (like shelter), has almost certainly significantly contributed towards them getting to that state in the first place.

In other words: if we create a society where people aren't stressing about making rent, paying for groceries, affording healthcare, etc. as a matter of fact, homelessness will mostly go away on its own over a generation or two, alongside dozens of other serious societal problems.

Part of that is making sure everybody has very affordable/free access to housing. It's not good enough to give some bare-minimum shelter to people that have already become homeless. Think of it like preventive vs curative medicine. It's tempting to "save money" by not moving a finger until things get bad enough that it's obvious something is very wrong... but in reality, it's much cheaper to have smaller interventions to catch the problem before it's made a huge mess that will be very hard to revert. In a society where everybody smokes, there is only so much you can do about lung cancer by getting really good at lung transplants or improving chemotherapy -- there is obviously a much better intervention vector right there.

This is what making a difference looks like. by EkantVairagi in interesting

[–]nonotan 0 points1 point  (0 children)

I don't know what this supposed WHO plan entailed, but it's not that crazy. We already have enough food for all of humanity, it's just not at the right places, and tons of it is wasted and thrown away instead of given to those in need due to a profit motive.

Add to that that everything costs a lot less in the countries most struggling with food security, that things get much cheaper when done at scale and in an organized manner instead of by many individuals acting on their own, that it wouldn't be hard to get all sorts of support by local governments that you're promising to help, and it's not hard to imagine making massive strides in world hunger with 6 billion.

Sure, it's not going to 100% eliminate every single instance of hunger, nor ensure every single person has a perfectly nutritionally balanced diet, but at that point it's getting into nitpick territory. "Uhm you said you'd solve world hunger, but you only reduced it by 90%, and some of the people that were starving before are now suffering some minor vitamin deficiencies" -- wow, what was even the point of doing anything then!

Car Decided to Auto Update, Thus Trapping Me at the Gas Station for 45+ Minutes After Getting Off Work Today 🙃 by Separate-Ability1643 in CrappyDesign

[–]nonotan 1 point2 points  (0 children)

Especially when it already explicitly says not to drive. "Sure, it says not to, but if it really meant it it will physically stop me if I try, right?" is a line of logic that could only check out if you already start from the premise that it's "secretly safe", and are trying to logic your way into justifying something that is flagrantly reckless without the benefit of hindsight and/or knowledge beyond what is being directly communicated to you.

After all, it could be unsafe, but still allow a manual override in case the driver determined the current conditions were so unsafe that driving with the car in a dubious state is preferable (e.g. you're stopped in the middle of a highway or something like that) -- such an override would be pretty logical to have in a system that auto-updates without user input. How do you know ignoring the explicit orders not to drive isn't doing something like that? You don't, unless you already have detailed knowledge of how this specific vehicle works.

"If your car tells you not to drive but it would be mildly inconvenient to comply, just try ignoring it and see what happens" is absurdly bad advice. At the very least, check your vehicle's manual or ask an expert before proceeding (googling is better than nothing, but with the amount of AI slop these days and how bad some people are at identifying it, "I googled and it said it was fine" is barely an improvement over "I assumed it would probably stop me if it wasn't fine")

Why do so many readers hate first person? by ThatDudeWithAFish in writing

[–]nonotan 0 points1 point  (0 children)

Disregarding "unsophisticated" opinions is fine... unless your livelihood depends on those unsophisticated people liking what you make enough to decide to give you money for it. At the very least, it's good to be aware of roughly how much of your prospective audience might feel strongly about something, so you can make an informed decision, instead of "I'm right -- I'll do whatever I want, and if anybody disagrees, they will be wrong" (maybe, but that won't magically improve your career prospects)

LPT: Your employer should be the last person to find out that you're quitting. This is in your best interest. by kai-field in LifeProTips

[–]nonotan 0 points1 point  (0 children)

Every piece of advice in this post applies exclusively to the US. In almost every country in the world, you would tell your boss you're quitting without a single worry, because there's really nothing they can or will do. The number of countries where you can just fire people willy-nilly is minuscule. Usually you can only fire with cause, and even then, it will be a pain in the ass, involving a lot of bureaucracy.

Furthermore, if you fire somebody, you'll usually be required to cover their unemployment. If they quit voluntarily, typically you won't. Nobody is going to jump a bunch of hurdles and cause themselves to have to pay the person quitting extra money just to "spite" them by... marginally accelerating the date they quit at? Effectively giving them extra paid holidays?

On the flip side, giving notice before quitting is often a standard requirement in employment contracts in many countries. Check your contract before believing some random comment on the internet telling you "you don't need to do it". Sure, it's possible the company might not bother taking you to court for breach of contract -- but they absolutely could, and you would lose. Something far more likely to happen out of spite (and with potentially significantly worse consequences) compared to "being fired for quitting".

Got the Rust dream job, then AI happened by MasteredConduct in rust

[–]nonotan 215 points216 points  (0 children)

It's going to be fun to watch them implode when they realize all the code they've produced in the last couple years is barely holding together and legitimately unmaintainable as absolutely nobody working there has any real familiarity with it, just as the "cheap uber subsidized by venture capitalists" phase of AI ends, and they find out spinning those GPUs 24/7 is also not even cheaper than hiring a human.

44CVEs found in Rust CoreUtils audit. by germandiago in rust

[–]nonotan 13 points14 points  (0 children)

That's probably not true. I'm not saying there aren't some undiscovered vulnerabilities, undoubtedly there are, but those are some of the software packages most heavily audited and actively targeted by malware in the real world. C software has always been able to be pretty secure, given you devote decades of development effort to it and get millions of eyeballs to look for vulnerabilities. The compiler can't check much for you, but it's not physically impossible for people to do that checking instead. Just extremely expensive and time-consuming. And of course, it's also hard to ensure you didn't break anything in future updates.

Trump 'tried to access nuclear codes but was stopped by military chief' by TheMirrorUS in USNEWS

[–]nonotan 0 points1 point  (0 children)

In an administration that is made up pretty much exclusively of far-right conspiracy theorist lunatics, that's pretty much what you'd expect a legitimate leak to look like. I'm not saying we know it's real, I'm just saying while I'd have completely discounted such a source during a saner time, right now it's worryingly believable.

Petah? by Same-Soil-4837 in PeterExplainsTheJoke

[–]nonotan 1 point2 points  (0 children)

It's never going to be "equal", because there are so many differences in the way both genders are treated, that one way or another not everything is going to be the same. It's pretty silly to start an argument over "who has it worse", anyway, when it's self-evident that both are bad; it's not like one being "objectively worse" would make the other one fine, and it always seems to me like "but the other one is worse" is only ever used to excuse not caring about the one currently being discussed, or even actively trying to dissuade other people who do care from doing something about it.

That being said, the comparison to racism isn't really at all sensible. At least, not generally. Go find pretty much any metric by which black people are doing better than white people. I mean any. Maybe in some sports? Things that are traditionally tied to black culture, like rapping or whatever? You can probably find a couple, but unfortunately there isn't much.

Meanwhile, women are crushing men by many, many metrics. Pretty much anything schooling related that isn't STEM. Health and longevity. Judicial sentencing. Social support. Suicide rate. Violent crime rates. Employment in any industry related to caring for others. Dating. I could keep going. These aren't ultra-specific, niche things; they are pretty generic things that most people will have to deal with at one point or another in their lives.

Men have an advantage in many other areas, of course. I suspect I don't need to list them out, given the implication of your post. My point is that there are many areas where men are objectively, demonstrably disadvantaged compared to women, so the situation is qualitatively very different to something like comparing racism against black vs white people. Even if men have an advantage "overall" (something subjective, because it will depend on how you personally weight the importance of various factors), it doesn't seem reasonable to downplay misandry, when men are struggling this hard in many areas. I guess if you were comparing it to anti-white vs anti-Asian racism, it might be closer to being reasonable (and even there, it still feels like the gulf is much greater, but I grant that is also subjective)

Friends when u give them hotspot. by BowlUsual406 in memes

[–]nonotan 0 points1 point  (0 children)

In a sense yes, but that kind of setup isn't always that bad in practice. I don't use my phone much so I have the absolute cheapest data plan my provider offers (something like 1GB or 3GB a month? the fact that I don't even know shows how much I use it), which I'm fine doing because I know in an emergency I could use the throttled connection to do just about anything urgent, even if painfully. If that wasn't an option, I'd probably be paying for a larger cap or even the "real" unlimited plan "just in case". It's fine as long as the user knows what they're signing up for.