Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
oconnor663
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
oconnor663
9mo ago
> With C you may, if you wish, develop a big sensibility to race conditions, and stay alert. In general it is possible that C programmers have their "bugs antenna" a bit more developed than other folks. I think there are effect
32.
▲
by
oconnor663
9mo ago
Ehhhhhh hating on AI is also extremely popular on social media.
33.
▲
by
oconnor663
10mo ago
Yes I'm especially interested in what OP thinks about the overlap (or not?) between the ideas in this post and the ideas in this part of boats' post: > One could imagine an alternative design in which instead of places being un
34.
▲
by
oconnor663
10mo ago
You have to consider the class of problems as a whole, from the perspective of management: - The cheap solution would be equally good, and it's just a blame shifting game. - The cheap solution is worse, and paying more for the name bra
35.
▲
by
oconnor663
10mo ago
> We recommend using Nix to easily ensure you are running the right versions of the tools and libraries. Ooof I remember when everything used to be like this. Cargo has really spoiled me.
36.
▲
by
oconnor663
10mo ago
> What is the dreaded UB? I think the best way to understand it is to remember that, for any running program, there are FATES WORSE THAN DEATH. I love this. I'm gonna steal this :) > I’m not the first person to pick on this parti
37.
▲
by
oconnor663
10mo ago
Yeah it's worth emphasizing, if I spawn two threads, and both of them print a message when they finish (and don't interact with each other in any other way), that's technically a race condition. The output of my program depen
38.
▲
by
oconnor663
10mo ago
> If the unwrap hadn't caused an exit, the process would've run out of memory It was trying to push an element into a full ArrayVec. The options are: - Blindly write off the end of the array. Obviously no one wants this, despit
39.
▲
by
oconnor663
10mo ago
> similar to what Bao encoding is used for in BLAKE3 In my mind Sakura and Bao are doing very different things. Sakura is a general framework for defining sound hash functions, while Bao is a BLAKE3-specific interleaving of hash function
40.
▲
by
oconnor663
11mo ago
BLAKE3 does reduce the round count relative to BLAKE2, and the underlying compression functions are similar enough that it is an apples-to-apples comparison. Our rationale for doing that was described in https://eprint.iacr.org
41.
▲
by
oconnor663
11mo ago
This is a difference between BLAKE3 and most other hash functions. In the usual arrangement ("Merkle–Damgård"), each block depends on the previous one, so the only way to verify some "slice" of the input is to re-hash th
42.
▲
by
oconnor663
11mo ago
> to rewrite some feature for a tiny security benefit For what it's worth, the zero->one introduction of a new language into a big codebase always comes with a lot of build changes, downstream impact, debate, etc. It's good
43.
▲
by
oconnor663
11mo ago
> They did this by not breaking the universe in these major updates I don't think the amount of breakage per se was the problem with Python 3. I think the problem was that for a long time (until u"" strings in 3.3? four y
44.
▲
by
oconnor663
11mo ago
When I was doing undergrad CS in 2006, we had a choice between Perl and Python for our scripting assignments. As far as I know, no one chose Perl. It's comparatively a huge pain to get ramped up on, and the promised payoff is that yo
45.
▲
by
oconnor663
11mo ago
The boring answer is that standard atomics didn't exist until C++11, so any compiler older than that didn't support them. I think most platforms (certainly the popular desktop/server platforms) had ways to accomplish the same
46.
▲
by
oconnor663
11mo ago
I think it's pretty rare to do a straight up atomic load of a refcount. (That would be the `use_count` method in C++ or the `strong_count` method in Rust.) More of the time you're doing either a fetch-add to copy the pointer or a
47.
▲
6 years after too much crypto
(bfswa.substack.com)
3 points
by
oconnor663
11mo ago
|
0 comments
48.
▲
by
oconnor663
11mo ago
I imagine it's kind of like "What's stopping someone from forging your signature on almost any document?" The point is less that it's hard to fake, and more that it's a line you're crossing where everyone
49.
▲
by
oconnor663
11mo ago
I still wouldn't call it GC in that case. It's pretty much exactly the same as std::shared_ptr in C++, and we don't usually call that GC. I don't know about the academic definition, but I draw the line at a cycle collect
50.
▲
by
oconnor663
11mo ago
Take a look at the examples in this post: https://www.microsoft.com/en-us/msrc/blog/2019/07/we-need-a-... Large C++ codebases have the same problems that large codebases have in any language: too ma
51.
▲
by
oconnor663
11mo ago
I like to focus on the ways that C is actually quite complicated, especially the complications that directly provoke UB when you don't know about them. Integer promotion and strict aliasing are at the top of my list.
52.
▲
by
oconnor663
11mo ago
To be clear, if you restrict yourself to `async`/`.await` syntax, you never see any of this. To await something means to poll it to completion, which is usually what you want. "Joining" two futures lets you poll both of them
53.
▲
by
oconnor663
11mo ago
Rust futures are "just" structs with a poll() method. The poll() method is a function like any other, so it can have local variables on the stack as usual, but anything it wants to save between calls needs to be a field of the str
54.
▲
by
oconnor663
11mo ago
> This seems like a contradiction to me. How can future1 acquire the Mutex in the first place, if it cannot run? The word "given" is really odd to me. `future1` did run for a bit, and it got far enough to acquire the mutex. (As
55.
▲
by
oconnor663
11mo ago
> so no virtual dispatch Speaking of which, I'm kind of surprised we landed on a Waker design that requires/hand-rolls virtual dispatch. Was there an alternate universe where every `poll()` function was generic on its Waker?
56.
▲
by
oconnor663
11mo ago
Kind of a tangent, but I think "systems programming" tends to bounce back and forth between three(?) different concerns that turn out to be closely related: 1. embedded hardware, like you mentioned 2. high-performance stuff 3. &qu
57.
▲
by
oconnor663
11mo ago
> I wonder if there is a similar idea possible with tokio? E.g. if you are awaiting a Mutex held by a future that "can't run", then poll that future instead. Something like this could make sense for Tokio tasks . (I don&#
58.
▲
by
oconnor663
11mo ago
There's nothing `select!` could do here to force `future1` to drop, because it doesn't receive ownership of `future1`. If we wanted to force this, we'd have to forbid `select!` from polling futures by reference, but that'
59.
▲
by
oconnor663
11mo ago
The author clearly understands these details. I think it's just a question of wording: did we "drop a reference (which has no effect)" or did we "not drop anything (because references don't implement Drop)"?
60.
▲
by
oconnor663
11mo ago
> FAQ: doesn’t future1 get cancelled? I guess cancellation is really two different things, which usually happen at the ~same time, but not in this case: 1) the future stops getting polled, and 2) the future gets dropped. In this example
More ›