Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
oconnor663
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
61.
▲
by
oconnor663
11mo ago
PyO3 and Maturin are excellent. I've been maintaining a Python-module-written-in-Rust for several years now, and it's been quite smooth.
62.
▲
by
oconnor663
1y ago
If you want to try an optimized AVX-512 implementation of KangarooTwelve on the command line, you can `cargo install k12sum`. On my machine it's neck-and-neck with `b3sum --no-mmap` (which does not use threads). Edit: Oh it looks like
63.
▲
by
oconnor663
1y ago
It's relatively common for it to be a privacy concern. Imagine if I'm making an online payment or something, and one of the IDs involved tells you exactly when I created my bank account. That's a decent proxy for my age.
64.
▲
by
oconnor663
1y ago
That could be well defined for POD types like arrays of bytes (I think in that case they call it "freezing"), but you'd still have undefined behavior if the type in question contained pointers. Also at least in Rust it's
65.
▲
by
oconnor663
1y ago
Yes. You have to write `unsafe { ... }` around it, so there's an ergonomic penalty plus a more nebulous "sense that you're doing something dangerous that might get some skeptical looks in code review" penalty, but the re
66.
▲
by
oconnor663
1y ago
> and the rate of change is low (or zero) This jives with a point that the Google Security Blog made last year: "The [memory safety] problem is overwhelmingly with new code...Code matures and gets safer with time." https:/
67.
▲
by
oconnor663
1y ago
> questioning the correctness of this auto-generated code I wouldn't put it that way. Usually when we say the compiler is "incorrect", we mean that it's generating code that breaks the observable behavior of some pr
68.
▲
by
oconnor663
1y ago
select() is at least kind of deprecated, in that its own man page says not to use it in new code.
69.
▲
by
oconnor663
1y ago
This is a common misconception, based on the difference between password hashing and other general uses for a cryptographic hash. Password hashing is special, because we want to protect people who pick terrible passwords, so we need guess-a
70.
▲
by
oconnor663
1y ago
It's "easy" to do it right but also very common to do it wrong: https://jacko.io/tree_hashing.html
71.
▲
by
oconnor663
1y ago
Indexes: https://jacko.io/object_soup.html
72.
▲
by
oconnor663
1y ago
I think "writing Rust in C++" so to speak means at least two distinctly different things, which are both important. The first thing is that, as an individual programmer, you're being disciplined with memory and thinking about
73.
▲
by
oconnor663
1y ago
What is your goal for this comment?
74.
▲
by
oconnor663
1y ago
I know you've thought carefully about these issues, but still it can't be that simple, can it? Closing a file or a socket is a fallible operation too.
75.
▲
by
oconnor663
1y ago
function xor(x, y) { return (x + y - 2 \* and(x, y)); } TIL!
76.
▲
by
oconnor663
1y ago
Note that C++ coroutines use heap allocation to avoid the problems that Pin is solving, which is a pretty big carve-out from the "zero overhead principle" that C++ usually aims for. The long development time of async traits has al
77.
▲
by
oconnor663
1y ago
> don't use `let mut buf = [0u8; 16]; socket.read_all(&mut buf).await?;`. If you can't see why such arguments are bonkers, we don't have anything left to talk about. It doesn't seem bonkers to me. I know you alrea
78.
▲
by
oconnor663
1y ago
The fast thing: 100/300 per day -> 640 per day (ish) The expensive thing: 100 per week -> 200 per week This is...the opposite of a nerf? The numbers goed up? (We can quibble about the daily vs hourly difference, but certainly for
79.
▲
by
oconnor663
1y ago
Here's one of my recorded talks going through an example of using a `#[repr(C)]` struct (in this case one that's auto-generated by Bindgen): https://youtu.be/LLAUzghhNHg?t=2168
80.
▲
by
oconnor663
1y ago
> It's perfectly clear to a human that this code is fine and doesn't have any actual ownership issues. I think there's another part of the story in a few of these examples that the author might be missing. Sometimes Rust d
81.
▲
by
oconnor663
1y ago
C++ teachers like Herb Sutter like to jump in here and make a correction: A moved-from object is in a valid state, you just might not know which state. You can still call methods on it that are valid in any state. ("What is your le
82.
▲
by
oconnor663
1y ago
Here's another data point: https://lobste.rs/s/yubalv/pointers_are_complicated_ii_we_ne... > I spoke to Apple folks when their compiler team switched the default to strict aliasing. They reported that it m
83.
▲
by
oconnor663
1y ago
To elaborate on that some more, safe Rust can guarantee that mutable aliasing never happens, without solving the halting program, because it forbids some programs that could've been considered legal. Here's an example of a functio
84.
▲
by
oconnor663
1y ago
You're already getting a lot of replies, and I don't want to pile on, but I think the clearest way to see the intent there is at the start of the following paragraph: > Given that aliasing optimizations are something that the R
85.
▲
by
oconnor663
1y ago
> it's defined in both .python-version and pyproject.toml The `requires-version` field in `pyproject.toml` defines a range of compatible versions, while `.python-version` defines the specific version you want to use for developmen
86.
▲
by
oconnor663
1y ago
> Perhaps you’re a user of LLMs. I get it, they’re neat tools. They’re useful for certain kinds of learning. But I might suggest resisting the temptation to use them for projects like this. Knowledge is not supposed to be fed to you on a
87.
▲
by
oconnor663
1y ago
A pedantic but maybe-not-entirely-pedantic point: It depends on what you mean by 99%. If the calculator has a little gremlin in it that rolls a random 100-sided die, and gives you the wrong answer every time it rolls a 1, then you certainly
88.
▲
by
oconnor663
1y ago
> 27 years later, talking to the latest Siri, it makes just as many mistakes as it did back then Have you tried talking to ChatGPT voice mode? It's mind blowing. You just have a conversation with it. In any language. About anything.
89.
▲
by
oconnor663
1y ago
> don't seem to be getting better recently o3 came out just one month ago. Have you been using it? Subjectively, the gap between o3 and everything before it feels like the biggest gap I've seen since ChatGPT originally came out
90.
▲
by
oconnor663
1y ago
Fwiw I don't think there's anything inherently sequential about the Keccak permutation itself. KangarooTwelve is a fully parallelizable hash built on Keccak. (Though they did use the sponge construction on the XOF side, so that pa
More ›