[–] 5 points 5 days ago

Yes, but the tools provided by Rust:

  1. Prevent most common ones via aliasing^mutability, Send and Sync marker traits, etc.
  2. Require explicitly marking the cases not handled by this, e.g. unsafe features require an unsafe {} block to be used.
  • source
  • parent
  • context
  • [–] 1 point 6 days ago*

    the GPL has become so complicated that only a programmer with relatively advanced legal knowledge and ability to read and properly understand “legalese” will be able to decipher it to know what they are able and unable to do with it

    I have read the GPL and it is not very complicated. It's long so you need an attention span to understand it but it's written in reasonably plain language and doesn't contain excessive references. It even goes so far as to provide a summary at the beginning.

  • source
  • [–] 13 points 6 days ago (1 child)

    ...which is why I love #[rustfmt::skip] so much! You can do stuff like

    #[rustfmt::skip]
    const DIRECTIONS: [[i8; 2]; 4] = [
                 [0, 1],
        [-1, 0],          [1, 0],
                 [0, -1],
    ]
    

    while still enjoying the convenience of auto formatting elsewhere.

    Although linters which act on the behavior of code are unequivocally a good thing, e.g. "hey, this comparison will always return false you probably made a mistake here".

  • source
  • parent
  • context
  • [–] 3 points 6 days ago*

    People (such as myself) make the argument that it does a better job because it's focused more on reading code than writing it since you don't start in the "write" mode like in most editors.

    I would say the choice of text editor shouldn't make a difference in productivity so long as it doesn't actively get in your way too often (looking at you, poorly implemented autopairs) and it supports the relevant LSP and debugging protocols.

  • source
  • parent
  • context
  •  

    It turns out you can make a really fast instruction decoder in Scrap Mechanic if only you can figure out a special bit mask for each ALU operation. It turns out this is really frickity fucking hard to do by hand so I told a SAT solver to do it and it was fine until I asked for all the combinations I wanted and then... This.

    out.dimacs is 36MB

    c CNF file written by RustSAT  
    p cnf 217953 1366264  
    

    Also dimacs uses "c" for comments lol (it's just a huge file of numbers).

    Also also it turns out using 100% of all 24 cores on a laptop for 8 hours makes for some heat issues so I had to limit each core to 50% utilization so it will take twice as long yay.

    UPDATE: it's been 18 hours and the best it's got it 3.925%. If I linearly extrapolate, it will take 400-500 hours ≈ 2.5-3 weeks.

    UPDATE 2: I've turned it off, as I don't have more than a weekend to just leave my laptop sitting around.

    Statistics from the glucose sat solver superimposed with the PTSD Chihuahua meme. Top text, magenta: "will the sat solver ever finish?" Bottom text, yellow: "nobody knows, it's been 8 hours and 1.5% at best"
     

    Commented without looking at the instance, turns out I forgot to block ml when switching to piefed. Let's see how long this stays up lol.

    EDIT: Turns out they're fine with my comment. I should probably be less insulted by that.

    My comment text in case you want to copy/paste from it for some reason
    It's not about voting for the lesser evil, but against the worse one. The way the United States is structured, which influences the way its people think about voting and vice versa, you are given only two options when voting for president:

    • Vote for the Democrat one
    • Vote for the Republican one

    But... you might think you're clever and say "I should just vote for neither of them, nobody will stop me". If your state has RCV then put your preferred candidate as a first pick and just place Democrat before Republican. Problem solved, no more strategic voting. Unfortunately, precious few states have adopted this for any elections, let alone the presidency.

    In states without RCV, there are 3 equivalent cases from your perspective:

    • Vote Republican: Increment their number by 1
      • Overall effect +1 for Republicans
    • Vote Democrat: Increment a threatening score by 1, thereby requiring Republicans to gain 1 more vote to win
      • Overall effect -1 for Republicans
    • Don't vote or vote for a non threatening party/candidate
      • Overall effect 0 for Republicans

    Forgive me for assuming the reader wants to get Republicans (and Republican aligned Democrats) out of office. In this case, it is your responsibility to vote for the most threatening candidate. It's a sick trick of game theory, which is why RCV is so important.

    Post titled "You dont understand, you have to support the lesser evil"
    view more: next ›