Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
MaulingMonkey
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
MaulingMonkey
3y ago
Your proposal seems like an unnecessary half measure to me. If you want to go fully ergonomic, you can expose: pub unsafe fn qsort<E, C: FnMut(&E, &E) -> core::cmp::Ordering>(elements: &mut [E], mut comp: C) I
92.
▲
by
MaulingMonkey
3y ago
To play devil's advocate: `Arc<T>` places the refcounts immediately before `T` in memory. If you are desperate to have `T` and `T`'s refcounts be on different cachelines to reduce false sharing in some contrived scenario, `
93.
▲
by
MaulingMonkey
3y ago
Screwed up on the 4th question by mistakenly assuming the minimum standard-allowed magnitude of INT_{MIN,MAX} implied int was at least 32 bits. While that's true for LONG_{MIN,MAX} and long, int can be a mere 16 bits. Good to have had
94.
▲
by
MaulingMonkey
3y ago
As 1 of ∞ examples of UB land, I once had to debug JS objects being misinterpreted as numbers when https://duktape.org/ was miscompiled with a fast-math equivalent (references to objects were encoded as NaNs.)
95.
▲
by
MaulingMonkey
3y ago
> Not really. Yes really. > While you may end up testing third-party code incidentally in the process of you testing your first-party code, explicit tests directed at third-party code necessarily requires testing implementation detail
96.
▲
by
MaulingMonkey
3y ago
> You don't. Testing third-party code is beyond the purview of first-party tests. Testing third-party code is often well within the purview of first-party integration testing. Aside from validating your code, and your understanding
97.
▲
by
MaulingMonkey
3y ago
> For example, you want to test that an entry in a caching library is indeed expiring entries like you wanted. How do you change the library to consume a time interface, if that library doesn't expose it to you? Intercepting/ho
98.
▲
by
MaulingMonkey
3y ago
I'll make a similar, but fundamentally different, claim to what you're quoting: There isn't much demand for half assed memory safety features. And C++ memory safety features are - nearly by definition - half assed. They&
99.
▲
by
MaulingMonkey
3y ago
> Though even faster will be doing part of the computation now and then switching to new hardware later Not necessairly. This still costs: • Programmer/development time to implement save/restore/transfer • Time on new har
100.
▲
by
MaulingMonkey
3y ago
Rust's `time` crate does have separate types for these: https://docs.rs/time/latest/time/struct.OffsetDateTime.html https://docs.rs/time/latest/time/struct.Primitive
101.
▲
by
MaulingMonkey
3y ago
__PRETTY_FUNCTION__ isn't even guaranteed - on MSVC you'll need to resort to __FUNCSIG__ instead. Example for GCC/Clang/MSVC: https://wandbox.org/permlink/eMt6MxecI4VoJD9m
102.
▲
by
MaulingMonkey
3y ago
> But how often do you do this? Gameplay code often has a lot of frequently changing enums. Audio IDs, events, modifier IDs (surfaces like dirt/grass/etc.), achievement IDs, entity types, resources, ... - these often event
103.
▲
by
MaulingMonkey
3y ago
Which also means that if you've been dealing with anything referencing build matricies in Visual Studio, you've been using "x64" too. Perhaps exclusively. devenv.com Everything.sln /Build "Debug|Win32&
104.
▲
by
MaulingMonkey
3y ago
> Sometimes I wonder why things like vigilanteism and other bad behaviors were so prevalent in the past, For vigilanteism it seems simple to me: it was the original counterforce against anti-social sociopathic and predatory behavior such
105.
▲
by
MaulingMonkey
3y ago
> Do you need to know how fast I type before you run the calculation? I'll assume 100WPM, call that two words, billed at $200/hour and call that $0.06, falling under "too cheap to be worth arguing against", which fall
106.
▲
by
MaulingMonkey
3y ago
Justify the dev time to save micro-pennies worth of electricity to me instead. A typical naive index won't help with my regular expression based queries, which aren't easily accelerated by an index. Or given an in-memory index, y
107.
▲
by
MaulingMonkey
3y ago
> Based on the NFL's collective bargaining agreement, players on the winning team in Super Bowl LVII will receive $157,000 apiece. Players on the losing team receive $82,000 per player. [...] https://www.kare11.com/
108.
▲
by
MaulingMonkey
3y ago
> What is there to be afraid of? All the other idiots on the road with minimal/no snow experience, refrozen sleety wet black ice that's far more treacherous than proper dry snow, hills, roads that are not merely not salted, but
109.
▲
by
MaulingMonkey
4y ago
> The nonsense end result of that line of logic is that you return a single boolean that corresponds to failure/success, so I assume that's not what you mean. I frequently find that is all that is necessary, and is exactly the
110.
▲
by
MaulingMonkey
4y ago
> It feels like tail calls are too high level of a concept to be in an "assembly" language. In x86, the difference is between `call some_fn` and `jmp some_fn` (perhaps after a `call _guard_check_icall` to implement Control Flow
111.
▲
by
MaulingMonkey
4y ago
N.B. nonzero bitpattern nullptrs are common in C++ for pointer-to-member s, which are typically implemented as an offset from the start of the structure - with an all-0 bitpattern being a valid non-null pointer to the first member of said
112.
▲
by
MaulingMonkey
4y ago
> edit-and-continue Breaks on enough codebases for me to not be in the habit of relying on it. My own "killer feature" of VS debugging is being able to open up a crash dump, have VS auto-download matching pdbs from a symbol ser
113.
▲
by
MaulingMonkey
4y ago
> If everyone is aware of what went wrong Big assumption. Chances are at least someone was out on vacation or something. A postmortem can help spread the word - and perhaps calm those downstream who weren't in the loop as much,
114.
▲
by
MaulingMonkey
4y ago
> Is there any? I think most modern compiler share the same codegen backend. JIT-focused .NET is one of the ecosystems disparate from AOT-focused LLVM. While there's a bit more cross pollination now, at the time the C# to C++ trans
115.
▲
by
MaulingMonkey
4y ago
This is arguably already the state of things. Rust might get compiled down through MIR, down through LLVM IR, down to assembly or wasm... which then might be JIT or AOT (re)compiled into other bytecodes... which might perhaps be decompiled
116.
▲
by
MaulingMonkey
4y ago
> I didn't realize OpenJDK targets systems without filesystems. To be fair I'm not sure it does, really, per se. I know embedded Java is/was a thing, though, and it wouldn't suprise me if someone somewhere tortured t
117.
▲
by
MaulingMonkey
4y ago
> Why would you not just put test input in a separate test-input file that you pipe in? You just added a dependency on File I/O (can't easily run the test on filesystemless embedded/wasm targets), deserialization, the curr
118.
▲
by
MaulingMonkey
4y ago
At least as implemented in these retro-style engines, it's a technique with a lot of limitations. Crawling pervasively 2D data, in 2d grids, and grid-aligned 2d wall data, interleaved with 2d screen-aligned sprites with a scaling fact
119.
▲
by
MaulingMonkey
4y ago
I can see wanting to stick to plain ASCII for identifiers, but what of embedded strings? Localization might prefer to be data-driven, but what of unit tests surrounding text management - including locale-specific sorting tests, glyph rende
120.
▲
by
MaulingMonkey
4y ago
Micro and macro are both important. I've built crash collection and deduplication systems, I've heard of triage that helps discount crashes generated by hardware failures or overeager overclocking. I've collected telemetry a
More ›