Hiker, software engineer (primarily C++, Java, and Python), Minecraft modder, hunter (of the Hunt Showdown variety), biker, adoptive Akronite, and general doer of assorted things.

  • 0 Posts
  • 318 Comments
Joined 1 year ago
cake
Cake day: August 10th, 2023

help-circle

  • I actually work on a C++ compiler… I think I should weigh in. The general consensus here that things are lossy is correct but perhaps non-obvious if you’re not familiar with the domain.

    When you compile a program you’re taking the source, turning into a graph that represents every aspect of the program, and then generating some kind of IR that then gets turned into machine code.

    You lose things like code comments because the machine doesn’t care about the comments right off the bat.

    Then you lose local variable and function parameter names because the machine doesn’t care about those things.

    Then you lose your class structure … because the machine really just cares about the total size of the thing it’s passing around. You can recover some of this information by looking at the functions but it’s not always going to be straight forward because not every constructor initializes everything and things like unions add further complexity … and not every memory allocation uses a constructor. You won’t get any names of any data members/fields though because … again the machine doesn’t care.

    So what you’re left with is basically the mangled names of functions and what you can derive from how instructions access memory.

    The mangled names normally tell you a lot, the namespace, the class (if any), and the argument count and types. Of course that’s not guaranteed either, it’s just because that’s how we come up with unique stable names for the various things in your program. It could function with a bunch of UUIDs if you setup a table on the compilers side to associate everything.

    But wait! There’s more! The optimizer can do some really wild things in the name of speed… Including combining functions. Those constructors? Gone, now they’re just some more operations in the function bodies. That function you wrote to help improve readability of your code? Gone. That function you wrote to deduplicate code? Gone. That eloquent recursive logic you wrote? Gone, now it’s the moral equivalent of a giant mess of goto statements. That template code that makes use of dozens of instantiated functions? Those functions are gone now too; instead it’s all the instantiated logic puked out into one giant function. That piece of logic computing a value? Well the compiler figured out it’s always 27, so the logic to compute it? Gone.

    Now all of that stuff doesn’t happen every time, particularly not all of those things are always possible optimizations or good optimizations … But you can see how incredibly difficult it is to reconstruct a program once it’s been compiled and gone through optimization. There’s a very low chance if you do reconstruct it, that it will look anything like what you started with.




  • I don’t think the US Govt backdoors phones anymore … mostly because they don’t need to. They find other ways to get the information, like warrantless surveillance of Google and Apple notification servers.

    The other reason I don’t think it happens is that there are just too many security researchers trying to find exploits and backdoors. Also it’s pretty well known that any backdoor can be used against you. The NSA has an interest in domestic phones being secure.

    Granted, international models might have some alterations/backdoors… Even then, that would be egg on the face that they don’t really need if they got caught with a backdoor that applied only to international phones.











  • Yes, but in Texas you’ll find the interstate speed limit is 85 and in Ohio it was 65, now it’s 70.

    There’s not some fundamentally crazy difference between Ohio and Texas roads that results in Texas accepting 20mph higher speed limits than the rate Ohio was using within the last 10 years or so.

    There is a history of speed limits for fuel efficiency and scarcity https://en.wikipedia.org/wiki/National_Maximum_Speed_Law. Which is more evidence that speed limits do not inherently correspond to safety. Driving the limit, over the limit, or under the limit doesn’t “magically” make you safer.

    Sure, if you’re in an accident two objects traveling faster are going to cause more damage to each other than two objects traveling slower. However, getting into that accident in the first place has little to do with speed and a lot to do with situational awareness and giving yourself enough time to stop in case of emergency (i.e. how close you’re following the car in front of you, how fast you’re passing kids on the sidewalk, etc).

    You’ll note speed is always blamed for increasing severity (i.e., it’s a factor in the severity of the accident). Unfortunately the links don’t work anymore to get to the underlying source but https://sites.psu.edu/siowfa15/2015/09/18/is-driving-faster-safer/ states “A study conducted by the Florida Department of Transportation says that accidents that were caused by speeding is actually 2.2%.” The Autobahn is another great example. Speed is very rarely cited as the primary cause … because speed isn’t really the issue.

    We should be focusing on issues that actually cause accidents like tailgating, blocking the left lane, failing to signal, etc.


  • I hate that speed(ing) always gets lumped in whenever “dangerous behavior” comes up. Going faster than an arbitrary road sign says you should isn’t inherently dangerous.

    • Going faster than the arbitrary road sign can be dangerous.
    • Going the speed the arbitrary road sign says can be dangerous.
    • Going slower than the arbitrary road sign can be dangerous.

    It’s about the conditions of the road, paying attention, signaling to other drivers what you’re trying to do, and being prepared for people and animals to do something dumb.

    • following too closely
    • using phones while driving

    These things are on a whole other level than speeding or “illegally” passing. But the person who can’t keep their car centered in the lane, wrecks every other winter, doesn’t use their turn signal, doesn’t notice an ambulance right behind them, and drives too close to the car in front of them will say “I’m a GOOD driver because I don’t speed. Shame on all these bad drivers that pass me!”

    Even worse some of those “GOOD” non-speeding drivers will try to “police the roads” and prevent people from getting around them which has literally resulted in completely pointless deaths during emergencies.