Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dwattttt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
601.
▲
by
dwattttt
2y ago
You can be brilliant and greedy. The point at which you're making statements based on your greed rather than your brilliance, that's the line we stop saying they're brilliant.
602.
▲
by
dwattttt
2y ago
> But then this just pushes the question back one step: How could this brilliant statistician be so naive? I would suggest that if they're taking money to spout bad science, they're not actually brilliant. So I would suggest th
603.
▲
by
dwattttt
2y ago
We may have to agree to disagree. I'm trying to convey a function that would need a different cleanup to occur after each call if they were to fail, e.g. reducing the len by one (though that is the same here too).
604.
▲
by
dwattttt
2y ago
I do, but I'm still expecting things to be more complicated than that example. For instance, this is the the scenario I expect to be harder to manage with exceptions & cleanup: this.len += 1; foo(); this.len += 1; bar();
605.
▲
by
dwattttt
2y ago
> Moreover, your foo() and bar() calls can actually begin to fail in the future when more functionality is added to them. Heck, they might call a user callback that performs arbitrary tasks. Then your code will break too. Whereas with th
606.
▲
by
dwattttt
2y ago
Apologies, I believe I meant if the foo/bar/baz calls couldn't fail. If there's no exceptions, you don't need the cleanup block, but in the presence of exceptions you have to assume they (and all calls) can fail. Th
607.
▲
by
dwattttt
2y ago
Then I think the counter-example is where function calls that can't fail are interspersed. Those are the cases where with exceptions (outside checked exceptions) you have to assume they could fail, and in a language without exceptions
608.
▲
by
dwattttt
2y ago
I can't parse this super well on mobile, but what invariant is this maintaining? I was imagining a function that manipulated a collection, and e.g. needed to decrement a length field to ensure the observable elements remained valid, th
609.
▲
by
dwattttt
2y ago
50 different dependencies covers a _lot_ more behaviour than a list.c. The point would be to audit a list package, and have audited it for all users, rather than all users needing to audit their own.
610.
▲
by
dwattttt
2y ago
None of those are easier than not needing to do it at all though; if your functions exits are only where you specify, you can cleanup only once on those paths.
611.
▲
by
dwattttt
2y ago
The general problem cited with exceptions is that they're un-obvious control flow. The impact it has is clearer in Rust, because of the higher bar it sets for safety/correctness. As a specific example, and this is something that&#
612.
▲
by
dwattttt
2y ago
An alternative of "now everyone who uses a linked list has their own mostly-the-same, but-just-different-enough" list.c and list.h files that need separate auditing (if you care) isn't better.
613.
▲
by
dwattttt
2y ago
> This is trivial if your build system detects changes based on content (like, say, bazel), but if it uses timestamps (like make) then the compiler needs to ensure the timestamp isn't updated when the declarations don't change.
614.
▲
by
dwattttt
2y ago
Curious. I don't have an account, and I can read it.
615.
▲
by
dwattttt
2y ago
CheriBSD is definitely closer: https://www.cheribsd.org/ . Or one of the other CHERI projects.
616.
▲
by
dwattttt
2y ago
Ah, I see that it's because the char type never violates Strict Aliasing. I was wondering how you could define a type such as Chunk, yet hand out a pointer to it to a user who will cast it to some other type.
617.
▲
by
dwattttt
2y ago
I understand the C standard hides such actions behind a wall of "this is the allocator", and expected the compiler authors to also be the allocator authors, allowing them to know when/how they can break such rules (in the con
618.
▲
by
dwattttt
2y ago
> it doesn't have to generate a whole bunch of templated functions and then optimize down to the ones that actually get used. It's been a long time since I've dealt with templated C++, but I thought this was how C++ does i
619.
▲
by
dwattttt
2y ago
How does consteval interact with thread_local? Defined (although I'm not sure what definition could make sense), error, or the dreaded "No diagnostic required"?
620.
▲
by
dwattttt
2y ago
In much the same way as "being Turing complete means you can do anything", it just being possible to do compile-time execution isn't the reason Zig is exciting here. C++ adding the same features means it'll be possible,
621.
▲
by
dwattttt
2y ago
Bash scripts and (optionally) an assembler can do this. That's not really the point.
622.
▲
by
dwattttt
2y ago
I was surprised to find out The Gnorp Apologue was written in Rust, it's done surprisingly well: https://old.reddit.com/r/rust/comments/18ul125/writing_a_gam...
623.
▲
by
dwattttt
2y ago
It depends on whether you think you have a job, rights, or a king.
624.
▲
by
dwattttt
2y ago
Ramen to that
625.
▲
by
dwattttt
2y ago
It's a shoe-in
626.
▲
by
dwattttt
2y ago
I fear we may have gotten away from the Windows kernel writing an output value asynchronously to a user space address on IO completion.
627.
▲
by
dwattttt
2y ago
By policy, asking the Windows kernel to write to an address happens within an SEH try/catch, and a failure will result in the kernel returning an error code. The kernel has no reason to be trying to bypass page protections; what if you
628.
▲
by
dwattttt
2y ago
> We should get at least a couple of decades of forewarning if such a shift is likely to be needed, which should be enough to plan for and test the first migration. A migration that only happens every couple of decades is guaranteed to b
629.
▲
by
dwattttt
2y ago
> When a rabbit is placed inside the Black Box and vanishes on cue, it is the audience’s privilege to simply ooh and aah in wonderment. But we who step on stage should know how the trick is done. The loss of innocence is the price of app
630.
▲
by
dwattttt
2y ago
Sure, but only by either changing the page permissions on the page that virtual address is on, or by remapping it elsewhere as writable; both of those are heavy handed operations, and neither would be in the "report the result of an IO
More ›