32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions
comment 2y ago · link · parent
The problem is that you end up promoting y from an integer to an f64 and get a much slower operation. I ended up writing my own `rem_i64(self: &f64, divisor: i64) -> f64` routine that was some ~35x faster (a huge win when crunching massive arrays), but as there are range limitations (since f64::MAX > i64::MAX) you can't naively replace all call sites based on the type signatures. However, with some support from the compiler it would be completely doable anytime the compiler is able to infer an upper/lower bound on the f64 dividend, when the result of the operation is coerced to an integer afterwards, or when the dividend is a constant value that doesn't exceed that range.
So now I copy that function around from ML project to ML project, because what else can I do?
(A “workaround” was to use a slower-but-still-faster `rem_i128(self: &f64, divisor: i128) -> f64` to raise the functional limits of the operation, but you're never going to match the range of a 64-bit floating point value until you use 512-bit integral math!)
[0]: https://github.com/rust-lang/rust/issues/83973
Godbolt link: https://godbolt.org/z/EqrEqExnc
comment 2y ago · link · parent
This is almost universally true across all languages. The behaviors you see are usually the result of countless heuristics stacked one atop the other, and a tiny change here can end up with huge changes there.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
Admittedly it’s not a crazy amount of work at a baseline, but device-specific information needs to be added for the kernel to understand address maps, available peripherals, linker shenanigans, and more. This is (partiallly) what device tree overlay blobs are for on Linux (and why you can’t just run Windows/AARCH64 on any hardware of your choosing).
comment 2y ago · link · parent
If I said language foo that isn’t TS but transpiled to JS all the same was considering that syntax, people might have a different opinion.
comment 2y ago · link · parent
comment 2y ago · link · parent
I don’t know if you’re aware but Samsung introduced their own version of optane just shortly before Intel killed their product line. It was called Samsung Z and it was prohibitively expensive for some reason, but I didn’t hear that it was officially killed off (though it likely has been).
comment 2y ago · link · parent
I'm a fish-shell developer and I just dealt with a user that was getting bizarre test failures. Turns out the developers didn't account for basic things like the normalcy of `cat` having its output fd closed mid-stream (e.g. you are piping cat to something and that something exits before cat does) and their vesrion bails with an exception dumped to stderr instead of silently closing with a non-zero exit code.
comment 2y ago · link · parent
And that answered the question I've had ever since I first saw this picture. Truly sad, but I can't say I don't understand how Carter got there.
Imagine how he'd feel to know that we now have yet another famine happening all over again, this time with food a mere 20km away and hundreds of trucks laden with food just waiting desperately to be allowed to deliver their goods, blocked by both a government bent on extracting the highest possible price in blood and its citizenry that willingly throws itself in front of moving trucks to prevent the aid from reaching their human brothers and sisters.
To think that these all exist in the same universe.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
In Chicago (Pareto optimal for flattest/biggest metro area in the USA), we have two “going speeds” on the highway: 5 mph and 85+ mph. I drive fast (not going to go on the record here, but use your imagination - I mainly buy German cars that excel on the Autobahn) and I’m routinely only in the top quartile if I’m not in an actual hurry.
(I know EVs are much better in stop-and-go traffic than ICE but I can’t imagine 5mph with five-to-ten second bursts of 30 mph is great for the range, either.)
comment 2y ago · link · parent
Not a great example since that’s actually why all the other propositioned system language replacements never took off in the way rust did. Rust is (or can be, but importantly, when used idiomatically and not just “in some form”) as fast as C.
There were lots of other languages that tried to replace C with better DX but failed because they weren’t Pareto optimal. So I kind of get GP’s point: DX alone won’t cut it.
comment 2y ago · link · parent
comment 2y ago · link · parent
(Also note that OP’s version doesn’t require a motor either and can be actuated by hand, per TFA.)
comment 2y ago · link · parent
comment 2y ago · link · parent
(I am not insinuating that Tesla did not do this, as I have no clue and I am not up to date on all things Cybertruck.)