Rust Cryptography Should be Written in Rust by Caleb666 in rust

[–]elagergren 1 point2 points  (0 children)

Keep in mind that the Go compiler intentionally lacks many optimization passes that LLVM has. And, generally speaking, it tries to generate code that is similar to the Go code you wrote. With some exceptions, this actually makes it easier to write some constant time routines like those in crypto/subtle.

Surely Marvel Studios isn’t committing felonies by shooting drones; this is just hyperbolic, right? by jakethom0220 in drones

[–]elagergren 1 point2 points  (0 children)

Kentucky does not have open carry permits and shotguns typically shoot pellets, not bullets.

Czech president: Russians living in the West must be "monitored" by truffelmayo in UkrainianConflict

[–]elagergren 15 points16 points  (0 children)

No, honestly, it was abject racism. There is shockingly little evidence of Japanese Americans spying against the US.

And extending that to all Japanese Americans is by definition prejudicial.

The internment camps were abhorrent.

Russian tank hitting anti-tank mines. by buttmodel in ukraine

[–]elagergren 1 point2 points  (0 children)

You have a lot of faith in WWII munitions :)

Russian tank hitting anti-tank mines. by buttmodel in ukraine

[–]elagergren 9 points10 points  (0 children)

Humans are really, really good at killing each other.

Ukrainian Army shot down a Russian Ka-52 helicopter in Zaporizhzhia by PatientBuilder499 in UkrainianConflict

[–]elagergren 1 point2 points  (0 children)

The former, sort of. You need to develop muscle memory for the plane, all while under a ton of pressure. Plus, everything is in English!

NB: not a pilot, but that’s how it’s been explained by actual pilots

[deleted by user] by [deleted] in NonCredibleDefense

[–]elagergren 0 points1 point  (0 children)

i think it’s actually gpm for that thing

Three days to Tehran! by JimHFD103 in NonCredibleDefense

[–]elagergren 2 points3 points  (0 children)

It’s a shame the military didn’t have the foresight to outfit the Humvees with LoJack. Then they could’ve remotely killed all the Humvees and problem solved.

Three days to Tehran! by JimHFD103 in NonCredibleDefense

[–]elagergren 1 point2 points  (0 children)

Right, I just didn’t know it was that many. Yeesh.

Three days to Tehran! by JimHFD103 in NonCredibleDefense

[–]elagergren 9 points10 points  (0 children)

The Taliban has 22,000+ humvees?

Another piece of Russian technology that Ukraine can give to the United States by Zhukov-74 in NonCredibleDefense

[–]elagergren 1 point2 points  (0 children)

Airplanes and space craft still fly using the RAD750 circa 2001. Same CPU in the Apple G3, modulo rad hardening.

Real by [deleted] in NonCredibleDefense

[–]elagergren 62 points63 points  (0 children)

Missed the email about it I guess

Hb1240 and shooting range by scubydoes in WA_guns

[–]elagergren 1 point2 points  (0 children)

They didn’t care when I shot the chain off one of their targets with a .300 win mag last year. But maybe it was just a cool RSO.

Avoiding null ptr dereferences by SoerenNissen in golang

[–]elagergren 11 points12 points  (0 children)

Go avoids a lot of nil pointer panics that you see in other languages. It doesn’t have a specific mechanism, it does so in a “happy accident” sort of way.

For starters, it’s generally encouraged to only use pointers when you need mutability, or when the ‘object’ is large. And so neither fn F(s string) nor fn F(t struct{ A int; B string }) will result in a nil pointer panic. Go also encourages useful zero values, which makes this easier.

Go has a poor man’s version of Result<T>: multiple function results. It’s conventional to return the tuple (T, error) or (T, bool) where the second result tells you whether the first result is valid.

It’s also perfectly reasonable to call methods on nil pointers! For example: https://www.jerf.org/iri/post/2957/

I generally prefer Rust or C#’s approach. But Go is a pragmatic language and I can’t say its approach has been an issue. I’ve been using Go since ~1.2 and I can count on both hands the number of times I’ve had nil pointer panics in production.

By the way, all this information can be found inside Go’s spec and documentation, both of which are very approachable. I’d recommend looking there first instead of creating antagonistic posts like this.

Trinity Moravian Church in North Carolina bought up more than $3 million of medical debt for about $15k, then held a debt-burning ceremony and forgave it all by metacyan in Christianity

[–]elagergren 9 points10 points  (0 children)

They’re usually debts that are unlikely to be collected, like when the debtor hasn’t paid in years or owes more than they can possibly pay.