Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions

mqudsi on most sites.
Submissions

comment 2y ago · link · parent

I knew someone would pipe in with that suggestion as I was writing that comment!

Yes, I suppose that would be the canonical way to go. But it's just one function; four lines! I'm getting isEven() vibes!

comment 2y ago · link · parent

Honestly, the typesetting on the entire page is an absolute mess.

comment 2y ago · link · parent

This reminds me of an issue that I ran into with rust [0] when I was trying to optimize some machine learning code. Rust's über-strict type-safe math operations have you use matching types to get the euclidean non-negative remainder of x mod y. When you have a float-point x value but an integral y value, the operation can be performed much more cheaply than when y is also a floating point value.

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

You can never trust an optimizing compiler. I’ve seen similar issues in pretty much every language I’ve written performance-sensitive code in. Point revisions change optimizations all the time, sometimes with horribly disastrous results. One example: every time rust upgrades the version of LLVM underlying the compiler backend, the team prepares itself for a deluge of optimization regression reports (though this has been somewhat "mitigated" by a massive regression in rustc's ability to convey sufficient information to the LLVM backend for it to optimize to begin with, thanks to a change made to improve compile times [0]).

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.

[0]: https://github.com/rust-lang/rust/pull/91743

comment 2y ago · link · parent

> but I think the LLVM folks have purposefully tried to match what GCC would do.

I never got that impression in my perusal of LLVM bug reports and patches. I wonder if there is an open issue for this specific case.

comment 2y ago · link · parent

Are these the ones that appear as two volumes? These have double the risk of failure, so you really have to run them in RAID1, halving the IOPS and storage. You get no benefit aside from lower power consumption and denser RAID boxes, but have to be careful because RAID on two volumes in the same shell is risky so you should RAID across shells.

comment 2y ago · link · parent

Cow tipping is, according to all reputable sources, largely an urban myth about what takes place in the rural regions.

comment 2y ago · link · parent

I found it deep in my Amazon “saved for later” but it’s no longer available: https://amzn.to/3z7QeGu

comment 2y ago · link · parent

True. But that’s really just another way of saying “at worst, ACPI can still require a small amount of the work that is always required for ARM hardware” if you squint and look at it from a glass-half-full perspective!

comment 2y ago · link · parent

ARM isn’t like x86 and generally doesn’t self-describe its hardware via some specification or interface.

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

Whether they should or not and whether that would be bad or not depends on how close of a relationship you believe should/does exist between TypeScript and JavaScript l, specifically in the TS to JS direction.

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

I feel like it’s going to be an inevitable language update to allow that syntax. I’m surprised TypeScript hasn’t succumbed to the pressure to support that syntax, but they’re really strict about where they allow deviations from the JS superset.

comment 2y ago · link · parent

I have a custom loader that can operate in both sync and async mode with the same syntax; it started off as a single loader to load AMD and CommonJS but I’ve been meaning to add ESM support as well (it was more opaque than I liked when I last tried, required too much browser magic).

https://github.com/mqudsi/loader

comment 2y ago · link · parent

I have various generations of optane I stocked up on for my own small business and home lab use, and fully agree.

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

This is an ARM issue, not a Windows one. Same reason Linux needs device tree overlays.

comment 2y ago · link · parent

No, please don't! At least, not if you aren't equipped to handle the fallout yourself and not until these tools are further refined!

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

> Carter took his own life four months after winning the prize.

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

See also iceoryx2: https://github.com/eclipse-iceoryx/iceoryx2

comment 2y ago · link · parent

I was going to make a flippant remark asking the lines of “why is it never good news?” but realized it’s a good question and the obvious answer is that everything is in perfect balance after millennia of the planet’s existence. All of this is an aberration from the norm and it’s all going to be bad.

comment 2y ago · link · parent

Still rocking my Intel Xeon E3-1545M v5 (Skylake) from 2016. It was the only way to get ECC ram on a mobile workstation.

comment 2y ago · link · parent

I don’t think people like us register in the grand scheme of things.

comment 2y ago · link · parent

> If you drive 80 mph on a flat freeway

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

> Start-stop systems help, but a lot of people disable them.

I haven’t seen a modern car that let’s you actually disable this versus turn it off for the current ride only, fwiw.

comment 2y ago · link · parent

> That's like saying your two choices are Python and C, Rust not being worth it.

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

CSS can certainly be performant but you need to be aware of what can trigger reflows, which will absolutely destroy your performance. Cascading reflows are horrible.

comment 2y ago · link · parent

I was about to make a quip then I realized it’s actually somewhat of a valid point: if we’re going to inflation adjust USD purchase price, we need to inflation adjust RAM requirements. 512 MiB in 2012 went much, much further than how far 512 MiB will take you in 2024 (especially for the low-end desktop usage, rather than the embedded cli users).

comment 2y ago · link · parent

I don’t see what typical cars’ coating has to do with this. I am specifically talking about when you are already using SS.

comment 2y ago · link · parent

For something as short as a gpg key, you can easily use stamped brass “tape” 0.1-3mm in thickness. You can roll it like tape if it’s thin enough or just store it as a bar if your pattern is dense enough.

(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

I assume the following is perfectly doable from a technical perspective but is there any community support for using multiple allocators in this case to, eg parse general state to an arena and specific variables you want to use thereafter to a different allocator to remain long lived?

comment 2y ago · link · parent

When you make something from stainless steel, you should be choosing the correct SS grade for your application given the environmental constraints. I don’t know of any industrial SS application that relies on anti-corrosion coating (presumably consumable) instead of the actual formulation of the specific alloy.

(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.)

1
272829
277